DefiLlama+API.SH

DefiLlama API

DefiLlama TVL, yield pools, fees, volumes, stablecoins and token prices as JSON.

The API.SH DefiLlama API returns DeFi data from DefiLlama as structured JSON. Rank protocols and chains by TVL, read one protocol's history, funding rounds and hacks, and scan yield pools with APY and TVL filters. It also covers fees and revenue, DEX, options, aggregator and bridge volumes, stablecoin supply and current or historical token prices.

  • 9 endpoints
  • from $1 / 1,000 calls
  • 1,000 free credits / month
  • failed calls free
DefiLlama chain TVL history
GET https://api.api.sh/defillama/v1/chain-tvl
{ "success": true }
1 credit · $1 per 1,000 calls

What you can build with the DefiLlama API

DeFi dashboards and research

Rank protocols by TVL, filter by chain or category and chart each protocol's daily TVL history.

Yield screening

Filter pools by chain, project, symbol, minimum TVL, minimum APY, stablecoin and impermanent-loss risk, then pull a pool's daily history.

Protocol revenue and fee analysis

Rank protocols by fees or revenue over 24 hours, 7 and 30 days or a year, by chain or category.

Trading volume tracking

Track DEX, options, aggregator and bridge volumes with changes over time to see where activity moves.

Token prices and stablecoin monitoring

Get current or historical USD prices by contract address or CoinGecko id, and follow stablecoin supply by chain.

Chain comparison

Rank every tracked chain by DeFi TVL with its native token and chain id, then compare TVL history.

DefiLlama data you get

Field names from real responses. Numbers come parsed, URLs absolute, dates in ISO 8601.

DefiLlama API endpoints and prices

Every DefiLlama endpoint costs 1 credit per call: credits are $1 per 1,000 on a monthly plan, $2 pay-as-you-go. Pricing

Posts and media1
DefiLlama chain TVL history
/defillama/v1/chain-tvl
$1 · $2 PAYG
1 credit
Products, listings and places1
DefiLlama token prices
/defillama/v1/prices
$1 · $2 PAYG
1 credit
More data7
DefiLlama chains
/defillama/v1/chains
$1 · $2 PAYG
1 credit
DefiLlama fees and revenue
/defillama/v1/fees
$1 · $2 PAYG
1 credit
DefiLlama protocol
/defillama/v1/protocol
$1 · $2 PAYG
1 credit
DefiLlama protocols
/defillama/v1/protocols
$1 · $2 PAYG
1 credit
DefiLlama stablecoins
/defillama/v1/stablecoins
$1 · $2 PAYG
1 credit
DefiLlama volumes and fees
/defillama/v1/volumes
$1 · $2 PAYG
1 credit
DefiLlama yield pools
/defillama/v1/yields
$1 · $2 PAYG
1 credit

Call the DefiLlama API

DefiLlama chain TVL history: GET https://api.api.sh/defillama/v1/chain-tvl

curl "https://api.api.sh/defillama/v1/chain-tvl?chain=Ethereum" \
  -H "x-api-key: $APISH_KEY"
  1. Create a free accountConfirm your email and get 1,000 free credits every month. No card needed.
  2. Create an API keyOne key works for all 482 platforms.
  3. Send the requestJSON back in one call. Add output=csv or output=ndjson for files.

Why API.SH for DefiLlama data

  • Public data only: no DefiLlama login, cookies or account needed
  • One key and one response shape for DefiLlama and 481 other platforms
  • Built and maintained by API.SH, not third-party publishers
  • Pay per call; errors on our side cost nothing
  • Live status for every endpoint

API.SH vs the official DefiLlama API

DefiLlama has its own official API with docs, SDKs for TypeScript and Python, a free tier that needs no key for standard endpoints, and a paid Pro API with more endpoints and higher limits. API.SH is useful when you want DeFi data under the same key, JSON format and pricing as the other sites you query.

Skip hosting your own DefiLlama calls and scrapers or comparing Apify and RapidAPI wrappers: API.SH gives you one key, one JSON shape across sites and a fixed price per 1,000 calls.

DefiLlama API questions

What DefiLlama data can I get?+

Protocols and one protocol in depth (/defillama/v1/protocols, /defillama/v1/protocol), chains and chain TVL history (/defillama/v1/chains, /defillama/v1/chain-tvl), yield pools (/defillama/v1/yields), fees and revenue (/defillama/v1/fees), volumes (/defillama/v1/volumes), stablecoins (/defillama/v1/stablecoins) and token prices (/defillama/v1/prices).

How much does the DefiLlama API cost?+

Every DefiLlama endpoint costs 1 credit per call. On a monthly plan 1,000 credits cost $1 (Starter is $50/month for 50,000 credits). Pay-as-you-go is $2 per 1,000 credits, with top-ups from $15 that never expire.

Is there a free trial?+

Yes. Every account gets 1,000 free credits every month. That is 1,000 calls to /defillama/v1/chain-tvl at 1 credit each.

Is there an official DefiLlama API?+

Yes. DefiLlama publishes API docs and official SDKs, with free standard endpoints and a paid Pro tier for more endpoints and higher limits. API.SH is a separate option that puts DefiLlama data behind one API.SH key, with the same response conventions as every other platform.

Do I need a DefiLlama account or login?+

No. API.SH reads public DefiLlama pages only. No endpoint uses a login, cookies or anyone's account. No API key from DefiLlama is needed.

How do I get started?+

1. Sign up at api.sh. 2. Copy your API key. 3. Call /defillama/v1/protocols with sort set to tvl, or call /defillama/v1/yields to screen pools. Request examples and every parameter are in the docs at https://api.sh/docs. You can also use the JS or Python SDK, Google Sheets, Zapier, Make, n8n or the MCP server at https://api.sh/mcp.

Is there a free DefiLlama API?+

DefiLlama's own standard endpoints are free without a key, with a paid Pro tier above that. With API.SH you get 1,000 free credits every month, then pay per 1,000 calls. Pass next_page back as page on ranked lists to walk through results.

Can I use the DefiLlama API from Python?+

Yes. DefiLlama has an official Python SDK, and API.SH is also a plain HTTPS API with a Python SDK, so requests or any HTTP client works. Output is JSON, CSV or NDJSON, which loads straight into pandas or a Sheet.

More finance & crypto APIs all financial & crypto APIs →

Start with 1,000 free credits
Every month, on every account. One key works for all 482 platforms.
Get a free API key