# Agent402 Coin History - Historical Cryptocurrency Price Lookup

> Agent402 Coin History - Historical Cryptocurrency Price Lookup is a paid API for AI agents from agent402.tools, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns a historical price snapshot for a given cryptocurrency on a specific past date, including market cap, 24h volume, and prices in multiple currencies.

## Facts

- Endpoint: GET https://agent402.tools/api/coin-history
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-coin-history-historical-cryptocurrency-price-lookup-d567a0bd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ViK8RCUBfPKc91E49vS6y

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-coin-history-historical-cryptocurrency-price-lookup-d567a0bd
```

Example prompt: What was the price of Bitcoin in USD exactly 30 days ago, and what was its market cap and 24h volume on that date?

## When to prefer this

Use this endpoint when you need a historical price snapshot for a specific cryptocurrency on a past date (up to 365 days ago), including multi-currency breakdowns and market cap/volume. Prefer this over live price endpoints when the query is date-specific or retrospective. It is backed by CoinGecko data and requires no API key — payment is per-call via x402/USDC wallet.

## Known failure modes

- Unknown coin id returns an error or empty result
- Date older than 365 days is outside the supported range
- Invalid date format (not YYYY-MM-DD) causes a bad request
- Unsupported currency code may return null for that currency field
- CoinGecko upstream downtime may cause fetch failures or stale cached data

## How this service works

Price, market cap and 24h volume of a coin on ONE past date (00:00 UTC snapshot), in every currency at once plus your chosen one called out. Pass `date` (YYYY-MM-DD) or `daysAgo` (1-365). The point-in-time sibling of crypto-history (which returns a series): use it to value a position as of a date, compute a since-date return, or check a tax-lot basis. Historical range on this plan is the past 365 days, enforced before the call. Cached in-process for 5 minutes.

## Output

Returns a JSON object containing the coin's historical price in the requested currency and all other available currencies, market cap, 24h trading volume, the source (CoinGecko), the snapshot date, whether the result was cached, and the timestamp when it was fetched.

## 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": [
      "coin"
     ],
     "properties": {
      "coin": {
       "type": "string",
       "description": "Coin id (bitcoin, ethereum, ...)."
      },
      "date": {
       "type": "string",
       "description": "Snapshot date YYYY-MM-DD (UTC), within the past 365 days. Alternative to daysAgo."
      },
      "daysAgo": {
       "type": "number",
       "description": "Days before today, 1-365 (used when date is absent; default 30)."
      },
      "currency": {
       "type": "string",
       "description": "Currency to call out (default usd); all currencies are still returned under `allCurrencies`."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "source",
      "fetchedAt",
      "cached",
      "id",
      "symbol",
      "name",
      "date",
      "currency",
      "price",
      "marketCap",
      "volume24h",
      "allCurrencies"
     ],
     "properties": {
      "id": {
       "type": "string"
      },
      "date": {
       "type": "string"
      },
      "name": {
       "type": "string"
      },
      "price": {
       "type": "number"
      },
      "cached": {
       "type": "boolean"
      },
      "source": {
       "type": "string"
      },
      "symbol": {
       "type": "string"
      },
      "currency": {
       "type": "string"
      },
      "fetchedAt": {
       "type": "string"
      },
      "marketCap": {
       "type": "integer"
      },
      "volume24h": {
       "type": "integer"
      },
      "allCurrencies": {
       "type": "object"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "bitcoin",
  "date": "2026-07-23",
  "name": "Bitcoin",
  "price": 118412.55,
  "cached": false,
  "source": "coingecko",
  "symbol": "BTC",
  "currency": "usd",
  "fetchedAt": "2026-08-22T13:20:00.000Z",
  "marketCap": 2356000000000,
  "volume24h": 41000000000,
  "allCurrencies": {
   "price": {
    "btc": 1,
    "eur": 100812.3,
    "usd": 118412.55
   },
   "marketCap": {
    "usd": 2356000000000
   },
   "volume24h": {
    "usd": 41000000000
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-coin-history-historical-cryptocurrency-price-lookup-d567a0bd/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)
