Agent402 / tools / token-price-history

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. 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.

TRY IN PLAYGROUND →

Input

FieldTypeDescription
symbolstringTicker symbol (e.g. ETH, BTC). Use this OR contract+network.
contractstring0x-prefixed 40-char ERC-20 contract address (with `network`).
networkstringethereum / base / polygon / arbitrum / optimism (default ethereum).
intervalstring5m, 1h, or 1d (default 1d).
daysnumberShortcut: window length in days ending now (default 1 for 5m, 7 for 1h, 30 for 1d).
startTimestringISO-8601 or unix seconds. Overrides `days`.
endTimestringISO-8601 or unix seconds (default now).

Example output

{
  "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"
}

Try it - see the 402 challenge (free)

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}'

The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:

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();
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
  }),
});
Wallet-only. This tool reaches the network/browser/storage, so it is paid in USDC via x402 (no proof-of-work tier).

Related tools

Crypto order book

$0.003 · GET /api/crypto-orderbook

L2 order-book snapshot for a spot pair: best bid/ask, mid price, spread (absolute + %), and the top N aggregated price l…

try in playground →

Stablecoin peg monitor

$0.003 · GET /api/stablecoin-peg

Live $1-peg deviation for the top USD stablecoins (USDT, USDC, USDS, DAI, USDe, PYUSD, USDD, TUSD, FDUSD by default, or …

try in playground →

Wallet balance (native + ERC-20)

$0.002 · POST /api/wallet-balance

Look up the native coin balance (ETH/MATIC) plus every ERC-20 holding for a wallet address on Ethereum, Base, Polygon, A…

try in playground →