Flat File Access

Flat-File Access with AWS CLI

This is the fastest procedure to make sure that your flat-file access operates correctly. Export the temporary credentials from the dashboard. Then run standard `aws s3` commands with the R2 endpoint.

1. Export The Credentials

export-env.sh
export AWS_ACCESS_KEY_ID="<TEMP_ACCESS_KEY_ID>"
export AWS_SECRET_ACCESS_KEY="<TEMP_SECRET_ACCESS_KEY>"
export AWS_SESSION_TOKEN="<TEMP_SESSION_TOKEN>"
export CHD_BUCKET="cryptohftdata-processed"
export CHD_ENDPOINT="https://e5de051a8af1332b58a11bd5b2e40258.r2.cloudflarestorage.com"

2. List The Bucket

This command makes sure that the R2 S3-compatible API accepts the temporary credentials, the endpoint and the session token.

aws-s3-ls
aws s3 ls "s3://$CHD_BUCKET/binance_spot/" \
  --endpoint-url "$CHD_ENDPOINT" \
  --region auto

3. Download A Known Object

aws-s3-cp
aws s3 cp "s3://$CHD_BUCKET/binance_spot/2026-09-02/12/BTCUSDT_trades.parquet" ./BTCUSDT_trades.parquet \
  --endpoint-url "$CHD_ENDPOINT" \
  --region auto

4. Download All Data For One Date

Object keys use the pattern {exchange}/{YYYY-MM-DD}/{HH}/{symbol}_{data_type}.parquet. To download all hours for one exchange on one date, copy the prefix for that date recursively.

Parquet files have ZSTD compression inside the file. Thus, you can open them directly in pandas, Polars or DuckDB. You do not have to decompress them in a separate step. Objects that we collected before 19 August 2026 have a .parquet.zst key instead. You must decompress these objects with zstd -d first. Because S3 access reads the bucket directly, the key must match exactly. The /download API accepts the two spellings for all dates.

aws-s3-cp-date-recursive
aws s3 cp "s3://$CHD_BUCKET/binance_spot/2026-09-02/" ./binance_spot_2026-09-02/ \
  --recursive \
  --endpoint-url "$CHD_ENDPOINT" \
  --region auto

Required Parameters

Make sure that `--endpoint-url` points to your account-specific R2 endpoint. Keep `--region auto`. Standard AWS tools need these two parameters to operate correctly with R2.

If you cannot find the information that you need, tell us. We also help with integrations.

Contact support