# Prices Historical

> Prices Historical is a paid API for AI agents from stablecrypto.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns historical token prices from DeFiLlama at a specified Unix timestamp

## Facts

- Endpoint: POST https://stablecrypto.dev/api/defillama/coins/prices-historical
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/prices-historical-12c4b1dc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_y08V8cfWcvsK6n0Y2X1-J

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 prices-historical-12c4b1dc -d '<json body>'
```

Example prompt: What were the prices of ethereum:0x0000000000000000000000000000000000000000 and coingecko:bitcoin at Unix timestamp 1700000000? Use a searchWidth of 1h.

## When to prefer this

Use this endpoint when you need token prices at a specific historical moment — for example, for tax calculations, portfolio valuation at a past date, or reconciling historical trades. Prefer this over current-price endpoints when the timestamp is in the past and over on-chain oracles when you need aggregated multi-source pricing via DeFiLlama.

## Known failure modes

- Invalid or unrecognized coin ID returns empty or missing entry for that coin
- Unix timestamp out of range or too old may return no data
- Malformed coins string causes validation error
- searchWidth too narrow may result in no matching price data
- Rate limiting or payment failure returns HTTP 402 or 429

## How this service works

Pay-per-request access to CoinGecko, DefiLlama, Alchemy, and Etherscan APIs. No auth, no subscriptions.

## Output

A JSON object keyed by coin ID, each containing the historical price, symbol, decimals, and timestamp of the closest data point to the requested Unix timestamp.

## Example request

```json
{
 "coins": "ethereum:0x0000000000000000000000000000000000000000,coingecko:bitcoin",
 "timestamp": 1700000000,
 "searchWidth": "1h"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "coins": {
   "type": "string",
   "description": "Comma-separated coin IDs"
  },
  "timestamp": {
   "type": "number",
   "description": "Unix timestamp"
  },
  "searchWidth": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/prices-historical-12c4b1dc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from stablecrypto.dev](https://www.zero.xyz/host/stablecrypto.dev/llms.txt)
