Endpoints
The VQ Codes API provides three endpoints for accessing compressed market state data.
All endpoints return JSON and require authentication via the X-Api-Key header.
Base URL:
https://api.vqcodes.com
GET
/api/v1/codes/latest
Returns the most recent N code windows for a given pair. Available on all tiers.
Parameters
| Param | Type | Description |
|---|---|---|
| pair | string | Trading pair, e.g. BTCUSD |
| limit | integer | Number of windows to return (default: 100, max: 1000) |
Example
GET /api/v1/codes/latest?pair=BTCUSD&limit=100
GET
/api/v1/codes
Returns code windows within a time range. Pro and Enterprise tiers only.
Parameters
| Param | Type | Description |
|---|---|---|
| pair | string | Trading pair, e.g. BTCUSD |
| from | integer | Start timestamp in milliseconds (inclusive) |
| to | integer | End timestamp in milliseconds (exclusive) |
Example
GET /api/v1/codes?pair=BTCUSD&from=1679000000000&to=1679100000000
GET
/api/v1/codes/meta
Returns metadata about available code data for a pair: time range, window count, and model info.
Parameters
| Param | Type | Description |
|---|---|---|
| pair | string | Trading pair, e.g. BTCUSD |
Example
GET /api/v1/codes/meta?pair=BTCUSD
Response format
All data endpoints return JSON with a consistent structure:
{
"pair": "BTCUSD",
"exchange": "bitstamp",
"data": [
{"t": 1679000060000, "codes": [42, 87, 13, 55, 3, 99, 7, 61]},
{"t": 1679000120000, "codes": [55, 23, 91, 44, 12, 87, 33, 7]}
],
"count": 2
}
Fields
| Field | Type | Description |
|---|---|---|
| pair | string | The requested trading pair |
| exchange | string | Source exchange for the data |
| data | array | Array of code windows, each with t (timestamp ms) and codes (8 integers, 0-1023) |
| count | integer | Number of windows returned |