Backtesting

Get Snapshots

Query historical JSON snapshots for a data type.

Streamed row-by-row so peak memory stays ~one row regardless of limit. A limit=1000 pull of fat types (coinglass_oi / coinglass_funding / stablecoins) otherwise decompressed ~300MB and ballooned ~1GB through serialization, OOM-looping the 2.5GiB container. The JSON response shape is unchanged, so consumers need no changes. Streaming also means bytes start flowing immediately — no more 60s nginx 504 on large pulls. No heavy-read semaphore needed here: memory is now bounded by the stream itself, and the request rate is bounded by nginx/Cloudflare on the /backtesting route.

get/api/v1/backtesting/snapshots

Request

  • Base URL: https://cryptodataapi.com
  • URL: https://cryptodataapi.com/api/v1/backtesting/snapshots
  • Auth: API key in header X-API-Key

Query parameters

data_typestring required

Snapshot type, e.g. market_health, fear_greed, coinglass_etf_flows

startstring required

Start time (ISO 8601 or unix ms)

endstring

End time (ISO 8601 or unix ms, defaults to now). EXCLUSIVE — the range is [start, end), so consecutive windows do not repeat a boundary row.

boundsstring

Interval convention for start/end. half-open (default) is [start, end) — end is EXCLUSIVE, so consecutive windows tile without repeating a boundary row. closed is [start, end] — end INCLUSIVE, the pre-2026-08-08 behaviour; use it only to keep an existing integration byte-identical.

limitinteger
universestring nullable

For dex_trending: filter to hl_perps

Response

Successful Response

data_typestring required
countinteger required

Changes

No recorded changes to this operation across all 1 revision of this API.