Cambrian Token Price (Unix) API

By Cambrian Network solana

GET /api/v1/solana/price-unix

Token Price (Unix Timestamp)

Retrieves historical token price data for a specific Unix timestamp. This endpoint provides precise price information for Solana tokens at any hour-granular timestamp.

Business Value

  • Historical Analysis: Access accurate price data for any specific point in time for backtesting and analysis
  • Time-Series Research: Build comprehensive datasets for token price movements and volatility studies
  • Portfolio Tracking: Calculate exact portfolio values at specific timestamps for performance analysis
  • Data Integration: Seamlessly integrate historical price data into trading algorithms and research platforms
  • Precise Timestamps: Get hour-level granular price data with UTC timestamp alignment for global consistency

Endpoint Details

URL:

https://opabinia.cambrian.network/api/v1/solana/price-unix

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

Query Parameters

Parameter Type Required Default Description
token_address string Yes - Solana token mint address (base58 format). Example: So11111111111111111111111111111111111111112
unixtime integer Yes - Hour in unix timestamp to query price for (0 to 10000000000, rounded down to the nearest hour). Example: 1726700000

Response Field Descriptions

Response Field Type Description
tokenAddress String The Solana token mint address
updateUnixTime UInt32 Unix timestamp when price data was last updated
updateUTCTime String UTC timestamp when price data was last updated
priceUSD Float64 Token price in USD
change24h Float64 24-hour price change percentage
dataSource String Source of the price data (e.g., "historical")
availability String Data availability status (e.g., "available")

Examples

1. Get SOL Token Price at Specific Time

Retrieve the price of Wrapped SOL (WSOL) token for a specific Unix timestamp.

curl -X GET "https://opabinia.cambrian.network/api/v1/solana/price-unix?token_address=So11111111111111111111111111111111111111112&unixtime=1750110000" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

{
  "columns": [
    {
      "name": "tokenAddress",
      "type": "String"
    },
    {
      "name": "updateUnixTime",
      "type": "UInt32"
    },
    {
      "name": "updateUTCTime",
      "type": "String"
    },
    {
      "name": "priceUSD",
      "type": "Float64"
    },
    {
      "name": "change24h",
      "type": "Float64"
    },
    {
      "name": "dataSource",
      "type": "String"
    },
    {
      "name": "availability",
      "type": "String"
    }
  ],
  "data": [
    [
      "So11111111111111111111111111111111111111112",
      1750107600,
      "2025-06-16T21:00:00Z",
      157.03180938284908,
      5.096096498184193,
      "historical",
      "available"
    ]
  ],
  "rows": 1
}

The response shows that WSOL was priced at $157.03 USD at the requested timestamp with a 24-hour change of approximately +5.10%, indicating positive price movement.

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-unix"
);
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-unix")
        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–5 automatically.

Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request


Related Endpoints

  • /api/v1/solana/ohlcv/token - Retrieve Open, High, Low, Close, and Volume data for any SPL token
  • /api/v1/solana/ohlcv/base-quote - Retrieve granular OHLCV data with separate base and quote token volumes for detailed trading analysis between any two SPL tokens
  • /api/v1/solana/ohlcv/pool - Retrieve OHLCV data for individual pool contracts enabling pair-specific price analysis and liquidity venue performance tracking