> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/10.-integrate-connect-your-stack/integration-s3-export.md).

# Send results to S3

```python
import json
from datetime import datetime, timedelta
import boto3
from layerlens import Stratix

client = Stratix()
s3 = boto3.client("s3")
BUCKET = "my-evaluation-archive"

# Page through recent evaluations
since = datetime.utcnow() - timedelta(hours=24)
page = 1
while True:
 response = client.evaluations.get_many(page=page, page_size=100, sort_by="submitted_at", order="desc")
 evaluations = [e for e in response.evaluations if e.submitted_at >= since]
 if not evaluations:
 break

 for evaluation in evaluations:
 # Get all per-prompt results
 all_results = client.results.get_all(evaluation=evaluation)
 payload = {
 "evaluation": evaluation.dict(),
 "results": [r.dict() for r in all_results],
 }
 s3.put_object(
 Bucket=BUCKET,
 Key=f"evals/{evaluation.id}.json",
 Body=json.dumps(payload, default=str).encode(),
 )

 if page >= response.pagination.total_pages:
 break
 page += 1
```

Wire from any scheduler (cron, GitHub Actions, Lambda) — see [daily smoke eval](/9.-improve-tune-the-system/daily-smoke-eval.md) for the scheduling pattern.

## See also

* [Python SDK reference](/6.-build-wire-your-code/sdk-python.md)
* [SDK reference: results](https://github.com/LayerLens/gitbook-full/blob/main/13-reference/sdk-python/results.md)
* [SDK reference: evaluations](https://github.com/LayerLens/gitbook-full/blob/main/13-reference/sdk-python/evaluations.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.layerlens.ai/10.-integrate-connect-your-stack/integration-s3-export.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
