On this page
Export guide
POST /v1/exports builds JSON or CSV datasets using the same validated query engine.
| Cap | Env | Default |
|---|---|---|
| Sync inline threshold | EXPORT_SYNC_MAX_ROWS | 1000 |
| Hard maximum | EXPORT_MAX_ROWS | 5000 |
| TTL | EXPORT_TTL_HOURS | 168 (7 days) |
limit ≤ sync max→200with payload (mode: sync)sync max < limit ≤ hard max→202pending; poll status; download when complete- above hard max →
EXPORT_TOO_LARGE
Create (sync)
cURL
curl -s https://api.crunchclash.com/v1/exports \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"format": "csv",
"query": {
"entity": "player",
"season": "2026",
"metrics": ["goals", "minutes"],
"limit": 50
}
}'
JavaScript
const API_KEY = "YOUR_API_KEY";
const res = await fetch("https://api.crunchclash.com/v1/exports", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
format: "json",
query: {
entity: "player",
season: "2026",
metrics: ["goals", "minutes"],
limit: 50,
},
}),
});
console.log(await res.json());
Python
import requests
API_KEY = "YOUR_API_KEY"
r = requests.post(
"https://api.crunchclash.com/v1/exports",
json={
"format": "csv",
"query": {
"entity": "player",
"season": "2026",
"metrics": ["goals", "minutes"],
"limit": 50,
},
},
headers={"Authorization": f"Bearer {API_KEY}"},
)
print(r.status_code, r.json())
Status and download
# Status (add ?include=result for small completed jobs)
curl -s https://api.crunchclash.com/v1/exports/$EXPORT_ID \
-H "Authorization: Bearer YOUR_API_KEY"
# Download file
curl -sL https://api.crunchclash.com/v1/exports/$EXPORT_ID/download \
-H "Authorization: Bearer YOUR_API_KEY" \
-o export.csv
const API_KEY = "YOUR_API_KEY";
const id = "exp_…";
await fetch(`https://api.crunchclash.com/v1/exports/${id}`, {
headers: { Authorization: `Bearer ${API_KEY}` },
});
const file = await fetch(`https://api.crunchclash.com/v1/exports/${id}/download`, {
headers: { Authorization: `Bearer ${API_KEY}` },
});
import requests
API_KEY = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {API_KEY}"}
status = requests.get(f"https://api.crunchclash.com/v1/exports/{export_id}", headers=headers)
file = requests.get(
f"https://api.crunchclash.com/v1/exports/{export_id}/download",
headers=headers,
)
open("export.csv", "wb").write(file.content)
Exports expire after the TTL; Mongo TTL indexes delete expired documents.
Related: API Reference · Playground