OHLCV (Base/Quote)
Retrieve granular OHLCV data with separate base and quote token volumes for detailed trading analysis between any two SPL tokens. This is the most detailed view available of a trading relationship, with individual token flow tracked on each side for advanced analytics. Use it when you need to see how volume splits between the base and quote sides of a trading pair.
Parameters
Responses
Examples
1. Retrieve hourly OHLCV data for a SOL/USDC pair
This example fetches hourly OHLCV data for the SOL/USDC pair over a specified time range. Each interval includes separate base and quote volume metrics.
Response:
2 {
3 "columns": [
4 {
5 "name": "openPrice",
6 "type": "Nullable(Float64)"
7 },
8 {
9 "name": "highPrice",
10 "type": "Nullable(Float64)"
11 },
12 {
13 "name": "lowPrice",
14 "type": "Nullable(Float64)"
15 },
16 {
17 "name": "closePrice",
18 "type": "Nullable(Float64)"
19 },
20 {
21 "name": "volume",
22 "type": "Nullable(Float64)"
23 },
24 {
25 "name": "volumeBase",
26 "type": "Nullable(Float64)"
27 },
28 {
29 "name": "unixTime",
30 "type": "Nullable(Int64)"
31 },
32 {
33 "name": "interval",
34 "type": "String"
35 },
36 {
37 "name": "baseTokenAddress",
38 "type": "String"
39 },
40 {
41 "name": "quoteTokenAddress",
42 "type": "String"
43 },
44 {
45 "name": "tradeCount",
46 "type": "UInt64"
47 },
48 {
49 "name": "poolCount",
50 "type": "UInt64"
51 },
52 {
53 "name": "providerCount",
54 "type": "UInt64"
55 }
56 ],
57 "data": [
58 [
59 189.6625243484793,
60 191.695717169467,
61 189.51810429757174,
62 190.14084507042253,
63 21410089.416325193,
64 112342.39220576087,
65 1735689600,
66 "1h",
67 "So11111111111111111111111111111111111111112",
68 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
69 32391,
70 37,
71 4
72 ],
73 [
74 191.1272048166425,
75 191.6285651350636,
76 190.3136686537508,
77 190.89813708021254,
78 17247066.059550855,
79 90314.1759343398,
80 1735693200,
81 "1h",
82 "So11111111111111111111111111111111111111112",
83 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
84 27985,
85 35,
86 3
87 ],
88 [
89 190.3021719786612,
90 191.26610199990643,
91 190.26828564932876,
92 191.14794361550693,
93 17686310.04413288,
94 92758.91703103311,
95 1735696800,
96 "1h",
97 "So11111111111111111111111111111111111111112",
98 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
99 23762,
100 32,
101 3
102 ],
103 [
104 190.77370333885284,
105 190.84877516598925,
106 189.97734164925717,
107 190.02427516753872,
108 12383865.196407959,
109 65042.30334346957,
110 1735700400,
111 "1h",
112 "So11111111111111111111111111111111111111112",
113 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
114 20926,
115 33,
116 3
117 ],
118 [
119 189.41637,
120 189.81096002077487,
121 189.07539859510078,
122 189.0830825089519,
123 15068663.568698956,
124 79550.80894114784,
125 1735704000,
126 "1h",
127 "So11111111111111111111111111111111111111112",
128 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
129 24144,
130 35,
131 3
132 ],
133 [
134 189.9223938441478,
135 190.0489466975094,
136 189.26210239321418,
137 189.74888458101702,
138 14201329.27261292,
139 74850.07611125475,
140 1735707600,
141 "1h",
142 "So11111111111111111111111111111111111111112",
143 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
144 23280,
145 27,
146 4
147 ],
148 [
149 189.7160209783157,
150 189.7794947553121,
151 189.193703,
152 189.74209811906147,
153 12991105.70199395,
154 68572.05439734722,
155 1735711200,
156 "1h",
157 "So11111111111111111111111111111111111111112",
158 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
159 21721,
160 24,
161 3
162 ],
163 [
164 189.78531011158185,
165 189.7948884840379,
166 189.37686735413732,
167 189.64019776006458,
168 11790684.978162955,
169 62188.13235922013,
170 1735714800,
171 "1h",
172 "So11111111111111111111111111111111111111112",
173 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
174 21449,
175 19,
176 3
177 ],
178 [
179 189.6654225921158,
180 190.175179400185,
181 189.0953685809023,
182 189.11411684309033,
183 16512894.902367944,
184 87089.9436624573,
185 1735718400,
186 "1h",
187 "So11111111111111111111111111111111111111112",
188 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
189 25899,
190 32,
191 3
192 ],
193 [
194 189.02400110133593,
195 189.10101838931757,
196 187.8698621608887,
197 188.92087759356696,
198 19406301.78602204,
199 103046.51770799233,
200 1735722000,
201 "1h",
202 "So11111111111111111111111111111111111111112",
203 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
204 29708,
205 35,
206 3
207 ]
208 ],
209 "rows": 24
210 }
211]
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)
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/base-quote"
11);
12const data = await response.json();
Quickstart (Python)
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/base-quote")
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