Skip to main content

Downloading from R2 via S3 API

AWS Credentials

First, you’ll need to add the account and secret key for the indexed.xyz R2 bucket into your AWS credentials, either by running aws configure or by adding the following section to the credentials file, usually located at ~/.aws/credentials

[indexedxyz]
aws_access_key_id = 43c31ff797ec2387177cabab6d18f15a
aws_secret_access_key = afb354f05026f2512557922974e9dd2fdb21e5c2f5cbf929b35f0645fb284cf7

Downloading with the AWS CLI tools

To understand more about the R2 object structure, check our schema documentation.

To retrieve the files using the AWS cli tools, you can then run the following command in a terminal with the provided credentials:

$ aws s3 cp --endpoint-url https://ed5d915e0259fcddb2ab1ce5592040c3.r2.cloudflarestorage.com --profile indexedxyz s3://indexed-xyz-wnam/ethereum/raw/logs/v2.0.0/dt=2020-02-20/  . --recursive

This will download the Parquet files into the current directory.

Keep in mind that since the data is partitioned by day, the download will contain data for multiple smart contracts, not necessarily just the one that you’re looking for.