{"uid":"cap_PE5RYpxjsuw_bFbP2LCgQ","slug":"defillama-historical-token-prices-7676a5a3","name":"DefiLlama Historical Token Prices","description":"Historical token prices by DefiLlama — token price(s) at a given unix timestamp by chain:address or coingecko:id.","url":"https://defillama.use.x402atlas.com/prices-historical?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":["timestamp","coins"],"properties":{"coins":{"type":"string","pattern":"^[A-Za-z0-9:,_.-]+$","maxLength":3000,"minLength":1,"description":"Comma-separated coins as {chain}:{address} or coingecko:{id}"},"timestamp":{"type":"string","pattern":"^[0-9]{1,20}$","description":"Unix timestamp (seconds, digits only) to price the coins at"},"searchWidth":{"type":"string","maxLength":200,"description":"Optional time range to search for the price (e.g. 4h)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["queried_at","data"],"properties":{"data":{"type":"object","properties":{"coins":{"type":"object","description":"Map keyed by the requested coin id (e.g. coingecko:ethereum)","additionalProperties":{"type":"object","properties":{"price":{"type":"number","description":"USD price at the requested timestamp"},"symbol":{"type":"string"},"decimals":{"type":"integer"}}}}}},"queried_at":{"type":"string","format":"date-time","description":"Time the upstream was queried"}}}}}}},"responseSchema":{"type":"json","example":{"data":{"coins":{"coingecko:ethereum":{"price":3500,"symbol":"ETH","decimals":18}}},"queried_at":"2026-07-01T12:00:00Z"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":{"p10Cents":"0.5000","medianCents":"0.5000","p90Cents":"0.5000","minCents":"0.5000","maxCents":"0.5000","p95Cents":"0.5000","sampleCount":1,"varies":false,"failureChargeRate":1},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_77lD4cwM2bbAFwHP6XvrL","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns USD price(s) for one or many tokens at a specific historical unix timestamp, identified by chain:address or coingecko:id.","exampleAgentPrompt":"What was the price of ETH (ethereum:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2) and LINK (coingecko:chainlink) at unix timestamp 1672531200? Use a 4h search window.","exampleUseCases":null,"resultDescription":"A JSON object mapping each requested coin identifier to its historical USD price, symbol, and decimals at or near the requested unix timestamp.","failureModes":["Invalid or unrecognized coin identifier returns empty or partial results","Unix timestamp out of supported historical range returns no price data","Malformed coins parameter (wrong format) results in an error response","searchWidth too narrow with no price data in range returns empty result","Payment not processed results in 402 response before data is returned"],"whenToPreferThis":"Use this endpoint when you need token prices at a specific point in the past, rather than current prices. Prefer it over current-price endpoints for historical PnL calculations, backtesting, or auditing DeFi positions at a given block time. Supports both on-chain contract addresses (chain:address format) and CoinGecko IDs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:43:30.002Z","isFirstParty":false,"canonicalSlug":"defillama-historical-token-prices-7676a5a3"}