Cambrian Token Price (Interval Aggregated) API

By Cambrian Network solana

GET /api/v1/solana/price-hour

Token Price Hourly Data

Retrieves hourly aggregated token price data for Solana tokens over time. This endpoint provides historical price points with configurable time intervals and data limits.

Business Value

  • Historical Price Analysis: Access comprehensive hourly price data for technical analysis and trend identification
  • Trading Strategy Development: Build data-driven trading algorithms using reliable historical price feeds
  • Portfolio Performance Tracking: Monitor token price movements over custom time intervals for portfolio optimization
  • Market Research: Analyze token price volatility and patterns for investment decision-making
  • Integration Flexibility: Customize data retrieval with various interval options (1H to 1M) and result limits

Endpoint Details

URL:

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

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

Query Parameters

Parameter Type Required Default Description
token_address String Yes - Token program address (base58-44 string). See tokens for valid addresses.
interval String Yes - Time interval for price aggregation. One of: 1H, 2H, 4H, 6H, 8H, 12H, 1D, 3D, 1W, 1M.
limit Integer No 24 Limit the number of results.
offset Integer No 0 Offset the results, allows you to skip a number of rows before starting to return rows.

Response Field Descriptions

Response Field Type Description
tokenAddress String The Solana token mint address
tokenSymbol String Token symbol (e.g., SOL, USDC)
intervalStart DateTime Start time of the price interval in UTC
priceUSD Float64 Token price in USD for the given interval
datapoints UInt64 Number of data points used in price aggregation

Examples

1. Get SOL Hourly Price Data

Retrieve the last 24 hours of SOL price data with 1-hour intervals.

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

Response:

{
  "columns": [
    {
      "name": "tokenAddress",
      "type": "String"
    },
    {
      "name": "tokenSymbol",
      "type": "String"
    },
    {
      "name": "intervalStart",
      "type": "DateTime('UTC')"
    },
    {
      "name": "priceUSD",
      "type": "Float64"
    },
    {
      "name": "datapoints",
      "type": "UInt64"
    }
  ],
  "data": [
    [
      "So11111111111111111111111111111111111111112",
      "SOL",
      "2026-01-28T13:00:00+00:00",
      127.26939703376955,
      1
    ],
    [
      "So11111111111111111111111111111111111111112",
      "SOL",
      "2026-01-28T12:00:00+00:00",
      127.45250374050678,
      2
    ],
    [
      "So11111111111111111111111111111111111111112",
      "SOL",
      "2026-01-28T11:00:00+00:00",
      127.52338304261028,
      2
    ],
    [
      "So11111111111111111111111111111111111111112",
      "SOL",
      "2026-01-28T10:00:00+00:00",
      127.44226466619372,
      1
    ],
    [
      "So11111111111111111111111111111111111111112",
      "SOL",
      "2026-01-28T09:00:00+00:00",
      126.762011179554,
      1
    ]
  ],
  "rows": 5
  // ... additional rows omitted for brevity
}

Returns SOL price data aggregated in 1-hour intervals, showing the token address, symbol, interval start time, USD price, and number of data points used for each aggregation.

2. Get Extended Historical Data

Retrieve 7 days of SOL price data with 12-hour intervals.

curl -X GET "https://opabinia.cambrian.network/api/v1/solana/price-hour?token_address=So11111111111111111111111111111111111111112&interval=12H&limit=14" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

{
  "columns": [
    {
      "name": "tokenAddress",
      "type": "String"
    },
    {
      "name": "tokenSymbol",
      "type": "String"
    },
    {
      "name": "intervalStart",
      "type": "DateTime('UTC')"
    },
    {
      "name": "priceUSD",
      "type": "Float64"
    },
    {
      "name": "datapoints",
      "type": "UInt64"
    }
  ],
  "data": [
    [
      "So11111111111111111111111111111111111111112",
      "SOL",
      "2026-01-28T12:00:00+00:00",
      127.35,
      12
    ]
  ],
  "rows": 1
  // ... additional intervals would be returned
}

Returns SOL price data with 12-hour aggregation intervals, providing broader trend analysis with fewer but more comprehensive data points.

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-hour"
);
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-hour")
        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/price-current - Get current token price data
  • /api/v1/solana/tokens/holders - Get token holder information
  • /api/v1/solana/tokens/holders-over-time - Get historical token holder data