DefiLlama Scraper — Protocol TVL, Chains, Yields & Stablecoins
Pricing
from $0.70 / 1,000 result items
DefiLlama Scraper — Protocol TVL, Chains, Yields & Stablecoins
DeFi data from DefiLlama for AI agents: protocol TVL rankings with growth filters, protocol detail, chain TVL, yield pools with risk filters, stablecoin supply and depegs, fees/revenue, DEX volumes, TVL history and exploits. No API key.
Pricing
from $0.70 / 1,000 result items
Rating
0.0
(0)
Developer
Samat Makatov
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
DeFi market data from DefiLlama's public API: protocol TVL rankings, per-chain TVL, yield pools with APY and risk flags, stablecoin supplies and depegs, protocol fees/revenue, DEX volumes, TVL history and the exploit database. Twelve modes, rich filters, one normalized row per item with a stable id, sourceUrl and fetchedAt. No API key, no proxy, no browser.
Use cases
- DeFi lead lists / BD —
mode: protocols,listedAfter: 2026-08-01,minTvl: 1000000,excludeCategories: ["CEX","Chain"]→ new protocols worth contacting. - TVL outflow alerts —
maxChange7d: -30on a schedule; alert when a protocol you hold loses a third of its TVL. - Yield desk / treasury —
mode: yields,stablecoinOnly: true,minTvl: 10000000,maxApy: 30,minApyMean30d: 4→ sustainable stablecoin yields. - Depeg monitoring —
mode: stablecoins,minPegDeviationPct: "0.5"→ stablecoins trading ≥0.5% off peg. - Revenue research / due diligence —
mode: fees,feeMetric: dailyRevenue+protocolHistoryfor TVL trend of a target. - Risk & security reports —
mode: hacks,days: 365,minAmountUsd: 1000000→ last year's exploits with technique and chain.
Input
| Field | Type | Default | Notes |
|---|---|---|---|
mode | string | protocols | protocols, protocol, chains, yields, stablecoins, fees, volumes, protocolHistory, chainHistory, yieldHistory, stablecoinHistory, hacks. Other values are refused by Apify before the run. |
limit | integer | 100 | Max rows of the whole run (all chains, slugs and series together), after filtering and sorting. Billing is per row. |
fields | array | [] | Keep only these columns, in this order; id is always kept. See Output fields. |
chain / chains | string / array | — | Chain names (see Reference). Aliases work: eth, bsc/bnb, op/optimism, arb, xdai/gnosis, hyperliquid… |
category / categories | string / array | — | DefiLlama category (see Reference). Aliases: dex/dexes→Dexs, perps→Derivatives, lst→Liquid Staking, lrt→Liquid Restaking, rwas→RWA… In yields, category = project slug (legacy). |
excludeCategories | array | — (form prefill ["CEX","Chain"]) | protocols: drop these categories, e.g. CEX reserves and L1 chains for pure DeFi rankings. |
slugs | array | [] | Protocol slugs from defillama.com/protocol/<slug>. Required for protocol, protocolHistory; a whitelist in protocols, fees, volumes, where a parent slug (aave, uniswap) matches its versions. |
search | string | — | Substring on name/symbol. |
minTvl / maxTvl | integer | empty / — | TVL bounds (USD); for stablecoins minTvl = min circulating. Empty minTvl = $1,000,000 for rankings, but 0 for slugs or chains you name (and when maxTvl is below $1M). Not used by fees/volumes. |
minChange1d / maxChange1d / minChange7d / maxChange7d | number | — | protocols: TVL change bounds in % (decimals allowed). |
listedAfter / listedBefore | date | — | protocols: listing date window (YYYY-MM-DD). |
auditedOnly | boolean | false | protocols with ≥1 audit on DefiLlama. |
includeChainTvls | boolean | false | protocols: add chainTvls {chain: usd}. |
chainDetails | boolean | true | chains: add TVL change 1d/7d/30d and protocol count to each returned chain (one small request per chain). |
projects | array | [] | yields: project slugs (aave-v3, pendle, morpho-v1…). |
symbols | array | [] | yields: pool symbol contains any token (USDC). |
minApy / maxApy / minApyMean30d | number | — | yields APY bounds (%, decimals allowed). |
stablecoinOnly / singleExposureOnly / noIlOnly | boolean | false | yields risk filters. |
excludeOutliers | boolean | true | yields: drop pools DefiLlama flags as outliers. |
poolIds | array | [] | yieldHistory: pool UUIDs (field pool from yields). |
pegTypes / pegMechanisms | array | [] | stablecoins (see Reference). Peg types take the code or the currency (peggedUSD or USD); mechanisms take fiat/crypto/algo too. |
minPegDeviationPct / maxPegDeviationPct | string (decimal) | — | stablecoins: distance from peg in %, e.g. "0.5" (a comma or a trailing % is fine). |
includeChainBreakdown | boolean | false | stablecoins: add chainCirculating. |
feeMetric | string | dailyFees | fees: dailyFees or dailyRevenue. |
volumeType | string | dexs | volumes: dexs, aggregators, options, aggregator-derivatives, bridge-aggregators, open-interest. |
minTotal24h | integer | — | fees/volumes: min last-24h value in USD. |
includeBreakdown | boolean | false | fees/volumes: add breakdown24h {chain: usd}. |
from / to / days | date / date / integer | — | History windows (default last 90 days); hacks window (default all time). |
aggregate | string | daily | History modes: daily, weekly, monthly (OHLC-style buckets). |
minAmountUsd | integer | — | hacks: min loss. |
sortBy / sortDir | string | per mode / desc | protocols: tvl, change1d, change7d, change1m, mcap, mcapTvl, listedAt, name; chains: tvl, chain; yields: tvl, apy, apyBase, apyReward, apyMean30d, apyPct7d, volumeUsd1d; stablecoins: circulating, change1d, change7d, change30d, pegDeviationPct, chainCount, name; fees/volumes: total24h, total7d, total30d, total1y, change1d, change7d, change1m, name; hacks: date, amountUsd, name. Empty = the first one. |
Legacy inputs (mode, chain, category, slugs, minTvl, limit) keep their names and meaning.
How names are read. Chain, category, project, peg and sortBy names are matched ignoring letter case, accents, spaces, - and _, plus the aliases above and DefiLlama's old and new chain names (Binance = BSC, Optimism = OP Mainnet, xDai = Gnosis…). Every such reading is listed in the status message and SUMMARY.notes. A name that matches nothing stops the run before any row is saved, with a "did you mean" list — it is never dropped and never replaced by a look-alike (dropping it used to return unfiltered rows). Slugs DefiLlama does not know are named in the status message and never billed; when none of them exists the run fails with that message. Inputs the chosen mode does not read (e.g. minApy in protocols) are listed in the status message instead of being ignored silently.
Reference
Modes → source endpoint
| Mode | Row = | Source |
|---|---|---|
protocols | protocol (or protocol × chain) | api.llama.fi/protocols |
protocol | protocol detail (TVL now/1d/7d/30d ago, ATH, chain TVLs, audits, raises, hacks, hallmarks) | api.llama.fi/protocol/<slug> |
chains | chain TVL, TVL change 1d/7d/30d, protocol count | api.llama.fi/v2/chains + /v2/historicalChainTvl/<chain> + /protocols |
yields | pool | yields.llama.fi/pools |
yieldHistory | pool × day / week / month | yields.llama.fi/chart/<pool> |
stablecoins | stablecoin | stablecoins.llama.fi/stablecoins |
stablecoinHistory | day / week / month (all chains or per chain) | stablecoins.llama.fi/stablecoincharts/<chain> |
fees / volumes | protocol (or protocol × chain) | api.llama.fi/overview/{fees,dexs,…} |
protocolHistory / chainHistory | day / week / month | api.llama.fi/protocol, /v2/historicalChainTvl |
hacks | exploit | api.llama.fi/hacks |
Top chain names: Ethereum, Solana, BSC, Base, Arbitrum, Tron, Bitcoin, Hyperliquid L1, Avalanche, Polygon, OP Mainnet, Sui, Aptos, TON, Mantle, Sei, Plasma, Monad, Ink, Stellar, ZKsync Era, Linea, Scroll, Blast, Berachain, Sonic, Unichain, Gnosis (xDai). Full list: defillama.com/chains.
Categories (protocols / fees / volumes, Sep 2026): AI Agents, Algo-Stables, Anchor BTC, Basis Trading, Block Builders, Bridge, Bridge Aggregator, Bug Bounty, CDP, CDP Manager, CEX, Canonical Bridge, CeDeFi, Chain, Chain Bribes, Collateral Management, Collateral Markets, Cross Chain Bridge, Crypto Card Issuer, DCA Tools, DEX Aggregator, DePIN, Decentralized AI, Decentralized BTC, Derivatives, Developer Tools, Dexs, Domains, Exotic Options, Farm, Gaming, Governance Incentives, Identity & Reputation, Indexes, Insurance, Interest Rate Derivatives, Interface, Launchpad, Lending, Leveraged Farming, Liquid Restaking, Liquid Staking, Liquidations, Liquidity Automation, Liquidity Manager, MEV, Meme, Mining Pools, NFT Lending, NFT Marketplace, NftFi, OTC Marketplace, Onchain Capital Allocator, Options, Options Vault, Oracle, Payments, Portfolio Tracker, Prediction Market, Privacy, RWA, Reserve Currency, Restaked BTC, Restaking, Risk Curators, SoFi, Stablecoin Issuer, Staking Pool, Synthetics, Telegram Bot, Token Locker, Trading App, Treasury Manager, Uncollateralized Lending, Wallets, Yield, Yield Aggregator, Yield Lottery (plus a few niche ones). The run checks names against DefiLlama's live list.
Peg types: peggedUSD, peggedEUR, peggedGBP, peggedJPY, peggedCNY, peggedCHF, peggedCAD, peggedAUD, peggedSGD, peggedHKD, peggedKRW, peggedTRY, peggedRUB, peggedUAH, peggedARS, peggedREAL, peggedMXN, peggedCOP, peggedCLP, peggedPEN, peggedPHP, peggedMYR, peggedKES, peggedZAR, peggedNGN, peggedXOF, peggedGHS, peggedVAR. Peg mechanisms: fiat-backed, crypto-backed, algorithmic.
Examples
New DeFi protocols listed this month (lead list)
{ "mode": "protocols", "listedAfter": "2026-09-01", "minTvl": 500000, "excludeCategories": ["CEX", "Chain"], "sortBy": "tvl", "limit": 50 }
Top DEXes on Base
{ "mode": "protocols", "chain": "Base", "category": "Dexs", "limit": 20, "fields": ["name", "tvl", "change7d", "chains"] }
Sustainable stablecoin yields ≥ $5M TVL on Base, best APY first
{ "mode": "yields", "chains": ["Base"], "stablecoinOnly": true, "minTvl": 5000000, "maxApy": 30, "sortBy": "apy", "limit": 30 }
Depeg watch
{ "mode": "stablecoins", "minPegDeviationPct": "0.5", "minTvl": 10000000, "sortBy": "pegDeviationPct" }
Protocol revenue leaders + 90-day weekly TVL trend of a target
{ "mode": "fees", "feeMetric": "dailyRevenue", "minTotal24h": 10000, "limit": 25 }{ "mode": "protocolHistory", "slugs": ["aave"], "days": 90, "aggregate": "weekly" }
Exploits over $1M in the last year
{ "mode": "hacks", "days": 365, "minAmountUsd": 1000000, "limit": 50 }
Output
Example yields row (trimmed):
{"id": "ae3397ed-1f0f-4aa4-ab62-44413ea8cd9e","pool": "ae3397ed-1f0f-4aa4-ab62-44413ea8cd9e","project": "avantis","chain": "Base","symbol": "USDC","poolMeta": "vault","tvl": 10539693,"apy": 19.3211,"apyBase": 19.3211,"apyMean30d": 7.6399,"apyPct7d": 8.8423,"stablecoin": true,"ilRisk": "no","exposure": "single","sourceUrl": "https://defillama.com/yields/pool/ae3397ed-1f0f-4aa4-ab62-44413ea8cd9e","fetchedAt": "2026-09-13T08:12:30.000Z"}
| Mode | Columns |
|---|---|
protocols | id, slug, name, symbol, category, chain, chains, chainCount, tvl (on the named chain when chains are set), tvlTotal, change1h, change1d, change7d, change1m, mcap, mcapTvl, audits, listedAt, url, twitter, geckoId, parentProtocol, sourceUrl, fetchedAt; with includeChainTvls: chainTvls |
protocol | id, slug, name, symbol, category, chains, chainCount, tvl, tvl1dAgo, tvl7dAgo, tvl30dAgo, change1d, change7d, change1m, tvlAth, firstTvlDate, historyDays, chainTvls, staking, pool2, borrowed, mcap, mcapTvl, description, url, twitter, github, geckoId, cmcId, audits, auditLinks, isParentProtocol, childProtocols, raises, raisedTotalUsd, hacks, hallmarks, sourceUrl, fetchedAt |
chains | id, name, chain, tvl, tokenSymbol, chainId, geckoId, cmcId, sourceUrl, fetchedAt; with chainDetails: protocolCount, tvlPrevDay, tvlPrevWeek, tvlPrevMonth, change1d, change7d, change1m (%, live TVL vs 1/7/30 days ago) |
yields | id, pool, project, chain, symbol, poolMeta, tvl, apy, apyBase, apyReward, apyMean30d, apyPct1d, apyPct7d, apyPct30d, apyBase7d, volumeUsd1d, volumeUsd7d, il7d, stablecoin, ilRisk, exposure, outlier, predictedClass, predictedProbability, rewardTokens, underlyingTokens, sourceUrl, fetchedAt |
stablecoins | id, name, symbol, pegType, pegCurrency, pegMechanism, price, pegDeviationPct, circulating, circulatingPrevDay, circulatingPrevWeek, circulatingPrevMonth, change1d, change7d, change30d, chainCount, chains, topChain, geckoId, sourceUrl, fetchedAt; with includeChainBreakdown: chainCirculating |
fees / volumes | id, slug, name, displayName, category, protocolType, parentProtocol, chains, chainCount, metric, total24h, total48hTo24h, total7d, total14dTo7d, total30d, total1y, totalAllTime, annualized, change1d, change7d, change1m, change7dOver7d, change30dOver30d, methodologyUrl, sourceUrl, fetchedAt, chain (the named chain or null); with includeBreakdown: breakdown24h |
protocolHistory | id, slug, name, chain, date, period, value, open, high, low, change1d, change7d, change30d, changePct, tvl, sourceUrl, fetchedAt |
chainHistory | id, chain, date, period, value, open, high, low, change1d, change7d, change30d, changePct, tvl, sourceUrl, fetchedAt |
yieldHistory | id, pool, date, period, value, open, high, low, change1d, change7d, change30d, changePct, tvl, apy, apyBase, apyReward, il7d, sourceUrl, fetchedAt (APY of the same day as value: the last day of the period) |
stablecoinHistory | id, chain, pegType, date, period, value, open, high, low, change1d, change7d, change30d, changePct, circulatingUsd, sourceUrl, fetchedAt |
hacks | id, date, name, amountUsd, returnedFundsUsd, chains, classification, technique, targetType, bridgeHack, language, defillamaId, source, sourceUrl, fetchedAt |
Dataset views: Protocols (overview), Chains (chains), Yields, Stablecoins, Fees & volumes, History (TVL, supply and pool APY series), Hacks. Pick the one matching the mode. The dataset schema describes every column with a title, a description and an example.
With fields, rows keep only the columns you name, in your order, always with id (first unless you place it elsewhere). Names are read ignoring case and -/_; a name that is not a column of the mode is left out with a "did you mean" note, a column that needs an option (chainTvls → includeChainTvls) says so, and when no name is a column the run stops before any request.
The run ends with one status message: rows saved, how many matched, whether the limit cut them, every name it read differently, slugs it did not find and inputs the mode does not use. The SUMMARY record in the key-value store holds the same plus matched counts, the resolved chains/categories and the request count.
Use it from code / agents
curl -X POST "https://api.apify.com/v2/acts/yadroo~defillama-protocols/run-sync-get-dataset-items?token=$APIFY_TOKEN" \-H 'Content-Type: application/json' \-d '{"mode":"yields","chains":["Base"],"stablecoinOnly":true,"minTvl":5000000,"limit":20}'
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('yadroo/defillama-protocols').call({ mode: 'protocols', maxChange7d: -30, minTvl: 10000000 });const { items } = await client.dataset(run.defaultDatasetId).listItems();
import osfrom apify_client import ApifyClientclient = ApifyClient(os.environ["APIFY_TOKEN"])run = client.actor("yadroo/defillama-protocols").call(run_input={"mode": "stablecoins", "minPegDeviationPct": "0.5"})items = client.dataset(run["defaultDatasetId"]).list_items().items
MCP: add https://mcp.apify.com to Claude, Cursor or your own agent and call yadroo/defillama-protocols with the same JSON input.
Pricing
Pay per event: $0.001 per run start + $0.001 per row. Bronze −10 %, Silver −20 %, Gold and above −30 % on the row price; the start event is the same on every plan; platform usage is included. The default run (top 100 protocols) costs about $0.101; a 20-row yield screen about $0.021; one protocol detail $0.002. History modes return one row per day — use aggregate: "weekly"/"monthly" or a shorter window to keep cost down (90 daily points of one protocol ≈ $0.091, weekly ≈ $0.014).
Spending limit. The run reads your "Maximum cost per run" before it saves anything and never goes over it: it saves the rows the limit pays for and ends with "Stopped at your spending limit: N rows delivered".
Limits & FAQ
- Freshness — DefiLlama updates TVL roughly hourly and yields/fees daily; every run reads live data.
limitis per run — it counts every row of the run: with several chains, slugs or series the first ones in order can use it up, and the status message says how many more matched or were not read. Raiselimit, shorten the window or useaggregate.- Big payloads —
protocols(~8k items) andyields(~17k pools) are downloaded whole and filtered in memory; a run takes a few seconds. - Chain details —
protocolCountcounts non-CEX protocols that list the chain (as on defillama.com/chains). The protocol list still uses legacy chain names (Binance,xDai,Optimism…); the actor maps the known ones, and a chain it cannot map getsprotocolCount: nullrather than a wrong number.chainDetailscosts one request per returned chain at about 6 requests per second, so an all-chains run (minTvl: 0,limit: 500) takes about two minutes; rows are saved every 20 chains. Turn it off for TVL only. - Run timeout — the default timeout is 15 minutes. Before it, the run stops starting new requests, keeps the rows it saved and ends SUCCEEDED with "Stopped before the run timeout: N rows saved".
- Parent protocols — slugs like
aerodromeoruniswapare parents: inprotocolmodecategoryis empty andchainsis derived from current TVL; inprotocols/fees/volumesa parent slug selects its versions (uniswap→uniswap-v2,uniswap-v3…); a slug that is a protocol itself means that protocol only. - Chains in
protocolHistory— one series per named chain the protocol has TVL on; a chain without TVL for that protocol gives no rows and a note (it never falls back to the all-chain total). - Paid endpoints — plain perp DEX volume and some dimensions are Pro-only on DefiLlama; those return a clear error instead of empty data.
- Errors — HTTP 429/5xx are retried with backoff within the run's time; a protocol, pool or chain series that fails is named in the status message while the others are still saved; when nothing could be read the run fails with the reason.
- Not financial advice. Data is DefiLlama's; APYs are variable and can be manipulated.
- Roadmap — bridge volumes, token unlocks (if they remain free), per-protocol fees history.
Made by Yadroo — more crypto data actors: coingecko-markets · crypto-sentiment · crypto-news · dexscreener-tokens · wallet-intel · x402-endpoints