> For the complete documentation index, see [llms.txt](https://indexone.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://indexone.gitbook.io/docs/product-guides/index-maintenance/set-up-s3-data-retrieval.md).

# Set up S3 data retrieval

## Step 1: Set up S3 delivery stream on Streams

Navigate to the [Streams](https://indexone.io/streams) page and set up a delivery a stream with the below configurations.

<figure><img src="/files/Qw349iFw58JFsdnYWnre" alt=""><figcaption></figcaption></figure>

## Step 2: Retrieve data from the S3 bucket&#x20;

Use this code to retrieve data from Index One's S3 bucket in Python.

Team directory is equal to the team\_id which is accessible from the Team page in the console.

```
import boto3

access_key = "xxxxxxxxxxxxxxxxxxxx"
secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
bucket_name = "prod-core-i1-export"
team_directory = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/"

session = boto3.Session(
    aws_access_key_id=access_key,
    aws_secret_access_key=secret
)

s3_client = session.client("s3")

r = s3_client.list_objects_v2(
    Bucket=bucket_name,
    Prefix=team_directory
)

for object in r['Contents']:
    s3_client.download_file(
        bucket_name,
        object['Key'],
        '/my/local/dir/filename.csv'
    )
```

Please get in touch with **<admin@indexone.io>** to request S3 access keys.&#x20;
