{"data":{"billing":{"currency":"USD","mode":"fixed","priceMicroUsd":"0","rounding":null,"unit":"call","unitQuantity":null},"capabilityId":"8c533cf4-c9e5-442c-8c16-219df298dbaa","catalogType":"api","categories":["data","finance","crypto-defi"],"dataPlatform":"DefiLlama","dataPlatformLogoUrl":"https://api-docs.defillama.com/icons/favicon-96x96.png","dataPlatformTranslations":{"ar":"DefiLlama","ja":"DefiLlama","zh":"DefiLlama"},"dataProduct":"prices","description":"Get DefiLlama Batch Token Prices data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by DeFiLlama, pass parameters such as coins, and retrieve structured data including coins, \u003ccoin\u003e, token ticker symbol, prices, and confidence for compute transaction cost basis, backtest multi-asset strategies, and reduce request fan-out, ready for production pipelines and AI agent automation.","descriptionTranslations":{"ar":"استرجع الأسعار التاريخية لعدة رموز عند طوابع زمنية مختلفة في طلب واحد عبر OpenAny REST لتسريع الاختبار الرجعي والمحاسبة. مرر كائن JSON يربط كل معرف رمز بمصفوفة طوابع زمنية للحصول على الأسعار ودرجات الثقة.","ja":"OpenAny REST の1回のリクエストで複数トークンの異なる UNIX タイムスタンプ時点の過去価格を一括取得し、バックテストや損益計算を効率化できます。チェーン・アドレスと時刻配列の JSON マップを渡すと価格・信頼度配列を返します。","zh":"通过 OpenAny REST 在单次请求中批量查询多个代币在不同 UNIX 时间戳的历史价格，加速组合回测、交易记账与税务成本核算。传入将链与合约地址映射到时间戳数组的 JSON 对象，即可返回各代币的价格、时间戳与置信度列表。"},"effectContentHtml":"","executionMode":"sync","id":"162f157b-d226-47e3-add2-04a1e0ffe283","includedContentHtml":"","inputs":[{"description":"object where keys are coins in the form {chain}:{address}, and values are arrays of requested timestamps","location":"query","name":"coins","nullable":false,"required":true,"type":"string"}],"logoUrl":"https://api-docs.defillama.com/icons/favicon-96x96.png","method":"GET","name":"DefiLlama — Get historical prices for multiple tokens at multiple different timestamps","nameTranslations":{"ar":"DefiLlama — الحصول على الأسعار التاريخية لعدة رموز في عدة طوابع زمنية مختلفة","ja":"DefiLlama — 複数の異なるタイムスタンプにおける複数トークンの履歴価格を取得","zh":"DefiLlama — 获取多个代币在多个不同时间戳的历史价格"},"overviewHtml":"\u003ch2\u003eDefiLlama Batch Token Prices API\u003c/h2\u003e\n\u003cp\u003eSend a URL-encoded JSON string in the required \u003ccode\u003ecoins\u003c/code\u003e query parameter where each key is \u003ccode\u003e{chain}:{address}\u003c/code\u003e (or \u003ccode\u003ecoingecko:{id}\u003c/code\u003e) and each value is an array of UNIX timestamps. The response returns per-coin \u003ccode\u003esymbol\u003c/code\u003e and \u003ccode\u003eprices[]\u003c/code\u003e entries.\u003c/p\u003e\n\u003ch2\u003eQuick Facts\u003c/h2\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eFact\u003c/th\u003e\n\u003cth\u003eValue\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eAccess\u003c/td\u003e\n\u003ctd\u003eOpenAny REST\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAuthentication\u003c/td\u003e\n\u003ctd\u003eOpenAny API key in the Authorization header\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCore inputs\u003c/td\u003e\n\u003ctd\u003eRequired query parameter: coins (JSON string mapping {chain}:{address} keys to arrays of UNIX timestamps).\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eSelected implementation\u003c/td\u003e\n\u003ctd\u003edefillama · DefiLlama — Get historical prices for multiple tokens at multiple different timestamps\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eBilling\u003c/td\u003e\n\u003ctd\u003eSee the pricing area for the selected implementation and request options\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003ch2\u003eWhat You Can Build\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eCompute transaction cost basis\u003c/strong\u003e: Price dozens of historical swaps at their exact block timestamps in one API call.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eBacktest multi-asset strategies\u003c/strong\u003e: Retrieve aligned or staggered historical quotes across Avalanche, Ethereum and CoinGecko IDs.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eReduce request fan-out\u003c/strong\u003e: Replace loops of single-timestamp historical lookups with one batched query.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2\u003eReturned Data\u003c/h2\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eField\u003c/th\u003e\n\u003cth\u003eMeaning\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003ecoins\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eMap of requested token identifiers to historical price bundles\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003ecoins.\u0026lt;coin\u0026gt;\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eHistorical price bundle keyed by {chain}:{address}\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003ecoins.\u0026lt;coin\u0026gt;.symbol\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eToken ticker symbol\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003ecoins.\u0026lt;coin\u0026gt;.prices\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eArray of matched historical price observations\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003ecoins.\u0026lt;coin\u0026gt;.prices[].timestamp\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eUNIX timestamp of the returned price point\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003ecoins.\u0026lt;coin\u0026gt;.prices[].price\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eHistorical token price in USD\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003ecoins.\u0026lt;coin\u0026gt;.prices[].confidence\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eConfidence score for the historical price quote\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003ch2\u003eQuick Start\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eSet OPENANY_API_KEY to your OpenAny API key.\u003c/li\u003e\n\u003cli\u003eReview the selected implementation and pricing, then adapt the request below to your target.\u003c/li\u003e\n\u003cli\u003eCheck the HTTP response and business result before reading optional fields.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003e\u003ccode class=\"language-bash\"\u003ecurl --request GET --get \\\n  https://api.openany.si/v1/agent-apis/defillama/batchHistorical \\\n  -H \u0026#34;Authorization: Bearer ${OPENANY_API_KEY}\u0026#34; \\\n  --data-urlencode \u0026#39;coins={\u0026#34;avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e\u0026#34;: [1666876743, 1666862343], \u0026#34;coingecko:ethereum\u0026#34;: [1666869543, 1666862343]}\n\u0026#39;\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch2\u003eRequest and Response Examples\u003c/h2\u003e\n\u003cp\u003eThe response example is a documentation reference and may be abbreviated. The documented request is a calling template; use the published contract and returned response for the selected implementation.\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://openany.si/api/v1/agent-apis/162f157b-d226-47e3-add2-04a1e0ffe283\"\u003ePublished DefiLlama Batch Token Prices API implementation contract\u003c/a\u003e.\u003c/p\u003e\n\u003ch2\u003ePricing and Billing\u003c/h2\u003e\n\u003cp\u003eThe pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service\u0026#39;s public availability does not determine OpenAny billing.\u003c/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c/h2\u003e\n\u003ch3\u003eHow should I format the coins query parameter?\u003c/h3\u003e\n\u003cp\u003ePass a JSON object string where keys are {chain}:{address} (or coingecko:{id}) and values are arrays of UNIX timestamps.\u003c/p\u003e\n\u003ch3\u003eDo all tokens in one batch need the same timestamps?\u003c/h3\u003e\n\u003cp\u003eNo. Each token key can specify its own array of UNIX timestamps.\u003c/p\u003e\n\u003ch3\u003eWhat fields are inside each prices array entry?\u003c/h3\u003e\n\u003cp\u003eEach entry contains timestamp, price (USD) and confidence.\u003c/p\u003e\n\u003ch3\u003eCan I mix on-chain contract addresses and CoinGecko IDs?\u003c/h3\u003e\n\u003cp\u003eYes. The reference request combines an Avalanche contract address with coingecko:ethereum.\u003c/p\u003e\n\u003ch3\u003eWhen should I use this instead of Historical Token Prices?\u003c/h3\u003e\n\u003cp\u003eUse Batch Token Prices when you need multiple different timestamps per call; use Historical Token Prices for one shared timestamp.\u003c/p\u003e\n\u003ch3\u003eWhen should I use Token Price Chart instead?\u003c/h3\u003e\n\u003cp\u003eUse the DefiLlama Token Price Chart API when you want evenly spaced interval series defined by start, end, span and period.\u003c/p\u003e\n\u003ch2\u003eRelated APIs\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/defillama/defillama-get-historical-prices-of-tokens-by-contract-address\"\u003eDefiLlama Historical Token Prices API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/defillama/defillama-get-token-prices-at-regular-time-intervals\"\u003eDefiLlama Token Price Chart API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/defillama/defillama-get-current-prices-of-tokens-by-contract-address\"\u003eDefiLlama Current Token Prices API\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","pagePath":"/markets/apis/defillama/defillama-get-historical-prices-for-multiple-tokens-at-multiple-different-timestamps?offering=162f157b-d226-47e3-add2-04a1e0ffe283","providerId":"defillama","publicPath":"/v1/agent-apis/defillama/batchHistorical","requestContentType":"none","revision":5,"samples":[{"http_status":200,"name":"Official UI example (not runtime verified)","request":{"body":null,"headers":{},"path":{},"query":{"coins":"{\"avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e\": [1666876743, 1666862343], \"coingecko:ethereum\": [1666869543, 1666862343]}\n"}},"response_body":{"coins":{"avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e":{"prices":[{"confidence":0.99,"price":0.999436,"timestamp":1666876674}],"symbol":"USDC"}}}}],"seoDescription":"Get DefiLlama Batch Token Prices data via REST or MCP powered by DeFiLlama. Pay per call, no subscription. Built to compute transaction cost basis.","updatedAt":"2026-12-03T02:39:11.946Z","usageInstructionsHtml":""}}