Token OHLCV Data
Retrieve Open, High, Low, Close, and Volume (OHLCV) data for any SPL token across specified time intervals. This endpoint provides comprehensive price and trading volume metrics essential for technical analysis and trading strategy development on Solana.
Parameters
Responses
Examples
1. Hourly OHLCV Data for SOL Token
Get hourly OHLCV data for Wrapped SOL over a 24-hour period to analyze short-term price movements and trading volumes.
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": "volumeToken",
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": "tokenAddress",
38 "type": "String"
39 }
40 ],
41 "data": [
42 [
43 190.02896429484457,
44 191.46123775723134,
45 189.93454611861705,
46 190.14084507042253,
47 18336881.84702409,
48 96152.88098244628,
49 1735689600,
50 "1h",
51 "So11111111111111111111111111111111111111112"
52 ],
53 [
54 191.1272048166425,
55 191.47069941197873,
56 190.65040801684015,
57 190.89813708021254,
58 14820073.972368002,
59 77582.02503583477,
60 1735693200,
61 "1h",
62 "So11111111111111111111111111111111111111112"
63 ],
64 [
65 190.7510665087174,
66 191.15446510806973,
67 190.41341361640804,
68 191.14176965009318,
69 15147530.53400096,
70 79424.70777417776,
71 1735696800,
72 "1h",
73 "So11111111111111111111111111111111111111112"
74 ],
75 [
76 190.77370333885284,
77 190.83896467848294,
78 190.08646348496325,
79 190.44006524274295,
80 10935944.62225898,
81 57407.6305247706,
82 1735700400,
83 "1h",
84 "So11111111111111111111111111111111111111112"
85 ],
86 [
87 189.41637,
88 189.800143706478,
89 189.2359063825013,
90 189.4499725170332,
91 13504379.410405014,
92 71266.28414577786,
93 1735704000,
94 "1h",
95 "So11111111111111111111111111111111111111112"
96 ],
97 [
98 189.86046156817085,
99 190.09403051275774,
100 189.590976,
101 189.80453305785124,
102 12826478.285232937,
103 67567.45013128487,
104 1735707600,
105 "1h",
106 "So11111111111111111111111111111111111111112"
107 ],
108 [
109 189.7160209783157,
110 189.82147361798832,
111 189.3138999329921,
112 189.79999999999998,
113 11567187.100701973,
114 61032.001700627974,
115 1735711200,
116 "1h",
117 "So11111111111111111111111111111111111111112"
118 ],
119 [
120 189.8693038721531,
121 189.908447,
122 189.49643291819925,
123 189.84637033006047,
124 11115165.199889978,
125 58604.48739789844,
126 1735714800,
127 "1h",
128 "So11111111111111111111111111111111111111112"
129 ],
130 [
131 189.62699129495397,
132 190.16950354851585,
133 189.318549197926,
134 189.43089278372233,
135 14157638.143593896,
136 74613.4871102127,
137 1735718400,
138 "1h",
139 "So11111111111111111111111111111111111111112"
140 ],
141 [
142 188.61736502544898,
143 188.8860650288014,
144 188.03831735111763,
145 188.80736664274005,
146 16185241.416632997,
147 85906.51899640434,
148 1735722000,
149 "1h",
150 "So11111111111111111111111111111111111111112"
151 ]
152 ],
153 "rows": 24
154 }
155]
2. Daily OHLCV Data Analysis
Retrieve daily OHLCV data for a full week to support longer-term trend analysis with reduced data granularity.
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": "volumeToken",
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": "tokenAddress",
38 "type": "String"
39 }
40 ],
41 "data": [
42 [
43 189.65782030428116,
44 191.19771269291377,
45 189.58437185046847,
46 190.00000000000003,
47 282545393.3481766,
48 1484786.4934918114,
49 1735689600,
50 "1d",
51 "So11111111111111111111111111111111111111112"
52 ],
53 [
54 205.95993992290852,
55 208.07949378793484,
56 205.8853442021006,
57 207.90320000000003,
58 402311189.4337393,
59 1943426.4228084276,
60 1735776000,
61 "1d",
62 "So11111111111111111111111111111111111111112"
63 ],
64 [
65 208.02620046741387,
66 216.34037107799142,
67 206.73117908701826,
68 215.6642832245662,
69 93295132.31347863,
70 447081.33486659755,
71 1735862400,
72 "1d",
73 "So11111111111111111111111111111111111111112"
74 ],
75 [
76 216.93213236976655,
77 216.99026674175798,
78 215.39225422045678,
79 216.6632428457716,
80 29157258.552583814,
81 134891.08379508962,
82 1735948800,
83 "1d",
84 "So11111111111111111111111111111111111111112"
85 ],
86 [
87 212.832906441929,
88 214.16558989838015,
89 212.73748647845593,
90 213.4164972681658,
91 225194163.00528666,
92 1054759.4801058057,
93 1736035200,
94 "1d",
95 "So11111111111111111111111111111111111111112"
96 ],
97 [
98 213.3476856835307,
99 218.33239419940801,
100 213.07537303596683,
101 218.1433434538596,
102 141540307.9812308,
103 657090.9383419061,
104 1736121600,
105 "1d",
106 "So11111111111111111111111111111111111111112"
107 ],
108 [
109 212.0663999414671,
110 216.39604367789576,
111 204.34945631796026,
112 204.58701227454648,
113 60940467.61426936,
114 289884.51315699256,
115 1736208000,
116 "1d",
117 "So11111111111111111111111111111111111111112"
118 ],
119 [
120 202.13072878400698,
121 202.13072878400698,
122 202.13072878400698,
123 202.13072878400698,
124 3.300586,
125 0.016328967,
126 1736294400,
127 "1d",
128 "So11111111111111111111111111111111111111112"
129 ]
130 ],
131 "rows": 8
132 }
133]
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/token"
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/token")
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