# 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="https://262590057-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbMMgayZaG49vP7JGYOuY%2Fuploads%2F2KD1zzHyR8g6Gn33HFNH%2Fimage%20(1).png?alt=media&#x26;token=8c47627a-1959-42a0-b026-3abead8ec883" 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;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://indexone.gitbook.io/docs/product-guides/index-maintenance/set-up-s3-data-retrieval.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
