# Agent402 Token Price History

> Agent402 Token Price History is a paid API for AI agents from agent402.tools, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-15).

Returns historical OHLC-style price data for a cryptocurrency token (by ticker symbol or ERC-20 contract address) over a configurable time window and interval.

## Facts

- Endpoint: POST https://agent402.tools/api/token-price-history
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-token-price-history-b6cb19e6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DN7mUUgnHWdhGRNuSo7kp

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-token-price-history-b6cb19e6 -d '<json body>'
```

Example prompt: Pull the daily price history for ETH on Ethereum over the last 30 days and tell me the highest and lowest prices and the overall percentage change.

## When to prefer this

Choose this endpoint when you need structured historical token price data (OHLC-style candles) for a specific ERC-20 token or major crypto asset across Ethereum, Base, Polygon, Arbitrum, or Optimism — especially when you want flexible time windows and intervals without needing an API key. Prefer this over generic market data APIs when operating in an agent wallet context (x402/MPP pay-per-call) or when querying tokens by contract address rather than CEX ticker.

## Known failure modes

- Invalid or unrecognized ticker symbol returns an error or empty result
- Contract address not found on the specified network
- Mismatched contract+network combination yields no data
- startTime after endTime returns a validation error
- Unsupported interval value (not 5m, 1h, or 1d) causes a bad request
- Token has insufficient on-chain liquidity history for requested range
- Payment failure (insufficient USDC balance) blocks the call entirely

## How this service works

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.

## Output

A JSON object containing an array of timestamped price points (each with a Unix-aligned ISO timestamp and USD price), plus aggregate stats: first price, last price, high, low, change percentage, candle count, interval used, start/end times, network, contract address, ticker symbol, currency, data source (Alchemy), and fetch timestamp.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "days": {
   "type": "number",
   "description": "Shortcut: window length in days ending now (default 1 for 5m, 7 for 1h, 30 for 1d)."
  },
  "symbol": {
   "type": "string",
   "description": "Ticker symbol (e.g. ETH, BTC). Use this OR contract+network."
  },
  "endTime": {
   "type": "string",
   "description": "ISO-8601 or unix seconds (default now)."
  },
  "network": {
   "type": "string",
   "description": "ethereum / base / polygon / arbitrum / optimism (default ethereum)."
  },
  "contract": {
   "type": "string",
   "description": "0x-prefixed 40-char ERC-20 contract address (with `network`)."
  },
  "interval": {
   "type": "string",
   "description": "5m, 1h, or 1d (default 1d)."
  },
  "startTime": {
   "type": "string",
   "description": "ISO-8601 or unix seconds. Overrides `days`."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "low": 0.99951,
  "high": 0.99982,
  "last": 0.99971,
  "count": 7,
  "first": 0.99966,
  "points": [
   {
    "t": "2026-08-16T00:00:00Z",
    "price": 0.99966
   }
  ],
  "source": "alchemy",
  "symbol": null,
  "endTime": "2026-08-22T12:00:00.000Z",
  "network": "ethereum",
  "contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "currency": "usd",
  "interval": "1d",
  "changePct": 0.005,
  "fetchedAt": "2026-08-22T12:00:00.000Z",
  "startTime": "2026-08-15T12:00:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-token-price-history-b6cb19e6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
