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

GET
/v1/defi/market/market-data/scans/history

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.

Query Parameters

source*string

Which ranking to take.

Value in"trending_ratio""volume""surging_1h""surging_4h""surging_24h"
sort?string

Which 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.

Default"desc"
Value in"desc""asc"
window?string

Lookback period (e.g. 1h, 4h, 1d, 7d, 1M).

Default"1h"
resolution?string

Bucket size (e.g. 5m, 1h, 1d). Must be at least 1h for windows over 1d.

Default"5s"
per_bucket?integer

How many assets each bucket carries, capped at 200.

Default50

Response Body

The ranking at each bucket of the window

application/json
  1. response
source?string

The ranking that was taken

sort?string

Which end of the ranking each bucket kept

window?string

The time window used for the query

resolution?string

The time resolution used for the query

per_bucket?integer

The most assets any bucket carries

buckets?array<>

One ranking per bucket, oldest first

Example Request
curl -X GET 'https://api.truemarkets.co/v1/defi/market/market-data/scans/history?source=trending_ratio'
Example Response
{  "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"        }      ]    }  ]}