Cambrian Token Price and Volume (Single) API

By Cambrian Network solana

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

Token Price and Volume (Single)

Overview

Retrieve current USD price, timeframe volume, and percentage changes for any SPL token on Solana. This endpoint combines price and volume data in a single request 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://api.cambrian.org/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 price of the token in USD
updateUnixTime UInt32 Unix timestamp of when the price was last updated
volumeUSD Float64 Trading volume in USD over the specified timeframe
volumeChangePercent Nullable(Float64) Percentage change in volume over the specified timeframe
priceChangePercent Nullable(Float64) Percentage change in price over the specified timeframe
priceChangeUSD Float64 Change in price (in USD) over the specified timeframe

Examples

1. Get 24-hour price and volume for SOL

Retrieve the current price, 24-hour volume, and percentage changes for the native SOL token.

curl -X GET "https://api.cambrian.org/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",
        73.98361922559988,
        1785939569,
        6720158901.17,
        15.19,
        0.57,
        0.41930502657031354
      ]
    ],
    "rows": 1
  }
]

Result collections are limited to 10 items. The response shows SOL trading at approximately $73.98, with 24-hour trading volume of over $6.7 billion, a 15.19% increase in volume, and a 0.57% increase in price over the timeframe.

x402 Payment Option

This endpoint supports pay-per-use access via the x402 payment protocol (v2), paying $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/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://x402.cambrian.org/solana/price-volume/single")
        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/multi - Retrieve current USD price, timeframe volume, and percentage changes for multiple SPL tokens in a single request.
  • /solana/price-current - Retrieves the latest available USD price for a given Solana token program address.
  • /solana/trade-statistics - Get instant trade analytics and performance metrics for any SPL tokens, including buy/sell volume breakdowns.
  • /solana/ohlcv/token - Retrieve Open, High, Low, Close, and Volume data for any SPL token.
  • /solana/price-hour - Aggregated USD price of a Solana token, grouped by the specified interval.