DeFiLlama API
DeFiLlama publishes total value locked for every chain it tracks, but its free surface answers exactly one question — how much value sits on each blockchain right now — while history and the protocol breakdown sit behind a paid Pro key. This endpoint reads that free chains surface and returns one row per blockchain: current TVL in USD, the native token symbol and the CoinGecko and CoinMarketCap ids you need to join it against price feeds.
$0.0003 per delivered chain · $2 free every month · Failed runs never billed
$ curl $QD/defillama/run \
-H "Authorization: Bearer $QD_API_KEY" \
-d '{"max_results": 50}'
{ "status": "done", "count": 50,
"results": [
{
"chain": "…",
"tvl": …,
"token_symbol": "…",
"chain_id": … } ],
"cost": 0.015 }
# 50 chains × $0.0003 · nothing delivered, nothing charged
What a DeFiLlama API does
The chains endpoint is a ranking: every blockchain DeFiLlama covers, sorted by the dollar value locked in its DeFi protocols, or filtered to just the chains you name. Each row is already numeric — TVL as an integer, not a formatted string — and carries the gecko_id and cmc_id, the keys that let you put TVL next to a token's price without a fuzzy name match.
What this deliberately does not do is history or per-protocol detail: DeFiLlama gates the time series and the full protocol list behind Pro, so a page promising "TVL over time" from the free surface would be promising data that is not there. This returns the current, keyless snapshot honestly — the cross-chain league table — which is the part most datasets actually need as a daily column.
What one chain looks like
Every delivered chain carries these fields. Nullable means the source did not publish it — the field stays empty instead of being guessed.
| Field | Type | What it holds |
|---|---|---|
rank | integer | TVL rank. |
chain | string | Blockchain name. |
tvl | integer | Total value locked, USD. |
token_symbol | string · nullable | Native token symbol. |
chain_id | integer · nullable | EVM chain id when applicable. |
gecko_id | string · nullable | CoinGecko id (join key). |
cmc_id | string · nullable | CoinMarketCap id. |
Inputs
The whole request. Anything you leave out falls back to the default shown in the catalog.
| Input | Type | Required | What it does |
|---|---|---|---|
chains | array | no | Filter to specific chains (Ethereum, Solana…). Empty = all, ranked by TVL. |
max_results | integer | no | How many chains to deliver at most (1–200). You pay only for delivered chains. |
Pricing
DeFiLlama API pricing
$0.0003 per delivered chain. A run that delivers nothing costs nothing: blocked pages, challenges and retries are on us, and the $2 monthly allowance covers about 6,666 chains before you spend anything.
Pay as you go
- $2 free credit / month
- 60 requests / min
- List unit prices
Starter
- $15 free credit / month
- 300 requests / min
- 10% off unit prices
Growth
- $50 free credit / month
- 600 requests / min
- 20% off unit prices
Scale
- $250 free credit / month
- 1,200 requests / min
- 30% off unit prices
Same wallet, same key and same $2 monthly allowance as every other Data API. Prices are launch pricing read live from the billing config — GET /v1/scraper/collectors returns the price your key actually pays.
Integration
One POST, typed rows
Base URL https://api.quanticdata.io/v1, Bearer auth, the same key as every other Data API. Endpoint: POST /v1/.
curl -X POST https://api.quanticdata.io/v1/scraper/collectors/defillama/run \
-H "Authorization: Bearer $QD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"max_results":50}'
What people build with the DeFiLlama API
Three shapes of work this endpoint was designed around.
Cross-chain dashboards
Pull every chain ranked by TVL once a day and you have the table that shows where liquidity is concentrating, as rows rather than a scraped leaderboard.
Price-joined crypto datasets
The gecko_id on each row joins TVL straight onto CoinGecko price data, so value locked and token price live in the same table.
Chain watchlists
Name the chains you model — Ethereum, Solana, Arbitrum — and track just their TVL, skipping the long tail you do not care about.
DeFiLlama API versus rolling your own
The differences that actually cost time when you build this in-house.
| DIY scraper | This collector | |
|---|---|---|
| Scope | History and protocols need Pro | The free chains surface, returned honestly |
| TVL value | A formatted string to parse | An integer in USD, ready to sum |
| Price join | Match token names by hand | gecko_id and cmc_id on every row |
Does this return TVL history or just the current value?
Current value only. DeFiLlama keeps historical time series behind its paid Pro key, so this reads the free chains endpoint and returns the TVL as it stands now, one row per chain. For a trend you sample it on a schedule and keep the snapshots yourself.
Can I get per-protocol TVL, like a single DEX?
No — the free surface is per chain, not per protocol. This returns the value locked across each blockchain; the protocol-level breakdown is part of what DeFiLlama gates behind Pro, so it is honestly out of scope here rather than half-delivered.
Do I need a DeFiLlama Pro API key?
No. The chains surface this reads is keyless, which is the whole point — you get the cross-chain TVL table without holding a Pro key or its rate budget.
How do I line TVL up with token prices?
Use the join keys on each row: gecko_id maps to CoinGecko and cmc_id to CoinMarketCap, so you attach price data by id instead of by matching chain names.
Is there a free DeFiLlama API?
Every account gets $2 of credit every month with no card, which is about 6,666 delivered chains on this endpoint at $0.0003 each. It renews monthly, and a run that delivers nothing is never billed — so a failed or blocked attempt does not eat the allowance.
How much does one run cost?
Multiply the rows you actually receive by $0.0003. A run capped at 200 chains — the maximum for this collector — costs $0.06 if every row comes back, and less when the source has fewer. Volume tiers take up to 30% off, and GET /v1/scraper/collectors returns the price your key actually pays.
Run the DeFiLlama API now
$2 of free credit every month, no card. Your key returns its own prices from GET /v1/scraper/collectors.