# DeFiLlama API — $0.0003 per chain

> DeFiLlama API: Total value locked per blockchain — DeFiLlama data, keyless. $0.0003 per delivered chain, nothing delivered means nothing charged.

[Home](https://quanticdata.io/)/[Collectors](https://quanticdata.io/collectors/)/*DeFiLlama API*

# 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.

[Get my free API key](https://app.quanticdata.io/register) [See the request](/collectors/defillama-api/#integration)

$0.0003 per delivered chain · $2 free every month · Failed runs never billed

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
```

**$0.0003 / chain**6,666 chains on the free $2 every month

**Semantic input**chains, max_results — no URL lists

**Up to 200**chains per run, pagination handled for you

**No browser**read over HTTP/TLS — cheaper and faster than rendering

On this page: [What it is](/collectors/defillama-api/#what) [Output fields](/collectors/defillama-api/#output) [Inputs](/collectors/defillama-api/#input) [Pricing](/collectors/defillama-api/#pricing) [Integration](/collectors/defillama-api/#integration) [Use cases](/collectors/defillama-api/#use-cases) [Versus the alternatives](/collectors/defillama-api/#compare) [FAQ](/collectors/defillama-api/#faq)

## 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.

Input is meaning, not a URL *chains* *max_results*

## 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.

**$0.0003**per delivered chain*$0.3 per 1,000 delivered chains*

**6,666 chains**on the free allowance*$2 every month, no card*

**Zero rows**zero charge*blocks, captchas and retries are on us*

**−30%**on volume tiers*the catalog returns your key's price*

### Pay as you go

$0/mo

- $2 free credit / month

- 60 requests / min

- List unit prices

### Starter

$19/mo

- $15 free credit / month

- 300 requests / min

- 10% off unit prices

Most popular

### Growth

$79/mo

- $50 free credit / month

- 600 requests / min

- 20% off unit prices

### Scale

$299/mo

- $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](https://quanticdata.io/web-data-api-for-ai/). 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/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}'
```

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/scraper/collectors/defillama/run",
    headers={"Authorization": f"Bearer {QD_API_KEY}"},
    json={
        "max_results": 50
    },
    timeout=120,
)
for row in r.json()["payload"]["results"]:
    print(row)
```

```
const res = await fetch(
  "https://api.quanticdata.io/v1/scraper/collectors/defillama/run",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.QD_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({"max_results":50}),
  },
);
const { payload } = await res.json();
console.table(payload.results);
```

```
claude mcp add quantumproxies \
  -e QUANTUMPROXIES_API_KEY=qd_live_your_key_here \
  -- npx -y quantumproxies-mcp

# then, in the chat:
> run the defillama collector with 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 |

## FAQ

Questions we get about the DeFiLlama API.

[Something else? Ask us →](mailto:hello@quanticdata.io)

### 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`.

[Get my free API key](https://app.quanticdata.io/register)

Related: [All 65 collectors](https://quanticdata.io/collectors/) [Crypto market data API](https://quanticdata.io/collectors/crypto-market-data-api/) [Stock Data API](https://quanticdata.io/collectors/stock-data-api/) [SEC EDGAR API](https://quanticdata.io/collectors/sec-edgar-api/) [Documentation](https://quanticdata.io/docs/)

---

Source: https://quanticdata.io/collectors/defillama-api/ · Site index for AI: https://quanticdata.io/llms.txt
