Cambrian Token Price and Volume (Single) API
GET /api/v1/solana/price-volume/single
Token Price and Volume (Single)
Retrieve current USD price, timeframe volume, and percentage changes for any SPL token in a single request. This endpoint combines price and volume data to reduce API calls and improve application performance, with data aggregated across major Solana DEXs.
Business Value
- Unified Data Access: Get both price and volume metrics in a single API call, reducing latency and API usage
- Performance Optimization: Minimizes network requests by combining related data points into one response
- Multi-DEX Coverage: Aggregated data from major Solana DEXs provides comprehensive market view
- Real-time Analytics: Current pricing and volume changes enable responsive trading and portfolio applications
- Developer Efficiency: Streamlined integration reduces code complexity for applications needing both price and volume data
Endpoint Details
URL:
https://opabinia.cambrian.network/api/v1/solana/price-volume/single
Method: GET
Authentication: Required via X-API-Key header
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| token_address | String | Yes | - | SPL token mint address (base58, 44 chars) |
| timeframe | String | Yes | - | Timeframe: 1h, 2h, 4h, 8h, 24h |
Response Field Descriptions
| Response Field | Type | Description |
|---|---|---|
| tokenAddress | String | SPL token mint address |
| symbol | String | Token symbol |
| priceUSD | Float64 | Current token price in USD |
| updateUnixTime | UInt32 | Unix timestamp of last price update |
| volumeUSD | Float64 | Total volume in USD for the specified timeframe |
| volumeChangePercent | Nullable(Float64) | Volume change percentage compared to previous timeframe |
| priceChangePercent | Nullable(Float64) | Price change percentage compared to previous timeframe |
| priceChangeUSD | Float64 | Absolute price change in USD |
Examples
1. Get SOL Price and Volume Data
Retrieve current price and 24-hour volume data for Solana (SOL) token.
curl -X GET "https://opabinia.cambrian.network/api/v1/solana/price-volume/single?token_address=So11111111111111111111111111111111111111112&timeframe=24h" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
{
"columns": [
{
"name": "tokenAddress",
"type": "String"
},
{
"name": "symbol",
"type": "String"
},
{
"name": "priceUSD",
"type": "Float64"
},
{
"name": "updateUnixTime",
"type": "UInt32"
},
{
"name": "volumeUSD",
"type": "Float64"
},
{
"name": "volumeChangePercent",
"type": "Nullable(Float64)"
},
{
"name": "priceChangePercent",
"type": "Nullable(Float64)"
},
{
"name": "priceChangeUSD",
"type": "Float64"
}
],
"data": [
[
"So11111111111111111111111111111111111111112",
"SOL",
126.99943107601075,
1769609710,
8313460522.41,
16.4,
2.63,
3.249912101347064
]
],
"rows": 1
}
Returns comprehensive price and volume data for SOL showing a current price of ~$127 with $8.3B in 24h volume, up 16.4% in volume and 2.63% in price.
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.
Quick Start (TypeScript)
npm install @x402/fetch @x402/evm viem
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const response = await fetchWithPayment(
"https://deep42.cambrian.network/api/v1/solana/price-volume/single"
);
const data = await response.json();
Quick Start (Python)
pip install "x402[httpx]"
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
async def main():
client = x402Client()
account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
register_exact_evm_client(client, EthAccountSigner(account))
async with x402HttpxClient(client) as http:
response = await http.get("https://deep42.cambrian.network/api/v1/solana/price-volume/single")
print(response.json())
asyncio.run(main())
Payment Flow
- Send a normal request to the endpoint (no API key needed)
- Server returns
402 Payment Requiredwith 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–5 automatically.
Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request
Related Endpoints
/api/v1/solana/price-current- Current token price data