curl "https://api.metastreams.dev/v1/balances?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&chains=solana" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.dev/v1/balances");
url.searchParams.set("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5");
url.searchParams.set("chains", "solana");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const balances = await response.json();
use serde_json::Value;
let balances: Vec<Value> = reqwest::Client::new()
.get("https://api.metastreams.dev/v1/balances")
.query(&[("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"), ("chains", "solana")])
.bearer_auth(std::env::var("API_KEY")?)
.send()
.await?
.error_for_status()?
.json()
.await?;
[
{
"chain": "solana",
"wallet": "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5",
"asset": "SOL",
"balance": "41.208113",
"trigger": "trade",
"blockNumber": 371204118,
"signature": "4xQmVb8e2kT1nR7pZcW3sLdHfA9jEuY6gVnX1oB5iC0wQ2rT8yU3iO7pA1sD4fG6h",
"txIndex": 812,
"updatedAt": 1789632015120
}
]
[]
REST
Balances
Returns the latest balance of each wallet and asset, across one or more chains.
GET
/
v1
/
balances
curl "https://api.metastreams.dev/v1/balances?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&chains=solana" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.dev/v1/balances");
url.searchParams.set("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5");
url.searchParams.set("chains", "solana");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const balances = await response.json();
use serde_json::Value;
let balances: Vec<Value> = reqwest::Client::new()
.get("https://api.metastreams.dev/v1/balances")
.query(&[("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"), ("chains", "solana")])
.bearer_auth(std::env::var("API_KEY")?)
.send()
.await?
.error_for_status()?
.json()
.await?;
[
{
"chain": "solana",
"wallet": "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5",
"asset": "SOL",
"balance": "41.208113",
"trigger": "trade",
"blockNumber": 371204118,
"signature": "4xQmVb8e2kT1nR7pZcW3sLdHfA9jEuY6gVnX1oB5iC0wQ2rT8yU3iO7pA1sD4fG6h",
"txIndex": 812,
"updatedAt": 1789632015120
}
]
[]
Returns the latest balance of each requested wallet, with one row per chain, wallet and asset.
wallets takes 1 to 100 comma-separated addresses. chains limits results to a comma-separated list of chain slugs; omit it to include every chain. Each wallet comes back in canonical form: Base58 on Solana, and lowercase hex on EVM chains.
Response
The response is a list with one row per chain, wallet and asset with at least one transaction, ordered by chain, wallet, then asset. A wallet and asset with no observed balance has no row, and a missing row does not mean a zero balance.balance is the amount after the most recent transaction that changed it, in the asset’s own units. trigger is the event type that changed it, such as trade or deposit. New trigger and asset values can be added, so keep unrecognized values rather than discarding them.
blockNumber and txIndex give the row’s position in its chain. To merge this response with the wallet.balances stream, follow the rule on that page.
Errors
| Code | When |
|---|---|
UNSUPPORTED_CHAIN | A chains value is not a supported slug |
VALIDATION_ERROR | No wallet or more than 100, a malformed address, or an unknown parameter |
curl "https://api.metastreams.dev/v1/balances?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&chains=solana" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.dev/v1/balances");
url.searchParams.set("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5");
url.searchParams.set("chains", "solana");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const balances = await response.json();
use serde_json::Value;
let balances: Vec<Value> = reqwest::Client::new()
.get("https://api.metastreams.dev/v1/balances")
.query(&[("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"), ("chains", "solana")])
.bearer_auth(std::env::var("API_KEY")?)
.send()
.await?
.error_for_status()?
.json()
.await?;
[
{
"chain": "solana",
"wallet": "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5",
"asset": "SOL",
"balance": "41.208113",
"trigger": "trade",
"blockNumber": 371204118,
"signature": "4xQmVb8e2kT1nR7pZcW3sLdHfA9jEuY6gVnX1oB5iC0wQ2rT8yU3iO7pA1sD4fG6h",
"txIndex": 812,
"updatedAt": 1789632015120
}
]
[]
Authorizations
Query Parameters
Response
The latest balance of each named wallet and asset. A pair with no observed balance has no row, which is not a zero.