# DefiLlama Free API (no API key) > Free API, for users with no API key. Each endpoint lists its free base URL and, under it, the URL to use with a key. ## Have an API key? Use pro-api.llama.fi for every request If you or your user has a DefiLlama API key, whatever the plan is called ("API plan", "Pro", "pro API"), send every request to `https://pro-api.llama.fi/{YOUR_API_KEY}/...`. That includes TVL, prices, stablecoins, yields, volumes and fees, and any fallback or secondary lookup. Use the free hosts only when there is no key. ``` RIGHT https://pro-api.llama.fi/{YOUR_API_KEY}/coins/prices/current/coingecko:ethereum WRONG https://coins.llama.fi/prices/current/coingecko:ethereum (free host: ignores the key, rate limited) WRONG https://pro-api.llama.fi/coins/prices/current/coingecko:ethereum?apikey={YOUR_API_KEY} (key not in the path) ``` - The free hosts (`api.llama.fi`, `coins.llama.fi`, `stablecoins.llama.fi`, `yields.llama.fi`) never read a key, so a 429 there means the request belongs on pro-api.llama.fi. A 402 there means the endpoint needs pro-api, not that the plan expired. - The key goes in the path, right after the host. Headers and `?apikey=` are not read: pro-api answers `500 {"error":"API Key is wrong"}`. - Paths on pro-api have a prefix: `/protocols` becomes `/api/protocols`, `/prices/current/{coins}` becomes `/coins/prices/current/{coins}`, `/stablecoins` becomes `/stablecoins/stablecoins`, `/pools` becomes `/yields/v1/pools`. Every free path is mapped in [llms.txt](https://api-docs.defillama.com/llms.txt), and the pro-only endpoints are in [llms-pro.txt](https://api-docs.defillama.com/llms-pro.txt). - One key unlocks every endpoint. There are no add-ons or separate keys. - To check a key, call `https://pro-api.llama.fi/usage/{YOUR_API_KEY}` (key at the end, for this endpoint only). It returns `{"creditsLeft": ...}`. A 200 from a free host proves nothing, those endpoints need no key. **Base URL for endpoints below:** `https://api.llama.fi` (unless an endpoint lists its own) ## TVL ### GET /protocols **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/protocols` List all protocols on defillama along with their tvl Returns: array of {id, name, symbol, category, chains, tvl, chainTvls, change_1d, change_7d} ### GET /protocol/{protocol} **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/protocol/{protocol}` Get historical TVL of a protocol and breakdowns by token and chain **Parameters:** - `protocol` (path, string, required) — protocol slug Example: `aave` Returns: {id, name, symbol, category, chains, currentChainTvls, chainTvls} ### GET /v2/historicalChainTvl **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/v2/historicalChainTvl` Get historical TVL (excludes liquid staking and double counted tvl) of DeFi on all chains Returns: array of {date, tvl} ### GET /v2/historicalChainTvl/{chain} **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/v2/historicalChainTvl/{chain}` Get historical TVL (excludes liquid staking and double counted tvl) of a chain **Parameters:** - `chain` (path, string, required) — chain slug, you can get these from /chains or the chains property on /protocols Example: `Ethereum` Returns: array of {date, tvl} ### GET /tvl/{protocol} **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/tvl/{protocol}` Simplified endpoint to get current TVL of a protocol **Parameters:** - `protocol` (path, string, required) — protocol slug Example: `uniswap` Returns: number ### GET /v2/chains **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/v2/chains` Get current TVL of all chains Returns: array of {gecko_id, tvl, tokenSymbol, cmcId, name, chainId} --- ## Coins & Prices ### GET /prices/current/{coins} **Base URL:** `https://coins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/coins/prices/current/{coins}` Get current prices of tokens by contract address **Parameters:** - `coins` (path, string, required) — set of comma-separated tokens defined as {chain}:{address} Example: `ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8` Returns: {coins} ### GET /prices/historical/{timestamp}/{coins} **Base URL:** `https://coins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/coins/prices/historical/{timestamp}/{coins}` Get historical prices of tokens by contract address **Parameters:** - `coins` (path, string, required) — set of comma-separated tokens defined as {chain}:{address} Example: `ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8` - `timestamp` (path, number, required) — UNIX timestamp of time when you want historical prices Example: `1648680149` Returns: {coins} ### GET /batchHistorical **Base URL:** `https://coins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/coins/batchHistorical` Get historical prices for multiple tokens at multiple different timestamps **Parameters:** - `coins` (query, string, required) — object where keys are coins in the form {chain}:{address}, and values are arrays of requested timestamps Example: `{"avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e": [1666876743, 1666862343], "coingecko:ethereum": [1666869543, 1666862343]} ` Returns: {coins} ### GET /chart/{coins} **Base URL:** `https://coins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/coins/chart/{coins}` Get token prices at regular time intervals **Parameters:** - `coins` (path, string, required) — set of comma-separated tokens defined as {chain}:{address} Example: `ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8` - `start` (query, number, optional) — unix timestamp of earliest data point requested Example: `1664364537` - `end` (query, number, optional) — unix timestamp of latest data point requested - `span` (query, number, optional) — number of data points returned, defaults to 0 Example: `10` - `period` (query, string, optional) — duration between data points, defaults to 24 hours Example: `2d` Returns: {coins} ### GET /percentage/{coins} **Base URL:** `https://coins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/coins/percentage/{coins}` Get percentage change in price over time **Parameters:** - `coins` (path, string, required) — set of comma-separated tokens defined as {chain}:{address} Example: `ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8` - `timestamp` (query, number, optional) — timestamp of data point requested, defaults to time now Example: `1664364537` - `lookForward` (query, boolean, optional) — whether you want the duration after your given timestamp or not, defaults to false (looking back) Example: `false` - `period` (query, string, optional) — duration between data points, defaults to 24 hours Example: `3w` Returns: {coins} ### GET /prices/first/{coins} **Base URL:** `https://coins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/coins/prices/first/{coins}` Get earliest timestamp price record for coins **Parameters:** - `coins` (path, string, required) — set of comma-separated tokens defined as {chain}:{address} Example: `ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8` Returns: {coins} ### GET /block/{chain}/{timestamp} **Base URL:** `https://coins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/coins/block/{chain}/{timestamp}` Get the closest block to a timestamp **Parameters:** - `chain` (path, string, required) — Chain which you want to get the block from Example: `ethereum` - `timestamp` (path, integer, required) — UNIX timestamp of the block you are searching for Example: `1603964988` Returns: {height, timestamp} --- ## Stablecoins ### GET /stablecoins **Base URL:** `https://stablecoins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/stablecoins/stablecoins` List all stablecoins along with their circulating amounts **Parameters:** - `includePrices` (query, boolean, optional) — set whether to include current stablecoin prices Example: `true` Returns: {peggedAssets} **Response:** `peggedAssets[]`. Each asset's supply is nested in `circulating` under its `pegType`: `circulating.peggedUSD` for USD-pegged coins, `circulating.peggedEUR` for EURC, and so on. Read `circulating[asset.pegType]`. `price` is the USD price of one coin, or `null` when there is no quote (many assets). Compute the USD value as `circulating[asset.pegType] * price` only when `price` is a number. Otherwise the USD value is unavailable, not zero. ### GET /stablecoincharts/all **Base URL:** `https://stablecoins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/stablecoins/stablecoincharts/all` Get historical mcap sum of all stablecoins **Parameters:** - `stablecoin` (query, integer, optional) — stablecoin ID, you can get these from /stablecoins Example: `1` Returns: array of {date, totalCirculating} ### GET /stablecoincharts/{chain} **Base URL:** `https://stablecoins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/stablecoins/stablecoincharts/{chain}` Get historical mcap sum of all stablecoins in a chain **Parameters:** - `chain` (path, string, required) — chain slug, you can get these from /chains or the chains property on /protocols Example: `Ethereum` - `stablecoin` (query, integer, optional) — stablecoin ID, you can get these from /stablecoins Example: `1` Returns: array of {date, totalCirculating} ### GET /stablecoin/{asset} **Base URL:** `https://stablecoins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/stablecoins/stablecoin/{asset}` Get historical mcap and historical chain distribution of a stablecoin **Parameters:** - `asset` (path, integer, required) — stablecoin ID, you can get these from /stablecoins Example: `1` Returns: {id, name, symbol, totalCirculating, chainCirculating} ### GET /stablecoinchains **Base URL:** `https://stablecoins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/stablecoins/stablecoinchains` Get current mcap sum of all stablecoins on each chain Returns: array of {name, totalCirculatingUSD} ### GET /stablecoinprices **Base URL:** `https://stablecoins.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/stablecoins/stablecoinprices` Get historical prices of all stablecoins Returns: array of {date, prices} --- ## Yields & APY ### GET /pools **Base URL:** `https://yields.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/yields/v1/pools` Retrieve the latest data for all pools, including enriched information such as predictions Returns: {status, data} ### GET /chart/{pool} **Base URL:** `https://yields.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/yields/v1/chart/{pool}` Get historical APY and TVL of a pool **Parameters:** - `pool` (path, string, required) — pool id, can be retrieved from /pools (property is called pool) Example: `747c1d2a-c668-4682-b9f9-296708a3dd90` Returns: {status, data} --- ## DEX Volumes ### GET /overview/dexs **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/overview/dexs` List all dexs along with summaries of their volumes and dataType history data **Parameters:** - `excludeTotalDataChart` (query, boolean, required) — true to exclude aggregated chart from response Example: `true` - `excludeTotalDataChartBreakdown` (query, boolean, required) — true to exclude broken down chart from response Example: `true` Returns: {protocols, totalDataChart, allChains} ### GET /overview/dexs/{chain} **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/overview/dexs/{chain}` List all dexs along with summaries of their volumes and dataType history data filtering by chain **Parameters:** - `chain` (path, string, required) — chain name, list of all supported chains can be found under allChains attribute in /overview/dexs response Example: `ethereum` - `excludeTotalDataChart` (query, boolean, required) — true to exclude aggregated chart from response Example: `true` - `excludeTotalDataChartBreakdown` (query, boolean, required) — true to exclude broken down chart from response Example: `true` Returns: {protocols, totalDataChart} ### GET /summary/dexs/{protocol} **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/summary/dexs/{protocol}` Get summary of dex volume with historical data **Parameters:** - `protocol` (path, string, required) — protocol slug Example: `uniswap` - `excludeTotalDataChart` (query, boolean, required) — true to exclude aggregated chart from response Example: `true` - `excludeTotalDataChartBreakdown` (query, boolean, required) — true to exclude broken down chart from response Example: `true` Returns: {name, total24h, totalAllTime, totalDataChart, totalDataChartBreakdown, chains} ### GET /overview/options **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/overview/options` List all options dexs along with summaries of their volumes and dataType history data **Parameters:** - `excludeTotalDataChart` (query, boolean, required) — true to exclude aggregated chart from response Example: `true` - `excludeTotalDataChartBreakdown` (query, boolean, required) — true to exclude broken down chart from response Example: `true` - `dataType` (query, string, optional) — Desired data type, dailyNotionalVolume by default. (one of: dailyPremiumVolume, dailyNotionalVolume) Example: `dailyPremiumVolume` Returns: {protocols, totalDataChart} ### GET /overview/options/{chain} **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/overview/options/{chain}` List all options dexs along with summaries of their volumes and dataType history data filtering by chain **Parameters:** - `chain` (path, string, required) — chain name, list of all supported chains can be found under allChains attribute in /overview/options response Example: `ethereum` - `excludeTotalDataChart` (query, boolean, required) — true to exclude aggregated chart from response Example: `true` - `excludeTotalDataChartBreakdown` (query, boolean, required) — true to exclude broken down chart from response Example: `true` - `dataType` (query, string, optional) — Desired data type, dailyNotionalVolume by default. (one of: dailyPremiumVolume, dailyNotionalVolume) Example: `dailyPremiumVolume` Returns: {totalDataChart, totalDataChartBreakdown, breakdown24h, breakdown30d, chain, allChains, total24h, total48hto24h, total7d, total14dto7d, total60dto30d, total30d, total1y, change_1d, change_7d, change_1m, change_7dover7d, change_30dover30d, total7DaysAgo, total30DaysAgo, totalAllTime, protocols} ### GET /summary/options/{protocol} **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/summary/options/{protocol}` Get summary of options dex volume with historical data **Parameters:** - `protocol` (path, string, required) — protocol slug Example: `derive` - `dataType` (query, string, optional) — Desired data type, dailyNotionalVolume by default. (one of: dailyPremiumVolume, dailyNotionalVolume) Example: `dailyPremiumVolume` Returns: {id, name, url, description, logo, gecko_id, cmcId, chains, twitter, governanceID, github, treasury, symbol, address, childProtocols, linkedProtocols, defillamaId, disabled, displayName, module, category, methodologyURL, methodology, forkedFrom, audits, audit_links, versionKey, parentProtocol, previousNames, slug, protocolType, total24h, total48hto24h, total7d, totalAllTime, totalDataChart, totalDataChartBreakdown, change_1d} --- ## Perpetuals & Open Interest ### GET /overview/open-interest **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/overview/open-interest` List all open interest dex exchanges along with summaries of their open interest **Parameters:** - `excludeTotalDataChart` (query, boolean, required) — true to exclude aggregated chart from response Example: `true` - `excludeTotalDataChartBreakdown` (query, boolean, required) — true to exclude broken down chart from response Example: `true` Returns: {protocols, totalDataChart, allChains} --- ## Fees & Revenue ### GET /overview/fees **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/overview/fees` List all protocols along with summaries of their fees and revenue and dataType history data **Parameters:** - `excludeTotalDataChart` (query, boolean, required) — true to exclude aggregated chart from response Example: `true` - `excludeTotalDataChartBreakdown` (query, boolean, required) — true to exclude broken down chart from response Example: `true` - `dataType` (query, string, optional) — Desired data type, dailyFees by default. (one of: dailyFees, dailyRevenue, dailyHoldersRevenue) Example: `dailyFees` Returns: {protocols, totalDataChart, totalDataChartBreakdown} ### GET /overview/fees/{chain} **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/overview/fees/{chain}` List all protocols along with summaries of their fees and revenue and dataType history data by chain **Parameters:** - `chain` (path, string, required) — chain name, list of all supported chains can be found under allChains attribute in /overview/fees response Example: `ethereum` - `excludeTotalDataChart` (query, boolean, required) — true to exclude aggregated chart from response Example: `true` - `excludeTotalDataChartBreakdown` (query, boolean, required) — true to exclude broken down chart from response Example: `true` - `dataType` (query, string, optional) — Desired data type, dailyFees by default. (one of: dailyFees, dailyRevenue, dailyHoldersRevenue) Example: `dailyFees` Returns: {protocols, totalDataChart, totalDataChartBreakdown} ### GET /summary/fees/{protocol} **Base URL:** `https://api.llama.fi` **With an API key:** `https://pro-api.llama.fi/{YOUR_API_KEY}/api/summary/fees/{protocol}` Get summary of protocol fees and revenue with historical data **Parameters:** - `protocol` (path, string, required) — protocol slug Example: `derive` - `dataType` (query, string, optional) — Desired data type, dailyFees by default. (one of: dailyFees, dailyRevenue, dailyHoldersRevenue) Example: `dailyFees` Returns: {id, name, url, referralUrl, description, logo, gecko_id, cmcId, chains, twitter, github, symbol, address, childProtocols, linkedProtocols, defillamaId, disabled, displayName, module, category, methodologyURL, methodology, forkedFrom, audits, audit_links, versionKey, governanceID, treasury, parentProtocol, previousNames, slug, protocolType, total24h, total48hto24h, total7d, totalAllTime, change_1d, totalDataChart, totalDataChartBreakdown}