For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/market-data/get-scan-history.md.
Get a market ranking at every bucket of a window
Returns the ranking a scanner or a universe rotation is built on, taken at every bucket across a lookback window rather than only at now.
Every span a ranking measures is read backwards from its own bucket, so
no bucket reflects a figure the market had not reported yet. Ranking a
month of hourly buckets over the whole tracked universe would be
hundreds of thousands of rows, so each bucket carries only its top
per_bucket assets, ordered best first on the requested source.
Assets without a symbol or without a spot price source are dropped, the
same way the live feeds drop them.
value is the figure the source ranks on: a trending ratio, a recent
volume in USD, or a signed price change percentage. Ranking is on that
signed figure, so sort=desc on a surging_* source is the gainers and
sort=asc is the fallers.
See the Time Window & Resolution
section for the format of window and resolution.
source*stringWhich ranking to take.
"trending_ratio""volume""surging_1h""surging_4h""surging_24h"sort?stringWhich end of the ranking each bucket keeps. Buckets are capped before they are served, so this must match the sort the caller will rank by: a "biggest dippers" scanner asking for desc would be handed the gainers it was never going to buy.
"desc""desc""asc"window?stringLookback period (e.g. 1h, 4h, 1d, 7d, 1M).
"1h"resolution?stringBucket size (e.g. 5m, 1h, 1d). Must be at least 1h for windows over 1d.
"5s"per_bucket?integerHow many assets each bucket carries, capped at 200.
50The ranking at each bucket of the window
application/json- response
source?stringThe ranking that was taken
sort?stringWhich end of the ranking each bucket kept
window?stringThe time window used for the query
resolution?stringThe time resolution used for the query
per_bucket?integerThe most assets any bucket carries
buckets?array<>One ranking per bucket, oldest first
curl -X GET 'https://api.truemarkets.co/v1/defi/market/market-data/scans/history?source=trending_ratio'{ "source": "string", "sort": "string", "window": "string", "resolution": "string", "per_bucket": 0, "buckets": [ { "t": "2019-08-24T14:15:22Z", "assets": [ { "asset_id": "b4695157-0d1d-4da0-8f9e-5c53149389e4", "symbol": "string", "value": "string" } ] } ]}