Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.
/api/v1/export/markets/{id}/trades.{ext}GET
Export trade history for a market as a CSV or TSV file download, newest first. Columns: trade_id, timestamp, price, count, side, volume. price is cents (0-100). Honors the same from/to window as the JSON trades endpoint.
Authorization
bearerAuth *Bearer <token>
Clerk session JWT, or an API key (the ak_ prefix), sent as a Bearer token or an ?api_key= query parameter. Each endpoint requires the read scope for its resource (e.g. org:rates:read for rates). Token in: header
Query Parameters
per_page?integer
Trades per page (1-10000). Combine with page to walk further back.
Default: 100Min: 1Max: 10000
page?integer
1-based page number. Trades are newest first, so page 2 is the next-older block.
Default: 1Min: 1
from?string (date-time)
Lower bound on trade created_time (ISO-8601).
to?string (date-time)
Upper bound on trade created_time (ISO-8601, exclusive).
Response
200 · CSV/TSV file of market trades
CSV/TSV file of market trades
400 · Invalid format (ext must be csv or tsv)
error?string
Stable, machine-readable code identifying the failure; branch on this rather than on message. One of bad_request, unauthorized, forbidden, not_found, conflict, service_unavailable, upstream_error, service_error, or internal_error.
message?string
Human-readable explanation, safe to show to a user. For client errors it names the specific problem; for server-side failures it is a generic notice and the underlying detail is deliberately withheld.
403 · The organization has no paid plan, so the realtime read scopes are refused. Distinct from a 429, which means a plan's budget ran out: nothing here resets on a timer, and the request succeeds only once the organization holds a plan.
error *string
Human-readable reason the request was refused.
status *integer
HTTP status code, repeated in the body.
upgrade_url?string (uri)
Page listing the plans and their request allowances, for buying access. Absent when no plan is available for purchase.
404 · Market not found
error?string
Stable, machine-readable code identifying the failure; branch on this rather than on message. One of bad_request, unauthorized, forbidden, not_found, conflict, service_unavailable, upstream_error, service_error, or internal_error.
message?string
Human-readable explanation, safe to show to a user. For client errors it names the specific problem; for server-side failures it is a generic notice and the underlying detail is deliberately withheld.
429 · The paid organization's minute or UTC-day request budget is exhausted.
error *"rate_limited"
Always rate_limited. Branch on this to detect a throttled request.
limit *"rpm" | "daily"
Which limit was hit: rpm for the per-minute cap or daily for the daily one.
message *string
Human-readable explanation naming the limit that was exceeded.
upgrade_url?string (uri)
Page listing the plans and their request allowances, for buying a larger budget. Absent when no plan is available for purchase.
Request example
curl -X GET "https://api.dev.adjacent.markets/api/v1/export/markets/<id>/trades.csv" \ -H "Authorization: Bearer <token>"
Response example
{ "error": "bad_request", "message": "Invalid format: xml" }