Documentation Python quickstart Blog Free tools Enterprise solutions hello@quanticdata.ioLog in
All collectors

DeFiLlama API

Finance & crypto · v1.1.0 · defillama

$0.0003 / chain

$0.30 / 1K · pay per delivered chain

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

What it does

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.

Inputs

The whole request. Anything you leave out falls back to the default shown in the catalog.

InputTypeRequiredWhat it does
chainsarraynoFilter to specific chains (Ethereum, Solana…). Empty = all, ranked by TVL.
max_resultsintegernoHow many chains to deliver at most (1–200). You pay only for delivered chains.

Outputs — 9 fields, one row per chain

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.

FieldTypeWhat it holds
rankintegerTVL rank.
chainstringBlockchain name.
tvlintegerTotal value locked, USD.
token_symbolstring · nullableNative token symbol.
chain_idinteger · nullableEVM chain id when applicable.
gecko_idstring · nullableCoinGecko id (join key).
cmc_idstring · nullableCoinMarketCap id.
tvl_rankintegerRank by TVL across every chain, also on a filtered run.
tvl_share_pctnumber · nullableShare of the total TVL of all chains, %.

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/scraper/collectors/defillama/run.

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}'

Example response

POST /v1/scraper/collectors/defillama/run
$ 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

Try it

DeFi TVL (DeFiLlama), running now

Change the input and run it against the live collector — nothing to install, no sign-up.

Run it from your own code, on your own inputs

Same collector, same rows — $2 of free API credit every month, no card.

Get my free API key
DeFiLlama API: from chains, QuanticData reads the DeFiLlama chain list and returns one row per chain with chain, tvl and token_symbol, at $0.0003 per delivered chain.
You send chains and max_results; the run reads the source and comes back as chains with rank, chain and tvl — 9 fields on every row — and you are billed $0.0003 for each chain actually delivered, nothing for a run that delivers none.
$0.0003 / chain6,666 chains on the free $2 every month
Semantic inputchains, max_results — no URL lists
Up to 200chains per run, pagination handled for you
No browserread over HTTP/TLS — cheaper and faster than rendering

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.

$0.0003per delivered chain$0.3 per 1,000 delivered chains
6,666 chainson the free allowance$2 every month, no card
Zero rowszero chargeblocks, captchas and retries are on us
−30%on volume tiersthe catalog returns your key's price

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.

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 scraperThis collector
ScopeHistory and protocols need ProThe free chains surface, returned honestly
TVL valueA formatted string to parseAn integer in USD, ready to sum
Price joinMatch token names by handgecko_id and cmc_id on every row

What people search for

Live autocomplete demand around DeFi TVL (DeFiLlama), pulled with our own Keyword ideas collector.

DeFiLlama API: the POST to the defillama collector, 50 chains delivered and the bill, 50 × $0.0003 = $0.015 in usage.cost_usd; zero chains would cost $0.
The same call you would paste into a terminal: a Bearer key, chains in the body, and back the envelope every QuanticData endpoint returns — type, message, payload — where count is how many chains arrived and usage.cost_usd is $0.015, which is 50 × $0.0003. A run that delivers nothing costs nothing. The key is good for 60 req/min on the free tier.

Sources and standards

The platform documentation and standards this collector is built against — check any claim on this page against the primary source:

FAQ

Questions we get about the DeFiLlama API.

Something else? Ask us

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.

Run in dashboard
Illustration: three coloured zones of the page that is read (DeFiLlama chain list) turn into clean JSON with the fields chain, tvl and token_symbol; 9 fields on every row.