Token price history (USD)
POST /api/token-price-historyHistorical 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.
Input
| Field | Type | Description |
|---|---|---|
symbol | string | Ticker symbol (e.g. ETH, BTC). Use this OR contract+network. |
contract | string | 0x-prefixed 40-char ERC-20 contract address (with `network`). |
network | string | ethereum / base / polygon / arbitrum / optimism (default ethereum). |
interval | string | 5m, 1h, or 1d (default 1d). |
days | number | Shortcut: window length in days ending now (default 1 for 5m, 7 for 1h, 30 for 1d). |
startTime | string | ISO-8601 or unix seconds. Overrides `days`. |
endTime | string | ISO-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
}),
});
Related tools
Crypto order book
GET /api/crypto-orderbookL2 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
GET /api/stablecoin-pegLive $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)
POST /api/wallet-balanceLook up the native coin balance (ETH/MATIC) plus every ERC-20 holding for a wallet address on Ethereum, Base, Polygon, A…
try in playground →