curl "https://api.metastreams.io/v1/ohlcv?tokens=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&chains=solana&timeframe=1h&metric=price&countBack=24" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.io/v1/ohlcv");
url.searchParams.set("tokens", "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263");
url.searchParams.set("chains", "solana");
url.searchParams.set("timeframe", "1h");
url.searchParams.set("metric", "price");
url.searchParams.set("countBack", "24");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const [series] = await response.json();
use serde_json::Value;
let series: Vec<Value> = reqwest::Client::new()
.get("https://api.metastreams.io/v1/ohlcv")
.query(&[
("tokens", "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"),
("chains", "solana"),
("timeframe", "1h"),
("metric", "price"),
("countBack", "24"),
])
.bearer_auth(std::env::var("API_KEY")?)
.send()
.await?
.error_for_status()?
.json()
.await?;
[
{
"chain": "solana",
"address": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"candles": [
{ "time": 1789545600000, "open": 0.0000221, "high": 0.0000224, "low": 0.0000219, "close": 0.0000222, "volume": 2104410.5 },
{ "time": 1789549200000, "open": 0.0000222, "high": 0.0000223, "low": 0.0000215, "close": 0.0000216, "volume": 2981337.2 }
]
}
]
{
"error": {
"code": "VALIDATION_ERROR",
"message": "One or more parameters are invalid.",
"details": [{ "field": "from", "message": "Must not be greater than `to`." }]
}
}
REST
OHLCV candles
Returns OHLCV candles for up to 10 tokens at any timeframe, by price or by market cap.
GET
/
v1
/
ohlcv
curl "https://api.metastreams.io/v1/ohlcv?tokens=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&chains=solana&timeframe=1h&metric=price&countBack=24" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.io/v1/ohlcv");
url.searchParams.set("tokens", "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263");
url.searchParams.set("chains", "solana");
url.searchParams.set("timeframe", "1h");
url.searchParams.set("metric", "price");
url.searchParams.set("countBack", "24");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const [series] = await response.json();
use serde_json::Value;
let series: Vec<Value> = reqwest::Client::new()
.get("https://api.metastreams.io/v1/ohlcv")
.query(&[
("tokens", "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"),
("chains", "solana"),
("timeframe", "1h"),
("metric", "price"),
("countBack", "24"),
])
.bearer_auth(std::env::var("API_KEY")?)
.send()
.await?
.error_for_status()?
.json()
.await?;
[
{
"chain": "solana",
"address": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"candles": [
{ "time": 1789545600000, "open": 0.0000221, "high": 0.0000224, "low": 0.0000219, "close": 0.0000222, "volume": 2104410.5 },
{ "time": 1789549200000, "open": 0.0000222, "high": 0.0000223, "low": 0.0000215, "close": 0.0000216, "volume": 2981337.2 }
]
}
]
{
"error": {
"code": "VALIDATION_ERROR",
"message": "One or more parameters are invalid.",
"details": [{ "field": "from", "message": "Must not be greater than `to`." }]
}
}
Returns one OHLCV candle series for each token in
tokens, a comma-separated list of 1 to 10 addresses. chains limits the read to a comma-separated list of chain slugs. Omit it to read every chain. Each series is oldest first, with one candle per bucket that traded. Buckets with no trades are omitted.
Response
The response is a list with one series per chain where each requested token has candles in the window, in the order of the request. Each series carrieschain, address and candles. A token with no candles in the window has no series, so the response can be an empty list. It is not a 404.
Time range
countBack sets the number of bars and overrides from, while to and timeframe still apply. A request with neither countBack nor from returns the most recent 500 buckets, and a window with more than 5000 candles returns the newest 5000. This matches the behavior TradingView’s charting library expects.
Pagination
The series has no cursor.from is inclusive and to is exclusive, both in milliseconds. Omit to to read up to the current time. To read further back, repeat the request with to set to the time of the oldest candle received. Because to is exclusive, that candle is not returned again.
curl "https://api.metastreams.io/v1/ohlcv?tokens=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&chains=solana&timeframe=1m&countBack=5000&to=1789545600000" \
-H "Authorization: Bearer $API_KEY"
Response fields
Candle values are JSON numbers rather than the decimal strings used in token and trade objects, because charting libraries expect numbers.Errors
| Code | When |
|---|---|
UNSUPPORTED_CHAIN | A slug in chains is not supported |
VALIDATION_ERROR | No token or more than 10, a malformed address, an unknown timeframe, from greater than to, a countBack outside 1–5000, or an unknown parameter |
curl "https://api.metastreams.io/v1/ohlcv?tokens=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263&chains=solana&timeframe=1h&metric=price&countBack=24" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.io/v1/ohlcv");
url.searchParams.set("tokens", "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263");
url.searchParams.set("chains", "solana");
url.searchParams.set("timeframe", "1h");
url.searchParams.set("metric", "price");
url.searchParams.set("countBack", "24");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const [series] = await response.json();
use serde_json::Value;
let series: Vec<Value> = reqwest::Client::new()
.get("https://api.metastreams.io/v1/ohlcv")
.query(&[
("tokens", "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"),
("chains", "solana"),
("timeframe", "1h"),
("metric", "price"),
("countBack", "24"),
])
.bearer_auth(std::env::var("API_KEY")?)
.send()
.await?
.error_for_status()?
.json()
.await?;
[
{
"chain": "solana",
"address": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"candles": [
{ "time": 1789545600000, "open": 0.0000221, "high": 0.0000224, "low": 0.0000219, "close": 0.0000222, "volume": 2104410.5 },
{ "time": 1789549200000, "open": 0.0000222, "high": 0.0000223, "low": 0.0000215, "close": 0.0000216, "volume": 2981337.2 }
]
}
]
{
"error": {
"code": "VALIDATION_ERROR",
"message": "One or more parameters are invalid.",
"details": [{ "field": "from", "message": "Must not be greater than `to`." }]
}
}
Authorizations
Query Parameters
Response
One series per chain where each named token, or its pool, has candles in the window, in the order the request named them. Each holds one page of candles, one per bucket that traded, oldest first.