Skip to content
Aggre Docs

Loading…

Console

API reference

Market data

Candles, funding rates, open interest, instruments and the latest tickers.

Crypto market data by venue. Concepts and caveats are in the market data guide. Instruments are identified as {VENUE}:{PRODUCT}:{native}, for example OKX:SPOT:SOL-USDC.

On this page:

Confirmed one-minute candles of one instrument#

GET /v1/finance/market/candles_1m

Only confirmed bars. ts is the bar open (Unix ms UTC). No cursor paging yet: next_cursor is always null; read further with from/to. Dataset finance.market.candles_1m; semantics in the dataset guide.

Parameters

NameInRequiredTypeDescription
instrument_idqueryyesstring{VENUE}:{PRODUCT}:{native}, e.g. OKX:SPOT:SOL-USDC. Funding and open interest need a PERP or FUTURES id.
fromquerynointeger, int64Unix ms, inclusive (on ts).
toquerynointeger, int64Unix ms, exclusive (on ts). Must be later than from.
limitquerynointeger, 1–1000, default 100Rows per page.
orderquerynoasc | desc (default desc)Sort direction (default newest first).

Example

bash
curl -s "https://api.aggre.org/v1/finance/market/candles_1m?instrument_id=OKX:SPOT:SOL-USDC&limit=3" \
  -H "Authorization: Bearer $AGGRE_API_KEY"

Response 200: the envelope { "data": [...], "meta": {...}, "next_cursor": ... } (see Response format); each row of data follows the schema candles.

Errors: 400, 401, 403, 429, 503, in the shared envelope (Errors).

Confirmed one-hour candles of one instrument#

GET /v1/finance/market/candles_1h

Only confirmed bars. ts is the bar open (Unix ms UTC). No cursor paging yet: next_cursor is always null; read further with from/to. Dataset finance.market.candles_1h; semantics in the dataset guide.

Parameters

NameInRequiredTypeDescription
instrument_idqueryyesstring{VENUE}:{PRODUCT}:{native}, e.g. OKX:SPOT:SOL-USDC. Funding and open interest need a PERP or FUTURES id.
fromquerynointeger, int64Unix ms, inclusive (on ts).
toquerynointeger, int64Unix ms, exclusive (on ts). Must be later than from.
limitquerynointeger, 1–1000, default 100Rows per page.
orderquerynoasc | desc (default desc)Sort direction (default newest first).

Example

bash
curl -s "https://api.aggre.org/v1/finance/market/candles_1h?instrument_id=OKX:SPOT:SOL-USDC&limit=3" \
  -H "Authorization: Bearer $AGGRE_API_KEY"

Response 200: the envelope { "data": [...], "meta": {...}, "next_cursor": ... } (see Response format); each row of data follows the schema candles.

Errors: 400, 401, 403, 429, 503, in the shared envelope (Errors).

Confirmed one-day candles of one instrument#

GET /v1/finance/market/candles_1d

Only confirmed bars. ts is the bar open (Unix ms UTC). No cursor paging yet: next_cursor is always null; read further with from/to. Dataset finance.market.candles_1d; semantics in the dataset guide.

Parameters

NameInRequiredTypeDescription
instrument_idqueryyesstring{VENUE}:{PRODUCT}:{native}, e.g. OKX:SPOT:SOL-USDC. Funding and open interest need a PERP or FUTURES id.
fromquerynointeger, int64Unix ms, inclusive (on ts).
toquerynointeger, int64Unix ms, exclusive (on ts). Must be later than from.
limitquerynointeger, 1–1000, default 100Rows per page.
orderquerynoasc | desc (default desc)Sort direction (default newest first).

Example

bash
curl -s "https://api.aggre.org/v1/finance/market/candles_1d?instrument_id=OKX:SPOT:SOL-USDC&limit=3" \
  -H "Authorization: Bearer $AGGRE_API_KEY"

Response 200: the envelope { "data": [...], "meta": {...}, "next_cursor": ... } (see Response format); each row of data follows the schema candles.

Errors: 400, 401, 403, 429, 503, in the shared envelope (Errors).

Settled funding payments of a perpetual#

GET /v1/finance/market/funding_rates

