# Token Price History (OHLCV) API

> Token Price History (OHLCV) API is a paid API for AI agents from freetier-agent-api.pages.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-01).

Returns OHLCV candle data (daily or hourly) for a token from its most liquid DEX pool, including period high/low and percent change.

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/token-price-history?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/token-price-history-ohlcv-api-379cbd86
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cV29E83hDTJqnf-zz6ibf

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 token-price-history-ohlcv-api-379cbd86
```

Example prompt: Can you pull the last 30 daily OHLCV candles for the token at contract address 0xabc123... on Ethereum, including the period high, low, and percent change?

## When to prefer this

Choose this endpoint when you need structured OHLCV candlestick price history for a specific token on a supported chain (Base, Ethereum, Solana, Arbitrum, BSC, Polygon, Optimism, Avalanche) sourced from DEX pool data. It is ideal for agents that need price trend analysis, volatility checks, or volume data without requiring a centralized exchange API key. Prefer it over order-book or CEX APIs when the token is primarily traded on DEXes.

## Known failure modes

- Token contract address not found on the specified network — returns an error or empty candles array
- Unsupported network enum value — returns a validation error
- Limit exceeds maximum (180 for daily, 168 for hourly) — may be clamped or return an error
- Token has no liquid DEX pool on the selected chain — returns empty or null data
- Upstream GeckoTerminal API unavailable — returns a 5xx or timeout error

## How this service works

Invoice-to-JSON, on-chain tools (transaction explainer + payment check, wallet profile, contract ABI, ERC-20 token risk), company contacts and web-to-RAG for AI agents. Pay per call with x402 (USDC on Base). No signup, no API key.

## Output

A JSON object containing an array of OHLCV candles (each with open, high, low, close, volumeUsd, and timestamp), the overall period high and low prices, the total candle count, the interval used, and a period change percentage. Data is sourced from the token's most liquid DEX pool via GeckoTerminal.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "limit": {
       "type": "string",
       "description": "number of candles, default 30 (day) / 48 (hour)"
      },
      "address": {
       "type": "string",
       "description": "token contract address"
      },
      "network": {
       "enum": [
        "base",
        "ethereum",
        "solana",
        "arbitrum",
        "bsc",
        "polygon",
        "optimism",
        "avalanche"
       ],
       "type": "string",
       "description": "default base"
      },
      "interval": {
       "enum": [
        "day",
        "hour"
       ],
       "type": "string",
       "description": "default day"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "low": 0.00088,
  "high": 0.0011,
  "count": 30,
  "candles": [
   {
    "low": 0.0009,
    "high": 0.00097,
    "open": 0.00094,
    "time": "2026-10-28T00:00:00.000Z",
    "close": 0.00092,
    "volumeUsd": 380000
   }
  ],
  "interval": "day",
  "changePct": -12.4
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/token-price-history-ohlcv-api-379cbd86/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from freetier-agent-api.pages.dev](https://www.zero.xyz/host/freetier-agent-api.pages.dev/llms.txt)
