Appearance
CEX Market History
GET /api/v1/market/:id/history
Historical OHLCV data for a token from centralized exchange sources.
Cost: $0.01 USDC
Path Parameters
| Param | Type | Description |
|---|---|---|
| id | string | CoinGecko token ID (e.g. bitcoin, ethereum) |
Query Parameters
| Param | Type | Default | Description |
|---|---|---|---|
| days | int | 7 | Number of days of history (1, 7, 14, 30, 90, 365) |
Request Example
bash
curl -H "x-payment: <proof>" \
"https://api.foursec.xyz/api/v1/market/bitcoin/history?days=7"Response
json
{
"success": true,
"data": {
"id": "bitcoin",
"symbol": "btc",
"days": 7,
"prices": [
[1720300800000, 57200.50],
[1720387200000, 57800.32]
],
"market_caps": [
[1720300800000, 1128000000000],
[1720387200000, 1140000000000]
],
"total_volumes": [
[1720300800000, 24500000000],
[1720387200000, 28500000000]
]
},
"meta": {
"cached": false,
"timestamp": "2026-07-08T14:30:00Z"
}
}Data format: [unix_timestamp_ms, value] pairs.
Data Source
CoinGecko market chart API (primary), CCXT OHLCV fallback. Cache TTL: 5 minutes.
Related Endpoints
- Market Details — current market data
- DEX Price History — on-chain OHLCV from DEXes