# DefiLlama — Get historical prices of tokens by contract address

Get DefiLlama Historical Token Prices data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by DeFiLlama, configure supported query parameters and filters, and retrieve structured data including coins, <coin>, price, token ticker symbol, and on-chain token decimal places for value historical snapshots, audit on-chain events, and reconstruct historical tvl.

Documentation: https://openany.si/defillama/defillama-get-historical-prices-of-tokens-by-contract-address/fe0409df-c5bb-473a-9914-5bf9fc6abf8b/
API ID: fe0409df-c5bb-473a-9914-5bf9fc6abf8b
Provider: defillama
Contract revision: 4
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/defillama/prices/historical/{timestamp}/{coins}
Page update time: 2026-12-03T02:39:15.380Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:39:12.336Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## DefiLlama Historical Token Prices API

Pass a numeric UNIX `timestamp` and comma-separated `{chain}:{address}` or `coingecko:{id}` keys in `coins`. The response returns a `coins` map with each matched token’s historical price, symbol, decimals, timestamp and confidence.

## What You Can Build

- **Value historical snapshots**: Price every token in a wallet at month-end or fiscal-year-end UNIX timestamps.
- **Audit on-chain events**: Combine with the Closest Block API to match block timestamps with exact token prices.
- **Reconstruct historical TVL**: Multiply historical contract balances by point-in-time USD quotes.

## Returned Data

| Field | Meaning |
| --- | --- |
| `coins` | Map of requested token identifiers to historical price records |
| `coins.<coin>` | Historical price object keyed by the token identifier |
| `coins.<coin>.price` | Historical token price in USD near the requested timestamp |
| `coins.<coin>.symbol` | Token ticker symbol |
| `coins.<coin>.decimals` | On-chain token decimal places |
| `coins.<coin>.timestamp` | UNIX timestamp of the matched price observation |
| `coins.<coin>.confidence` | Confidence score for the historical quote |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "DefiLlama — Get historical prices of tokens by contract address request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {
        "coins": {
          "type": "string",
          "description": "set of comma-separated tokens defined as {chain}:{address}"
        },
        "timestamp": {
          "type": "number",
          "description": "UNIX timestamp of time when you want historical prices"
        }
      },
      "required": [
        "coins",
        "timestamp"
      ]
    },
    "query": {
      "type": "object",
      "properties": {}
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "coins": {
      "type": "object",
      "properties": {
        "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
          "type": "object",
          "properties": {
            "confidence": {
              "type": "number"
            },
            "decimals": {
              "type": "integer"
            },
            "price": {
              "type": "number"
            },
            "symbol": {
              "type": "string"
            },
            "timestamp": {
              "type": "integer"
            }
          }
        }
      }
    }
  }
}
```

## Request example
Scenario: Official UI example (not runtime verified)
```bash
curl \
  'https://api.openany.si/v1/agent-apis/defillama/prices/historical/1648680149/ethereum%3A0xdF574c24545E5FfEcb9a659c229253D4111d87e1%2Ccoingecko%3Aethereum%2Cbsc%3A0x762539b45a1dcce3d36d080f74d1aed37844b878%2Cethereum%3A0xdB25f211AB05b1c97D595516F45794528a807ad8' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "coins": {
    "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
      "confidence": 0.99,
      "decimals": 8,
      "price": 0.022053735051098835,
      "symbol": "cDAI",
      "timestamp": 1648680149
    }
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### What unit should timestamp use?
Pass timestamp as a numeric UNIX timestamp in seconds (for example, 1648680149).

### Can I query multiple tokens at the same timestamp?
Yes. Pass a comma-separated list of {chain}:{address} or coingecko:{id} keys in the coins path parameter.

### What if I need different timestamps for different tokens?
Use the DefiLlama Batch Token Prices API, which accepts a per-coin array of timestamps.

### Why might the returned timestamp differ slightly from my request?
DefiLlama returns the closest available indexed observation and reports its exact UNIX timestamp.

### How do I find the earliest available timestamp for a token?
Query the DefiLlama First Token Prices API to see the earliest indexed price timestamp.

### Does this endpoint return a full price series?
No. It returns a single point-in-time quote per token; use the Token Price Chart API for time intervals.

## Available implementations
- defillama: https://openany.si/defillama/defillama-get-historical-prices-of-tokens-by-contract-address/fe0409df-c5bb-473a-9914-5bf9fc6abf8b/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
