Token price history (USD)

$0.004 per call · USDC via x402 · POST /api/token-price-history

Historical USD price series for a token, by ticker symbol (ETH, BTC, SOL, ...) or by ERC-20 contract + network, at 5-minute (up to 2 days), hourly (up to 30 days) or daily (up to 365 days) resolution. Send POST /api/token-price-history with no required fields (7 optional) and pay $0.004 per call over x402 or MPP (there is no free tier). It returns a JSON object with symbol, contract, network, currency, interval and 11 more.

Returns the points plus first/last/high/low and the percent change over the window - the data behind 'how did this token move over the last N days' without a separate market-data subscription. 404 (not charged) when the token is not in the price feed.

Category: Crypto & onchain data · Tags: crypto price history ohlc usd token erc20 chart

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
symbolstringnoTicker symbol (e.g. ETH, BTC). Use this OR contract+network.
contractstringno0x-prefixed 40-char ERC-20 contract address (with `network`).
networkstringnoethereum / base / polygon / arbitrum / optimism (default ethereum).
intervalstringno5m, 1h, or 1d (default 1d).
daysnumbernoShortcut: window length in days ending now (default 1 for 5m, 7 for 1h, 30 for 1d).
startTimestringnoISO-8601 or unix seconds. Overrides `days`.
endTimestringnoISO-8601 or unix seconds (default now).

Example request

curl -i -X POST https://agent402.tools/api/token-price-history \
  -H "Content-Type: application/json" \
  -d '{"contract":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","network":"ethereum","interval":"1d","days":7}'

Without payment this returns HTTP 402 Payment Required with the exact price for token-price-history; any x402 v2 or MPP client pays it and retries.

Example response

{
  "symbol": null,
  "contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "network": "ethereum",
  "currency": "usd",
  "interval": "1d",
  "startTime": "2026-08-15T12:00:00.000Z",
  "endTime": "2026-08-22T12:00:00.000Z",
  "count": 7,
  "first": 0.99966,
  "last": 0.99971,
  "high": 0.99982,
  "low": 0.99951,
  "changePct": 0.005,
  "points": [
    {
      "t": "2026-08-16T00:00:00Z",
      "price": 0.99966
    }
  ],
  "source": "alchemy",
  "fetchedAt": "2026-08-22T12:00:00.000Z"
}
FieldTypeAlways presentIn the example
symbolnullnonull
contractstringyes0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
networkstringyesethereum
currencystringyesusd
intervalstringyes1d
startTimestringyes2026-08-15T12:00:00.000Z
endTimestringyes2026-08-22T12:00:00.000Z
countnumberyes7
firstnumberyes0.99966
lastnumberyes0.99971
highnumberyes0.99982
lownumberyes0.99951
changePctnumberyes0.005
pointsarray of objectsyes1 item in the example
sourcestringyesalchemy
fetchedAtstringyes2026-08-22T12:00:00.000Z

From an MCP client

catalog.call {
  "slug": "token-price-history",
  "params": {
    "contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "network": "ethereum",
    "interval": "1d",
    "days": 7
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for token-price-history; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/token-price-history", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "network": "ethereum",
    "interval": "1d",
    "days": 7
  }),
});

Related tools

Token spot price (USD)

$0.001 · POST /api/token-price

Return the current USD spot price for an ERC-20 token, identified by its contract address and network. Sourced from Alch…

Coin market chart for a time window

$0.008 · GET /api/coin-market-chart-range

Price, market cap and volume series for a coin over an ARBITRARY time window: `from`/`to` as unix seconds or ISO dates, …

Coin OHLC candles

$0.008 · GET /api/coin-ohlc

OHLC candles for a coin: days 1 (30-min candles), 7 or 14 (4-hour), 30 / 90 / 180 / 365 (daily), in any vs currency. Ret…

Token price by contract address

$0.005 · GET /api/coin-price-by-contract

Live price, market cap, 24h volume and 24h change for ERC-20 / SPL / other chain tokens looked up by CONTRACT ADDRESS on…

Stablecoin supply history

$0.002 · POST /api/stablecoin-supply-history

Daily total stablecoin circulating supply (in USD) over time from DefiLlama's free stablecoin charts, for all chains or …

Wallet token transfers (filtered)

$0.003 · POST /api/asset-transfers

Recent token transfers for a wallet on Base, Ethereum and other EVM chains, newest first. Filtered transfer log for an E…