instrument_id must be a PERP or FUTURES id. rate is that period's fraction as the venue reports it, not annualised. next_cursor is always null. Stale after 24 h. Dataset finance.market.funding_rates.

Parameters

NameInRequiredTypeDescription
instrument_idqueryyesstring{VENUE}:{PRODUCT}:{native}, e.g. OKX:SPOT:SOL-USDC. Funding and open interest need a PERP or FUTURES id.
fromquerynointeger, int64Unix ms, inclusive (on ts).
toquerynointeger, int64Unix ms, exclusive (on ts). Must be later than from.
limitquerynointeger, 1–1000, default 100Rows per page.
orderquerynoasc | desc (default desc)Sort direction (default newest first).

Example

bash
curl -s "https://api.aggre.org/v1/finance/market/funding_rates?instrument_id=OKX:SPOT:SOL-USDC&limit=3" \
  -H "Authorization: Bearer $AGGRE_API_KEY"

Response 200: the envelope { "data": [...], "meta": {...}, "next_cursor": ... } (see Response format); each row of data follows the schema funding_rates.

Errors: 400, 401, 403, 429, 503, in the shared envelope (Errors).

Open-interest snapshots of a perpetual#

GET /v1/finance/market/open_interest

instrument_id must be a PERP or FUTURES id. A snapshot in base-asset units; history starts the day collection starts. next_cursor is always null. Stale after 30 min. Dataset finance.market.open_interest.

Parameters

NameInRequiredTypeDescription
instrument_idqueryyesstring{VENUE}:{PRODUCT}:{native}, e.g. OKX:SPOT:SOL-USDC. Funding and open interest need a PERP or FUTURES id.
fromquerynointeger, int64Unix ms, inclusive (on ts).
toquerynointeger, int64Unix ms, exclusive (on ts). Must be later than from.
limitquerynointeger, 1–1000, default 100Rows per page.
orderquerynoasc | desc (default desc)Sort direction (default newest first).

Example

bash
curl -s "https://api.aggre.org/v1/finance/market/open_interest?instrument_id=OKX:SPOT:SOL-USDC&limit=3" \
  -H "Authorization: Bearer $AGGRE_API_KEY"

Response 200: the envelope { "data": [...], "meta": {...}, "next_cursor": ... } (see Response format); each row of data follows the schema open_interest.

Errors: 400, 401, 403, 429, 503, in the shared envelope (Errors).

The instrument list#

GET /v1/finance/market/instruments

Dataset finance.market.instruments (Postgres). No cursor. 503 store_unavailable when finance_db is not configured.

Parameters

NameInRequiredTypeDescription
venuequerynostring, pattern ^[A-Z0-9]+$Exact venue code: uppercase letters and digits (OKX, BITGET, HYPERLIQUID ...).
productquerynoSPOT | PERP | FUTURES

Example

bash
curl -s "https://api.aggre.org/v1/finance/market/instruments" \
  -H "Authorization: Bearer $AGGRE_API_KEY"

Response 200: the envelope { "data": [...], "meta": {...}, "next_cursor": ... } (see Response format); each row of data follows the schema instruments.

Errors: 400, 401, 403, 429, 503, in the shared envelope (Errors).

The latest ticker of every enabled instrument#

GET /v1/finance/market/tickers

One row per enabled instrument, latest only: no history, no cursor. The 24 h figures are the venue's rolling 24 hours and null where the venue does not send them. Dataset finance.market.tickers_latest.

Parameters

NameInRequiredTypeDescription
venuequerynostring, pattern ^[A-Z0-9]+$Exact venue code: uppercase letters and digits (OKX, BITGET, HYPERLIQUID ...).
productquerynoSPOT | PERP | FUTURES
instrument_idquerynostringExact; must agree with venue/product when they are given.

Example

bash
curl -s "https://api.aggre.org/v1/finance/market/tickers" \
  -H "Authorization: Bearer $AGGRE_API_KEY"

Response 200: the envelope { "data": [...], "meta": {...}, "next_cursor": ... } (see Response format); each row of data follows the schema tickers_latest.

Errors: 400, 401, 403, 429, 503, in the shared envelope (Errors).

Generated from contracts/data.openapi.yaml when the site is built, so it matches the API contract.