OHLCV (Pool)
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific Solana pool contract to support pair-specific price analysis and liquidity venue performance tracking. This endpoint returns time-bucketed price and volume data for a single pool over a specified time range and interval.
GET
https://api.cambrian.org/solana/ohlcv/pool
Parameters
pool_address* (string)
Pool/pair contract address (base58 format)
after_time* (integer)
Unix timestamp - start time for data range
before_time* (integer)
Unix timestamp - end time for data range
interval* (string)
Time interval for OHLCV data aggregation
Responses
Code
Description
200
Successful response
Media type: application/vnd.cambrian.table.v1.0.0+json
[
{
"columns": [
{
"name": "openPrice",
"type": "Nullable(Float64)"
},
{
"name": "highPrice",
"type": "Float64"
},
{
"name": "lowPrice",
"type": "Float64"
},
{
"name": "closePrice",
"type": "Nullable(Float64)"
},
{
"name": "volumeQuote",
"type": "Float64"
},
{
"name": "volumeBase",
"type": "Float64"
},
{
"name": "unixTime",
"type": "Nullable(Int64)"
},
{
"name": "interval",
"type": "String"
},
{
"name": "poolAddress",
"type": "String"
},
{
"name": "baseTokenAddress",
"type": "Nullable(String)"
},
{
"name": "quoteTokenAddress",
"type": "Nullable(String)"
}
],
"data": [
[
188.91000369631612,
192.27155639417393,
188.75311778120638,
192.03411242234174,
406283.84986,
2129.8661412570023,
1735689600,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
192.03412720298522,
192.1959156621166,
189.9735973570173,
190.18832858249917,
451140.73497299966,
2362.969263186,
1735693200,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
190.18832802245518,
191.5766668691956,
190.04950427631093,
191.1935695373037,
879581.7627479993,
4612.637865910996,
1735696800,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
191.04063318392232,
191.0406341282193,
189.61195276700667,
190.12644541964147,
604837.0177970004,
3176.215211069999,
1735700400,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
189.9739863001899,
189.97400341153914,
188.98306775870205,
189.0641139332444,
644987.2130740001,
3404.7818689140017,
1735704000,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
188.98834548025786,
190.126997275962,
188.98834548025786,
189.7479113043496,
779107.6320560005,
4106.191289562003,
1735707600,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
189.59440160023175,
189.9043887377066,
188.98853949074328,
189.84927258573907,
888871.904823,
4691.795723701002,
1735711200,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
189.89839027144353,
189.97447643932955,
189.28804959162153,
189.5945163320466,
544177.454244,
2870.2106599879985,
1735714800,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
189.5945169093682,
190.27919913160966,
188.90660183483112,
188.98887404540355,
1024084.2185279999,
5403.363581164996,
1735718400,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
],
[
189.1401892478719,
189.36765803490573,
187.6222526066206,
188.90947709868874,
845770.9815419995,
4489.710143661002,
1735722000,
"1h",
"5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
]
],
"rows": 24
}
]
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. Retrieve hourly OHLCV data for a Solana pool
This example fetches hourly OHLCV data for a specific pool over a one-day window, useful for short-term price and volume analysis of a single liquidity venue.
curl
curl -X GET "https://api.cambrian.org/solana/ohlcv/pool?pool_address=5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6&after_time=1735689600&before_time=1735776000&interval=1h" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
JSON
1[
2 {
3 "columns": [
4 {
5 "name": "openPrice",
6 "type": "Nullable(Float64)"
7 },
8 {
9 "name": "highPrice",
10 "type": "Float64"
11 },
12 {
13 "name": "lowPrice",
14 "type": "Float64"
15 },
16 {
17 "name": "closePrice",
18 "type": "Nullable(Float64)"
19 },
20 {
21 "name": "volumeQuote",
22 "type": "Float64"
23 },
24 {
25 "name": "volumeBase",
26 "type": "Float64"
27 },
28 {
29 "name": "unixTime",
30 "type": "Nullable(Int64)"
31 },
32 {
33 "name": "interval",
34 "type": "String"
35 },
36 {
37 "name": "poolAddress",
38 "type": "String"
39 },
40 {
41 "name": "baseTokenAddress",
42 "type": "Nullable(String)"
43 },
44 {
45 "name": "quoteTokenAddress",
46 "type": "Nullable(String)"
47 }
48 ],
49 "data": [
50 [
51 188.91000369631612,
52 192.27155639417393,
53 188.75311778120638,
54 192.03411242234174,
55 406283.84986,
56 2129.8661412570023,
57 1735689600,
58 "1h",
59 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
60 "So11111111111111111111111111111111111111112",
61 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
62 ],
63 [
64 192.03412720298522,
65 192.1959156621166,
66 189.9735973570173,
67 190.18832858249917,
68 451140.73497299966,
69 2362.969263186,
70 1735693200,
71 "1h",
72 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
73 "So11111111111111111111111111111111111111112",
74 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
75 ],
76 [
77 190.18832802245518,
78 191.5766668691956,
79 190.04950427631093,
80 191.1935695373037,
81 879581.7627479993,
82 4612.637865910996,
83 1735696800,
84 "1h",
85 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
86 "So11111111111111111111111111111111111111112",
87 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
88 ],
89 [
90 191.04063318392232,
91 191.0406341282193,
92 189.61195276700667,
93 190.12644541964147,
94 604837.0177970004,
95 3176.215211069999,
96 1735700400,
97 "1h",
98 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
99 "So11111111111111111111111111111111111111112",
100 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
101 ],
102 [
103 189.9739863001899,
104 189.97400341153914,
105 188.98306775870205,
106 189.0641139332444,
107 644987.2130740001,
108 3404.7818689140017,
109 1735704000,
110 "1h",
111 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
112 "So11111111111111111111111111111111111111112",
113 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
114 ],
115 [
116 188.98834548025786,
117 190.126997275962,
118 188.98834548025786,
119 189.7479113043496,
120 779107.6320560005,
121 4106.191289562003,
122 1735707600,
123 "1h",
124 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
125 "So11111111111111111111111111111111111111112",
126 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
127 ],
128 [
129 189.59440160023175,
130 189.9043887377066,
131 188.98853949074328,
132 189.84927258573907,
133 888871.904823,
134 4691.795723701002,
135 1735711200,
136 "1h",
137 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
138 "So11111111111111111111111111111111111111112",
139 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
140 ],
141 [
142 189.89839027144353,
143 189.97447643932955,
144 189.28804959162153,
145 189.5945163320466,
146 544177.454244,
147 2870.2106599879985,
148 1735714800,
149 "1h",
150 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
151 "So11111111111111111111111111111111111111112",
152 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
153 ],
154 [
155 189.5945169093682,
156 190.27919913160966,
157 188.90660183483112,
158 188.98887404540355,
159 1024084.2185279999,
160 5403.363581164996,
161 1735718400,
162 "1h",
163 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
164 "So11111111111111111111111111111111111111112",
165 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
166 ],
167 [
168 189.1401892478719,
169 189.36765803490573,
170 187.6222526066206,
171 188.90947709868874,
172 845770.9815419995,
173 4489.710143661002,
174 1735722000,
175 "1h",
176 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
177 "So11111111111111111111111111111111111111112",
178 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
179 ]
180 ],
181 "rows": 24
182 }
183]
2 {
3 "columns": [
4 {
5 "name": "openPrice",
6 "type": "Nullable(Float64)"
7 },
8 {
9 "name": "highPrice",
10 "type": "Float64"
11 },
12 {
13 "name": "lowPrice",
14 "type": "Float64"
15 },
16 {
17 "name": "closePrice",
18 "type": "Nullable(Float64)"
19 },
20 {
21 "name": "volumeQuote",
22 "type": "Float64"
23 },
24 {
25 "name": "volumeBase",
26 "type": "Float64"
27 },
28 {
29 "name": "unixTime",
30 "type": "Nullable(Int64)"
31 },
32 {
33 "name": "interval",
34 "type": "String"
35 },
36 {
37 "name": "poolAddress",
38 "type": "String"
39 },
40 {
41 "name": "baseTokenAddress",
42 "type": "Nullable(String)"
43 },
44 {
45 "name": "quoteTokenAddress",
46 "type": "Nullable(String)"
47 }
48 ],
49 "data": [
50 [
51 188.91000369631612,
52 192.27155639417393,
53 188.75311778120638,
54 192.03411242234174,
55 406283.84986,
56 2129.8661412570023,
57 1735689600,
58 "1h",
59 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
60 "So11111111111111111111111111111111111111112",
61 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
62 ],
63 [
64 192.03412720298522,
65 192.1959156621166,
66 189.9735973570173,
67 190.18832858249917,
68 451140.73497299966,
69 2362.969263186,
70 1735693200,
71 "1h",
72 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
73 "So11111111111111111111111111111111111111112",
74 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
75 ],
76 [
77 190.18832802245518,
78 191.5766668691956,
79 190.04950427631093,
80 191.1935695373037,
81 879581.7627479993,
82 4612.637865910996,
83 1735696800,
84 "1h",
85 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
86 "So11111111111111111111111111111111111111112",
87 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
88 ],
89 [
90 191.04063318392232,
91 191.0406341282193,
92 189.61195276700667,
93 190.12644541964147,
94 604837.0177970004,
95 3176.215211069999,
96 1735700400,
97 "1h",
98 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
99 "So11111111111111111111111111111111111111112",
100 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
101 ],
102 [
103 189.9739863001899,
104 189.97400341153914,
105 188.98306775870205,
106 189.0641139332444,
107 644987.2130740001,
108 3404.7818689140017,
109 1735704000,
110 "1h",
111 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
112 "So11111111111111111111111111111111111111112",
113 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
114 ],
115 [
116 188.98834548025786,
117 190.126997275962,
118 188.98834548025786,
119 189.7479113043496,
120 779107.6320560005,
121 4106.191289562003,
122 1735707600,
123 "1h",
124 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
125 "So11111111111111111111111111111111111111112",
126 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
127 ],
128 [
129 189.59440160023175,
130 189.9043887377066,
131 188.98853949074328,
132 189.84927258573907,
133 888871.904823,
134 4691.795723701002,
135 1735711200,
136 "1h",
137 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
138 "So11111111111111111111111111111111111111112",
139 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
140 ],
141 [
142 189.89839027144353,
143 189.97447643932955,
144 189.28804959162153,
145 189.5945163320466,
146 544177.454244,
147 2870.2106599879985,
148 1735714800,
149 "1h",
150 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
151 "So11111111111111111111111111111111111111112",
152 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
153 ],
154 [
155 189.5945169093682,
156 190.27919913160966,
157 188.90660183483112,
158 188.98887404540355,
159 1024084.2185279999,
160 5403.363581164996,
161 1735718400,
162 "1h",
163 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
164 "So11111111111111111111111111111111111111112",
165 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
166 ],
167 [
168 189.1401892478719,
169 189.36765803490573,
170 187.6222526066206,
171 188.90947709868874,
172 845770.9815419995,
173 4489.710143661002,
174 1735722000,
175 "1h",
176 "5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6",
177 "So11111111111111111111111111111111111111112",
178 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
179 ]
180 ],
181 "rows": 24
182 }
183]
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/solana/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/solana/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/solana/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/solana/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