Knowledge Base/How to get started with Flat Files & S3 on

How to get started with Flat Files & S3 on

Explore vast financial datasets with’s S3 integration. Easy setup with AWS CLI, Rclone, MinIO, or Boto3. See guide for details. is proud to offer extensive financial datasets, easily accessible thanks to S3. This guide provides detailed steps on setting up various S3 clients to efficiently retrieve the data you need.


A valid flat files subscription with, after which you will receive unique Access and Secret authentication keys from the Dashboard. We have standardized the endpoint and bucket details for all users as follows:

Endpoint: Bucket: flatfiles

Supported S3 Clients rigorously tests and supports four widely recognized S3 clients to ensure compatibility and user convenience. These include:

  1. AWS S3 CLI
  2. Rclone
  3. MinIO
  4. Python Boto3 SDK

Below, you’ll find the setup process for each client.


The AWS S3 Command Line Interface (CLI) is a powerful tool designed to interact with Amazon S3.

Here’s how to get started:

  • Install the AWS S3 CLI from the official website.
  • Run
    aws configure
    in your command line and enter your Access Key ID, and Secret Access Key.
  • To interact with’s S3 files, use aws s3 commands:

# Configure your S3 Access and Secret keys
aws configure set aws_access_key_id Your-Access-Key
aws configure set aws_secret_access_key Your-Secret-Key

# List
aws s3 ls s3://flatfiles/ --endpoint-url

# Copy
aws s3 cp s3://flatfiles/us_stocks_sip/trades_v1/2024/03/2024-03-07.csv.gz . --endpoint-url


Rclone facilitates data synchronization between your local system and S3 storage. Follow these steps to configure Rclone with

  • Download and install Rclone from here.
  • Initiate a new remote storage configuration with
    rclone config
  • Here’s an example configuration is provided below for reference:

# Set up your rclone configuration
rclone config create s3polygon s3 env_auth=false access_key_id=ACCESS_KEY_ID secret_access_key=SECRET_ACCESS_KEY endpoint=

# List
rclone ls s3polygon:flatfiles

# Copy
rclone copy s3polygon:flatfiles/us_stocks_sip/trades_v1/2024/03/2024-03-07.csv.gz .


MinIO client works seamlessly with any S3 compatible cloud storage. Here’s how to configure it with

  • If you haven’t already, download and set up MinIO from their documentation.
  • Here’s an example configuration is provided below for reference:

# Enter S3 Access and Secret keys in config file ~/.mc/config.json
mc alias set s3polygon Your-Access-Key Your-Secret-Key

# List
mc ls s3polygon/flatfiles

# View
mc cat s3polygon/flatfiles/us_stocks_sip/trades_v1/2024/03/2024-03-07.csv.gz | gzcat | head -4

# Copy
mc cp s3polygon/flatfiles/us_stocks_sip/trades_v1/2024/03/2024-03-07.csv.gz .

Python Boto3 SDK

Boto3 is the Amazon Web Services (AWS) SDK for Python, which enables Python developers to write software that makes use of Amazon services like S3. To set it up, follow these steps:

  • Install Boto3 by running
    pip install boto3
    if you haven’t already.
  • Utilize the following script to interact with data:

import boto3
from botocore.config import Config

# Initialize a session using your credentials
session = boto3.Session(

# Create a client with your session and specify the endpoint
s3 = session.client(

# List Example
# Initialize a paginator for listing objects
paginator = s3.get_paginator('list_objects_v2')

# Choose the appropriate prefix depending on the data you need:
# - 'global_crypto' for global cryptocurrency data
# - 'global_forex' for global forex data
# - 'us_indices' for US indices data
# - 'us_options_opra' for US options (OPRA) data
# - 'us_stocks_sip' for US stocks (SIP) data
prefix = 'us_stocks_sip'  # Example: Change this prefix to match your data need

# List objects using the selected prefix
for page in paginator.paginate(Bucket='flatfiles', Prefix=prefix):
    for obj in page['Contents']:

# Copy example
# Specify the bucket name
bucket_name = 'flatfiles'

# Specify the S3 object key name
object_key = 'us_stocks_sip/trades_v1/2024/03/2024-03-07.csv.gz'

# Specify the local file name and path to save the downloaded file
# This splits the object_key string by '/' and takes the last segment as the file name
local_file_name = object_key.split('/')[-1]

# This constructs the full local file path
local_file_path = './' + local_file_name

# Download the file
s3.download_file(bucket_name, object_key, local_file_path)

File Browser

If you want to get setup quickly and do not want to mess with an S3 client, you can start off with checking out the File Browser on the left hand side of the landing page here. The File Browser is also a great place for you to check out if you have access to certain files. Especially if you are running into a 403 Forbidden error. Remember to check your plan to verify what you have access to. Only paid plans have access to Flat Files.

Next Steps

By following the steps outlined for each client, you can efficiently set up your systems to access extensive financial datasets from via S3. or further assistance or more advanced setup options, please refer to the respective client’s official documentation.

Was this article helpful?

Schedule a demo

Talk with our market data experts


Modernizing Wall St.

Reimagining financial market data for the 21st century.

About Polygon


Can’t find the answer you’re looking for? Contact our team.