Cambrian Token Price (Interval Aggregated) API

By Cambrian Network solana

GET /api/v1/solana/price-hour

Solana Token Price (Hourly Interval Aggregated)

Overview

Returns the aggregated USD price of a Solana token, grouped by a specified time interval (e.g., 1H, 1D, 1W). For each interval bucket, the endpoint returns the average price along with the number of underlying datapoints used in the calculation.

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://api.cambrian.org/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 Offsets the results, letting you skip a number of rows before the response starts returning rows.

Response Field Descriptions

Response Field Type Description
tokenAddress String Token program address (base58-44 string)
tokenSymbol String Token symbol
intervalStart DateTime('UTC') Start timestamp of the aggregation interval, in UTC
priceUSD Float64 Average USD price for the token during this interval
datapoints UInt64 Number of underlying price datapoints averaged for this interval

Examples

1. Hourly SOL Price History

Retrieve the most recent hourly-aggregated USD prices for wrapped SOL.

curl -X GET "https://api.cambrian.org/solana/price-hour?token_address=So11111111111111111111111111111111111111112&interval=1H&limit=10" \
  -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-08-07T14:00:00+00:00",
        73.89083682097075,
        1
      ],
      [
        "So11111111111111111111111111111111111111112",
        "SOL",
        "2026-08-07T13:00:00+00:00",
        74.0340956599602,
        1
      ],
      [
        "So11111111111111111111111111111111111111112",
        "SOL",
        "2026-08-07T12:00:00+00:00",
        73.88464550162668,
        1
      ],
      [
        "So11111111111111111111111111111111111111112",
        "SOL",
        "2026-08-07T11:00:00+00:00",
        73.59140423518488,
        1
      ],
      [
        "So11111111111111111111111111111111111111112",
        "SOL",
        "2026-08-07T10:00:00+00:00",
        73.56725774800141,
        1
      ],
      [
        "So11111111111111111111111111111111111111112",
        "SOL",
        "2026-08-07T09:00:00+00:00",
        73.47087076766317,
        1
      ],
      [
        "So11111111111111111111111111111111111111112",
        "SOL",
        "2026-08-07T08:00:00+00:00",
        73.06897472270381,
        1
      ],
      [
        "So11111111111111111111111111111111111111112",
        "SOL",
        "2026-08-07T07:00:00+00:00",
        72.87077455055025,
        1
      ],
      [
        "So11111111111111111111111111111111111111112",
        "SOL",
        "2026-08-07T06:00:00+00:00",
        72.89854532508471,
        1
      ],
      [
        "So11111111111111111111111111111111111111112",
        "SOL",
        "2026-08-07T05:00:00+00:00",
        72.64493813154434,
        1
      ]
    ],
    "rows": 10
  }
]

Note: This example limits results to 10 items. Each row represents one hourly interval, starting at intervalStart, with the average USD price for wrapped SOL (priceUSD) and the count of datapoints (datapoints) averaged for that hour.

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-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://x402.cambrian.org/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 through 5 automatically.

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