Cambrian Token Price and Volume (Multi) API

By Cambrian Network solana

GET /api/v1/solana/price-volume/multi

Token Price and Volume (Multi)

Overview

Retrieve current USD price, timeframe volume, and percentage changes for multiple SPL tokens in a single request. This endpoint combines price and volume data across major Solana DEXs to reduce API calls and improve application performance.

Business Value

  • Multi-token Efficiency: Query up to 50 tokens simultaneously, reducing API calls by 50x compared to individual requests
  • Real-time Price Tracking: Get current USD prices with timestamp precision for accurate market data
  • Volume Analytics: Track trading volume and percentage changes over customizable timeframes (1h-24h)
  • Performance Optimization: Single-request design minimizes latency for portfolio and dashboard applications
  • Cross-DEX Aggregation: Consolidated data from major Solana decentralized exchanges for comprehensive market coverage

Endpoint Details

URL:

https://api.cambrian.org/solana/price-volume/multi

Method: GET
Authentication: Required via X-API-Key header

Query Parameters

Parameter Type Required Default Description
token_addresses String Yes - Comma-separated SPL token mint addresses (max 50, base58). Example: So11111111111111111111111111111111111111112
timeframe String Yes - Timeframe for volume/change calculations. One of: 1h, 2h, 4h, 8h, 24h

Response Field Descriptions

Response Field Type Description
tokenAddress String The Solana SPL token mint address
symbol String Token symbol (e.g., SOL, USDC)
priceUSD Float64 Current USD price of the token
updateUnixTime UInt32 Unix timestamp of the last price update
volumeUSD Float64 Trading volume in USD for the specified timeframe
volumeChangePercent Nullable(Float64) Percentage change in volume compared to the previous equivalent period
priceChangePercent Nullable(Float64) Percentage change in price over the specified timeframe
priceChangeUSD Float64 Absolute price change in USD over the specified timeframe

Examples

1. Single Token Price and Volume

Get current price and 24-hour volume data for SOL.

curl -X GET "https://api.cambrian.org/solana/price-volume/multi?token_addresses=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",
      74.08998328711053,
      1785882990,
      5809344077.13,
      7.49,
      0.81,
      0.5989375792962619
    ]
  ],
  "rows": 1
}

This response shows SOL trading at approximately $74.09, with a 24-hour volume of roughly $5.81B, a +0.81% price change, and a +7.49% volume change versus the prior 24-hour period.

2. Multiple Tokens Analysis

Query price and volume data for SOL and USDC together using a shorter 1-hour timeframe.

curl -X GET "https://api.cambrian.org/solana/price-volume/multi?token_addresses=So11111111111111111111111111111111111111112,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&timeframe=1h" \
  -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": [
    [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "USDC",
      1,
      1785883016,
      7764622.2,
      -33.72,
      0.01,
      0.00009741738607205175
    ],
    [
      "So11111111111111111111111111111111111111112",
      "SOL",
      74.09165043246642,
      1785883016,
      229135891.69,
      -2.16,
      0.03,
      0.02149753241180008
    ]
  ],
  "rows": 2
}

This example demonstrates fetching multiple tokens in one call: USDC holds its $1.00 peg (0.01% change) with a -33.72% drop in 1-hour volume, while SOL is up 0.03% with a -2.16% volume change over the same window.

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://x402.cambrian.org/solana/price-volume/multi"
);
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://x402.cambrian.org/solana/price-volume/multi")
        print(response.json())

asyncio.run(main())

Payment Flow

  1. Send a normal request to the endpoint (no API key needed)
  2. Server returns 402 Payment Required with payment details
  3. The x402 SDK automatically signs a payment authorization with your wallet
  4. The SDK resubmits the request with the signed payment
  5. 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


Related Endpoints

  • /solana/price-volume/single - Retrieve current USD price, timeframe volume, and percentage changes for a single SPL token
  • /solana/price-current - Retrieves the latest available USD price for a given Solana token program address
  • /solana/price-multi - Retrieves the latest available USD prices for multiple Solana token program addresses (comma-separated)
  • /solana/price-hour - Aggregated USD price of a Solana token by program address, grouped by the specified interval
  • /solana/price-unix - Retrieve historical price data for a specified Solana token at the nearest hour to a specific Unix timestamp