OHLCV (Pool)
Retrieve OHLCV (Open, High, Low, Close, Volume) candles for a specific EVM liquidity pool. This endpoint returns time-bucketed price and volume data for a pool address over a given time range, at a selectable interval.
GET
https://api.cambrian.org/evm/ohlcv/pool
Parameters
chain_id (integer)
EVM chain ID.
pool_address* (string)
after_time* (integer)
before_time* (integer)
interval* (string)
limit (integer)
Limit the number of results.
offset (integer)
Offset the results, allows you to skip a number of rows before starting to return rows.
Responses
Code
Description
200
Successful response
Media type: application/vnd.cambrian.table.v1.0.0+json
[
{
"columns": [
{
"name": "chainId",
"type": "UInt16"
},
{
"name": "openPrice",
"type": "Float64"
},
{
"name": "highPrice",
"type": "Float64"
},
{
"name": "lowPrice",
"type": "Float64"
},
{
"name": "closePrice",
"type": "Float64"
},
{
"name": "volumeQuota",
"type": "Float64"
},
{
"name": "volumeBase",
"type": "Float64"
},
{
"name": "unixTime",
"type": "UInt32"
},
{
"name": "interval",
"type": "String"
},
{
"name": "poolAddress",
"type": "String"
},
{
"name": "baseTokenAddress",
"type": "String"
},
{
"name": "quotaTokenAddress",
"type": "String"
}
],
"data": [
[
8453,
3332.536307156436,
3356.864493690894,
3330.896735816566,
3356.8608777632935,
1990766.878916,
594.8392645526991,
1735689600,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
],
[
8453,
3357.473179573992,
3357.550091962905,
3337.424110414588,
3339.533467710805,
1650981.709878,
493.1693402178727,
1735693200,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
],
[
8453,
3339.532826202043,
3358.867492406441,
3339.4744581150603,
3355.714290742269,
1729515.701951,
516.454785930015,
1735696800,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
],
[
8453,
3355.698774075467,
3356.4771778671166,
3344.4549618092274,
3348.7211366619586,
2033678.502485,
607.0407670672997,
1735700400,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
],
[
8453,
3348.7086453582774,
3348.8793100892594,
3333.841960763265,
3333.841960763265,
1090907.217021,
326.4831221781552,
1735704000,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
],
[
8453,
3333.8417831716524,
3343.156180262368,
3333.0711466711878,
3339.3912642645228,
976972.975829,
292.6259215289187,
1735707600,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
],
[
8453,
3339.389353592374,
3339.389353592374,
3331.5613890295062,
3337.7457930659093,
1424881.582232,
427.17181905093065,
1735711200,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
],
[
8453,
3337.7455069970047,
3340.6082467582855,
3330.770804077128,
3339.6617026522213,
1156837.837102,
346.71666073041666,
1735714800,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
],
[
8453,
3339.656046036028,
3340.209078332358,
3326.2648529284925,
3330.5264635863623,
1023690.345486,
307.1070182405019,
1735718400,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
],
[
8453,
3330.5263615101203,
3333.0880224646694,
3310.1199057205945,
3326.7988331217657,
1705807.010866,
513.9519201841006,
1735722000,
"1h",
"0xd0b53d9277642d899df5c87a3966a349a798f224",
"0x4200000000000000000000000000000000000006",
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
]
],
"rows": 10
}
]
400
Bad Request: Invalid request parameters or malformed request.
401
Unauthorized: Missing or invalid API key. Include X-API-Key header with your request.
403
Forbidden: Invalid API key or insufficient permissions to access this resource.
404
Not Found: Endpoint or resource does not exist.
408
Request Timeout: Request took too long to process. Try again.
500
Internal Server Error: An unexpected error occurred while processing your request.
503
Service Unavailable: The server is temporarily unable to handle the request. Please try again later.
Examples
1. Hourly OHLCV for a Base Pool
Retrieve hourly candles for a specific Base-chain pool over a one-day window.
curl
curl -X GET "https://api.cambrian.org/evm/ohlcv/pool?pool_address=0xd0b53d9277642d899df5c87a3966a349a798f224&after_time=1735689600&before_time=1735776000&interval=1h&limit=10" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
JSON
1[
2 {
3 "columns": [
4 {
5 "name": "chainId",
6 "type": "UInt16"
7 },
8 {
9 "name": "openPrice",
10 "type": "Float64"
11 },
12 {
13 "name": "highPrice",
14 "type": "Float64"
15 },
16 {
17 "name": "lowPrice",
18 "type": "Float64"
19 },
20 {
21 "name": "closePrice",
22 "type": "Float64"
23 },
24 {
25 "name": "volumeQuota",
26 "type": "Float64"
27 },
28 {
29 "name": "volumeBase",
30 "type": "Float64"
31 },
32 {
33 "name": "unixTime",
34 "type": "UInt32"
35 },
36 {
37 "name": "interval",
38 "type": "String"
39 },
40 {
41 "name": "poolAddress",
42 "type": "String"
43 },
44 {
45 "name": "baseTokenAddress",
46 "type": "String"
47 },
48 {
49 "name": "quotaTokenAddress",
50 "type": "String"
51 }
52 ],
53 "data": [
54 [
55 8453,
56 3332.536307156436,
57 3356.864493690894,
58 3330.896735816566,
59 3356.8608777632935,
60 1990766.878916,
61 594.8392645526991,
62 1735689600,
63 "1h",
64 "0xd0b53d9277642d899df5c87a3966a349a798f224",
65 "0x4200000000000000000000000000000000000006",
66 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
67 ],
68 [
69 8453,
70 3357.473179573992,
71 3357.550091962905,
72 3337.424110414588,
73 3339.533467710805,
74 1650981.709878,
75 493.1693402178727,
76 1735693200,
77 "1h",
78 "0xd0b53d9277642d899df5c87a3966a349a798f224",
79 "0x4200000000000000000000000000000000000006",
80 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
81 ],
82 [
83 8453,
84 3339.532826202043,
85 3358.867492406441,
86 3339.4744581150603,
87 3355.714290742269,
88 1729515.701951,
89 516.454785930015,
90 1735696800,
91 "1h",
92 "0xd0b53d9277642d899df5c87a3966a349a798f224",
93 "0x4200000000000000000000000000000000000006",
94 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
95 ],
96 [
97 8453,
98 3355.698774075467,
99 3356.4771778671166,
100 3344.4549618092274,
101 3348.7211366619586,
102 2033678.502485,
103 607.0407670672997,
104 1735700400,
105 "1h",
106 "0xd0b53d9277642d899df5c87a3966a349a798f224",
107 "0x4200000000000000000000000000000000000006",
108 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
109 ],
110 [
111 8453,
112 3348.7086453582774,
113 3348.8793100892594,
114 3333.841960763265,
115 3333.841960763265,
116 1090907.217021,
117 326.4831221781552,
118 1735704000,
119 "1h",
120 "0xd0b53d9277642d899df5c87a3966a349a798f224",
121 "0x4200000000000000000000000000000000000006",
122 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
123 ],
124 [
125 8453,
126 3333.8417831716524,
127 3343.156180262368,
128 3333.0711466711878,
129 3339.3912642645228,
130 976972.975829,
131 292.6259215289187,
132 1735707600,
133 "1h",
134 "0xd0b53d9277642d899df5c87a3966a349a798f224",
135 "0x4200000000000000000000000000000000000006",
136 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
137 ],
138 [
139 8453,
140 3339.389353592374,
141 3339.389353592374,
142 3331.5613890295062,
143 3337.7457930659093,
144 1424881.582232,
145 427.17181905093065,
146 1735711200,
147 "1h",
148 "0xd0b53d9277642d899df5c87a3966a349a798f224",
149 "0x4200000000000000000000000000000000000006",
150 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
151 ],
152 [
153 8453,
154 3337.7455069970047,
155 3340.6082467582855,
156 3330.770804077128,
157 3339.6617026522213,
158 1156837.837102,
159 346.71666073041666,
160 1735714800,
161 "1h",
162 "0xd0b53d9277642d899df5c87a3966a349a798f224",
163 "0x4200000000000000000000000000000000000006",
164 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
165 ],
166 [
167 8453,
168 3339.656046036028,
169 3340.209078332358,
170 3326.2648529284925,
171 3330.5264635863623,
172 1023690.345486,
173 307.1070182405019,
174 1735718400,
175 "1h",
176 "0xd0b53d9277642d899df5c87a3966a349a798f224",
177 "0x4200000000000000000000000000000000000006",
178 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
179 ],
180 [
181 8453,
182 3330.5263615101203,
183 3333.0880224646694,
184 3310.1199057205945,
185 3326.7988331217657,
186 1705807.010866,
187 513.9519201841006,
188 1735722000,
189 "1h",
190 "0xd0b53d9277642d899df5c87a3966a349a798f224",
191 "0x4200000000000000000000000000000000000006",
192 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
193 ]
194 ],
195 "rows": 10
196 }
197]
2 {
3 "columns": [
4 {
5 "name": "chainId",
6 "type": "UInt16"
7 },
8 {
9 "name": "openPrice",
10 "type": "Float64"
11 },
12 {
13 "name": "highPrice",
14 "type": "Float64"
15 },
16 {
17 "name": "lowPrice",
18 "type": "Float64"
19 },
20 {
21 "name": "closePrice",
22 "type": "Float64"
23 },
24 {
25 "name": "volumeQuota",
26 "type": "Float64"
27 },
28 {
29 "name": "volumeBase",
30 "type": "Float64"
31 },
32 {
33 "name": "unixTime",
34 "type": "UInt32"
35 },
36 {
37 "name": "interval",
38 "type": "String"
39 },
40 {
41 "name": "poolAddress",
42 "type": "String"
43 },
44 {
45 "name": "baseTokenAddress",
46 "type": "String"
47 },
48 {
49 "name": "quotaTokenAddress",
50 "type": "String"
51 }
52 ],
53 "data": [
54 [
55 8453,
56 3332.536307156436,
57 3356.864493690894,
58 3330.896735816566,
59 3356.8608777632935,
60 1990766.878916,
61 594.8392645526991,
62 1735689600,
63 "1h",
64 "0xd0b53d9277642d899df5c87a3966a349a798f224",
65 "0x4200000000000000000000000000000000000006",
66 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
67 ],
68 [
69 8453,
70 3357.473179573992,
71 3357.550091962905,
72 3337.424110414588,
73 3339.533467710805,
74 1650981.709878,
75 493.1693402178727,
76 1735693200,
77 "1h",
78 "0xd0b53d9277642d899df5c87a3966a349a798f224",
79 "0x4200000000000000000000000000000000000006",
80 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
81 ],
82 [
83 8453,
84 3339.532826202043,
85 3358.867492406441,
86 3339.4744581150603,
87 3355.714290742269,
88 1729515.701951,
89 516.454785930015,
90 1735696800,
91 "1h",
92 "0xd0b53d9277642d899df5c87a3966a349a798f224",
93 "0x4200000000000000000000000000000000000006",
94 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
95 ],
96 [
97 8453,
98 3355.698774075467,
99 3356.4771778671166,
100 3344.4549618092274,
101 3348.7211366619586,
102 2033678.502485,
103 607.0407670672997,
104 1735700400,
105 "1h",
106 "0xd0b53d9277642d899df5c87a3966a349a798f224",
107 "0x4200000000000000000000000000000000000006",
108 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
109 ],
110 [
111 8453,
112 3348.7086453582774,
113 3348.8793100892594,
114 3333.841960763265,
115 3333.841960763265,
116 1090907.217021,
117 326.4831221781552,
118 1735704000,
119 "1h",
120 "0xd0b53d9277642d899df5c87a3966a349a798f224",
121 "0x4200000000000000000000000000000000000006",
122 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
123 ],
124 [
125 8453,
126 3333.8417831716524,
127 3343.156180262368,
128 3333.0711466711878,
129 3339.3912642645228,
130 976972.975829,
131 292.6259215289187,
132 1735707600,
133 "1h",
134 "0xd0b53d9277642d899df5c87a3966a349a798f224",
135 "0x4200000000000000000000000000000000000006",
136 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
137 ],
138 [
139 8453,
140 3339.389353592374,
141 3339.389353592374,
142 3331.5613890295062,
143 3337.7457930659093,
144 1424881.582232,
145 427.17181905093065,
146 1735711200,
147 "1h",
148 "0xd0b53d9277642d899df5c87a3966a349a798f224",
149 "0x4200000000000000000000000000000000000006",
150 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
151 ],
152 [
153 8453,
154 3337.7455069970047,
155 3340.6082467582855,
156 3330.770804077128,
157 3339.6617026522213,
158 1156837.837102,
159 346.71666073041666,
160 1735714800,
161 "1h",
162 "0xd0b53d9277642d899df5c87a3966a349a798f224",
163 "0x4200000000000000000000000000000000000006",
164 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
165 ],
166 [
167 8453,
168 3339.656046036028,
169 3340.209078332358,
170 3326.2648529284925,
171 3330.5264635863623,
172 1023690.345486,
173 307.1070182405019,
174 1735718400,
175 "1h",
176 "0xd0b53d9277642d899df5c87a3966a349a798f224",
177 "0x4200000000000000000000000000000000000006",
178 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
179 ],
180 [
181 8453,
182 3330.5263615101203,
183 3333.0880224646694,
184 3310.1199057205945,
185 3326.7988331217657,
186 1705807.010866,
187 513.9519201841006,
188 1735722000,
189 "1h",
190 "0xd0b53d9277642d899df5c87a3966a349a798f224",
191 "0x4200000000000000000000000000000000000006",
192 "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
193 ]
194 ],
195 "rows": 10
196 }
197]
x402 Payment Option
This endpoint supports pay-per-use access via the x402 payment protocol (v2): pay $0.05 USDC per request using blockchain micropayments. No API key required.
Quickstart (Typescript)
bash
npm install @x402/fetch @x402/evm viem
TypeScript
1import { x402Client } from "@x402/core/client";
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/evm/ohlcv/pool"
11);
12const data = await response.json();
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/evm/ohlcv/pool"
11);
12const data = await response.json();
Quickstart (Python)
bash
pip install "x402[httpx]"
Python
1import asyncio, os
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/evm/ohlcv/pool")
13 print(response.json())
14asyncio.run(main())
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/evm/ohlcv/pool")
13 print(response.json())
14asyncio.run(main())
Payment Flow
- Send a normal request to the endpoint (no API key needed)
- Server returns 402 Payment Required with payment details
- The x402 SDK automatically signs a payment authorization with your wallet
- The SDK resubmits the request with the signed payment
- Server verifies payment and returns the API response
The x402 SDK handles steps 2 through 5 automatically.
Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request