Guide
Exports
Exports write the result of any data endpoint to one JSON file in the background, following its pages for you. Queue the job, poll it, download the file.
Create, poll, download#
- Queue the export. POST /v1/exports with the path of any data endpoint and the query you would send to it. It answers
202. - Poll until it is ready. GET /v1/exports/{id} until
data.statusisready(orfailed). - Download the file. GET /v1/exports/{id}/download, or the relative
data.download_url.
# 1. Queue the export
curl -sS -X POST "https://api.ordermap.si/v1/exports" \
-H "Authorization: Bearer $ORDERMAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"path":"/v1/options/trades","query":{"underlying_symbol":"SPXW","date":"2026-10-16","limit":50000}}'
# 2. Poll until data.status is "ready"
curl -sS "https://api.ordermap.si/v1/exports/$EXPORT_ID" \
-H "Authorization: Bearer $ORDERMAP_API_KEY"
# 3. Download the file
curl -sS --compressed -o export.json "https://api.ordermap.si/v1/exports/$EXPORT_ID/download" \
-H "Authorization: Bearer $ORDERMAP_API_KEY"const headers = { Authorization: `Bearer ${process.env.ORDERMAP_API_KEY}`, "Content-Type": "application/json" };
const created = await fetch("https://api.ordermap.si/v1/exports", {
method: "POST",
headers,
body: JSON.stringify({ path: "/v1/options/trades", query: { underlying_symbol: "SPXW", date: "2026-10-16", limit: 50000 } }),
});
const { data: job } = await created.json();
let status = job.status;
while (status !== "ready" && status !== "failed") {
await new Promise((resolve) => setTimeout(resolve, 3000));
const polled = await fetch(`https://api.ordermap.si/v1/exports/${job.id}`, { headers });
status = (await polled.json()).data.status;
}
if (status === "ready") {
const file = await fetch(`https://api.ordermap.si/v1/exports/${job.id}/download`, { headers });
const { data, pages, truncated } = await file.json();
console.log(data.length, pages, truncated);
}The request#
- The body is
{"path": ..., "query": {...}}. Query values are strings, numbers, booleans or arrays of those (for list parameters). - The query is validated with the endpoint's own rules before the job is accepted: a
400withdetailsprefixedquery.. - Platform and account endpoints cannot be exported.
- Entitlement checks are those of the endpoint: dataset release, overnight and history window. The window applies to
end_timeas well asstart_time, so a range ending before it is refused up front. Futuressessionvalues are filters, not overnight data: exporting them needs no overnight entitlement, as for the endpoint itself. - On a paginated endpoint
limitis the maximum number of rows in the file (1 to 100,000), not a page size.cursor_idis not accepted: the export follows the pages itself.
The job#
The 202 response is {"data": {...}, "meta": {"request_id"}}. Every timestamp is a Unix millisecond integer (created_timestamp, and last_attempt_timestamp and failed_timestamp once they apply), and query echoes your query with one string per parameter.
status | Meaning |
|---|---|
queued | Accepted and waiting. |
retrying | A transient failure is being retried automatically. |
awaiting_configuration | The service cannot run the job yet. It stays queued until it can. |
failed | error_code and failure_reason say why. |
ready | The job adds bytes, rows, pages, truncated, resolution and download_url. |
The file#
Downloaded file
{
"data": [ ... ],
"meta": { "request_id": "<the export id>", "coverage": { "complete": true } },
"pages": 12,
"truncated": false
}dataholds every row of every page in order (an object for single-object endpoints).metais the endpoint's meta, andrequest_idis the export id.truncatedistruewhen the data was cut at a limit. Thenmeta.coverage.completeisfalseandmeta.coverage.truncatedistrue.- Download results soon after they are ready. Files are not guaranteed to be kept indefinitely.
Limits#
| Scope | Limit |
|---|---|
| Per file | 100,000 rows, 64 MiB, 1,000 pages, about 35 seconds of reading (the file is then finished with truncated: true and a warning: request a narrower window for the rest), and 20 consecutive pages without rows (a filtered scan that finds nothing stops there). |
| Per account | At most 5 exports queued or running. The sixth is 429 export_limit. |
| Rate limit | Creating, polling and downloading each count as one request. The background work itself uses no request capacity. |
Who can read an export#
Exports belong to the account and to the project of the key that created them: a key of another project gets 404. The worker re-checks the key, project, plan and dataset release before it runs, and if the creating key is revoked before the job runs, the job fails.
Endpoint pages: Create export, Export status and Download export.