SFOLN

Catalogue / Data utilities

DefiLlama Scraper – DeFi TVL, Fees & Yields

sfoln/defillama-scraper · Developer tools, AI, Automation On request

DefiLlama data as clean JSON rows: protocol TVL with 1d/7d/30d change, chain breakdown and market cap, chain TVL, daily TVL history, fees and revenue, yield pools (APY, TVL, stablecoin flag) and stablecoin supply by chain. Filters and caps; $1 per 1,000 rows.

About

What it does

DefiLlama Scraper exports DefiLlama DeFi data as clean, flat JSON rows: every protocol's TVL with its 1-day, 7-day and 30-day change, chain breakdown and market cap; TVL per chain; a protocol's daily TVL history; fees and revenue; yield pools with APY and TVL; and stablecoin supply by chain. Pick a dataset, filter it (chain, category, minimum size, project, peg…), cap the rows, and pay $0.001 per row – for analysts, crypto researchers, dashboards and AI agents that need DeFi numbers without writing an API client.

Price

Price per delivered record

EventPricePer 1,000Charged for
DeFi record
record
$0.001$1 / 1,000Charged once per delivered row: a protocol, chain, daily TVL snapshot, fees row, yield pool or stablecoin.

Apify free plan: up to 10 items per run. Paid plans have no per-run cap; set maxTotalChargeUsd to cap spend.

Run

Call it from code, an agent or the Console

This API is private on Apify for now. Email us and we will publish it for you, usually within two working days. The calls below work once it is public. contact@sfoln.com

curl · synchronous run, rows in the response
curl -X POST "https://api.apify.com/v2/actors/sfoln~defillama-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"protocols","maxResults":10}'
mcp.json · hosted Apify MCP server
{
  "mcpServers": {
    "apify": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=sfoln/defillama-scraper"
    }
  }
}
asynchronous run · for large batches
POST https://api.apify.com/v2/actors/sfoln~defillama-scraper/runs?maxTotalChargeUsd=1
GET  https://api.apify.com/v2/actor-runs/{runId}            # until status is SUCCEEDED
GET  https://api.apify.com/v2/datasets/{defaultDatasetId}/items?format=json

Authenticate with an Apify API token. MCP clients can instead sign in with OAuth when prompted. Example prompt for an agent: List the 10 largest DeFi lending protocols on Ethereum by TVL with their 1-day, 7-day and 30-day TVL change.

Input

Input fields

Pick a DefiLlama dataset, narrow it with filters and cap the rows. Each delivered row is one dataset record with recordType set to the dataset's row type; every query also writes one free summary record.

FieldTypeDefaultMeaning
mode *string"protocols"Dataset
protocols: every DeFi protocol with TVL, 1d/7d/30d change, chain breakdown and market cap. chains: TVL per chain. protocolTvlHistory: daily TVL snapshots of the protocols listed below. fees: fees and revenue of every protocol (or of the protocols listed below, with 30 days of history). yields: yield pools with APY and TVL. stablecoins: circulating supply in total and per chain. One of "protocols", "chains", "protocolTvlHistory", "fees", "yields", "stablecoins".
protocolsarray—Protocols
DefiLlama protocol slugs, names or defillama.com URLs (e.g. aave-v3, Uniswap V3, https://defillama.com/protocol/lido). Required for protocolTvlHistory (one query per protocol); with fees, one fees summary per protocol; with protocols and yields, a filter. Accounts on the Apify free plan can process up to 10 queries per run.
chainstring—Chain
Only rows on this chain (e.g. Ethereum, Arbitrum, Solana): protocols deployed there (sorted by their TVL on it), pools on it, fees of protocols on it, stablecoins circulating on it.
categorystring—Category
Protocols and fees: only this DefiLlama category, e.g. Lending, Dexs, Liquid Staking, Bridge, CDP, Yield, Derivatives, RWA, CEX.
searchstring—Name contains
Only rows whose name, slug or symbol contains this text (case-insensitive).
minUsdinteger0Minimum size (USD)
Leave out smaller rows: TVL for protocols, chains and pools; circulating supply for stablecoins; 24-hour fees for fees. Range 0–….
includeCexbooleanfalseInclude centralized exchanges
Protocols: also list CEX reserves (DefiLlama's rankings leave them out by default).
projectstring—Pool project
Yields: only pools of this project slug (e.g. aave-v3, lido, uniswap-v3).
symbolstring—Pool symbol contains
Yields: only pools whose symbol contains this text (e.g. USDC, ETH).
stablecoinPoolsOnlybooleanfalseStablecoin pools only
Yields: only pools DefiLlama flags as stablecoin pools.
minApyPctinteger—Minimum APY (%)
Yields: only pools with at least this total APY, in percent. Range 0–….
sortPoolsBystring"tvl"Sort pools by
Yields: largest TVL first, or highest APY first. One of "tvl", "apy".
pegTypestring—Peg type
Stablecoins: only this peg, e.g. peggedUSD, peggedEUR, peggedVAR.
sincestring—History since
protocolTvlHistory: only snapshots on or after this date (YYYY-MM-DD). History is returned newest first, so Max results alone keeps the latest days.
untilstring—History until
protocolTvlHistory: only snapshots on or before this date (YYYY-MM-DD).
includeChainBreakdownbooleantrueInclude TVL per chain
Protocols and TVL history: add chainTvls, the TVL on each chain (staking, pool2 and borrowed amounts left out).
maxResultsinteger100Max results per query
Rows delivered (and charged) per query or per protocol, after filters and sorting. Accounts on the Apify free plan get up to 20 rows per query. Range 1–20000.
maxProtocolsinteger50Max protocols
Safety cap on the protocols processed one by one (TVL history, fees by protocol); further ones are ignored and counted in the OUTPUT record. As a filter of the protocols and yields datasets, up to 1,000 slugs are used. Range 1–1000.
concurrencyinteger2Concurrency
Protocols processed in parallel (TVL history, fees by protocol). TVL history runs at most 2 at a time: the largest histories are parsed in memory. Range 1–5.
itemTimeoutSecsinteger300Timeout per query (seconds)
A query that has not finished after this long is stopped and not charged. Range 60–1800.
includeRawbooleanfalseInclude raw upstream data
Attach DefiLlama's own object to protocol, stablecoin and fees-by-protocol rows (larger output).
Example input
{
  "mode": "protocols",
  "maxResults": 10
}

Output

One record per input item

Records land in the run's dataset; a synchronous call returns them directly. Each has a status (ok is charged; everything else is free) and a charged flag. The run's OUTPUT record totals items and charges.

FieldTypeMeaning
inputstring | objectInput
The input item this record corresponds to.
statusstringStatus
ok | not_found | error | skipped_invalid | skipped_budget | skipped_free_plan | skipped_unmetered (rows are always ok; the per-query summary carries the query outcome). e.g. "ok"
chargedbooleanCharged
Whether this record incurred a pay-per-event charge.
chargedEventstringCharged event
Pay-per-event event charged for this record (present only when charged).
chargedCountintegerEvents charged
Events actually charged when the charge came back short of the requested count (present only then; a warning explains it).
sourcestringSource
Upstream data source (defillama).
fetchedAtstringFetched at
ISO timestamp.
errorobjectError
{ code, message, provider?, status? } on a summary whose query failed (not_found: unknown protocol slug). Runtime codes: budget_exhausted, free_plan_limit, unmetered, aborted, charge_failed, record_too_large, invalid_record, dataset_push_failed; upstream codes: rate_limit, timeout, network, server, client, invalid_response, not_found, http_error.
warningsarrayWarnings
Notes about this record, e.g. a charge that came back short.
recordTypestringRow type
protocol | chain | tvl-snapshot | protocol-fees | yield-pool | stablecoin (charged rows) | summary (one free record per query)
positionintegerPosition
Row number within its query (1 = first after sorting).
modestringDataset
Summary records: the dataset queried.
querystringQuery
Summary records: the dataset name, or the protocol of a per-protocol query.
resultsDeliveredintegerRows delivered
Summary records: rows delivered (and charged) for this query.
matchingResultsinteger | nullRows matching
Summary records: rows matching the filters before maxResults and the budget.
stopReasonstringStop reason
Summary records: limit | free_plan | end | budget | aborted | deadline.
namestring | nullName
Protocol, chain, fees row or stablecoin name.
displayNamestring | nullDisplay name
Fees rows: DefiLlama display name.
slugstring | nullSlug
DefiLlama protocol slug.
protocolstring | nullProtocol
TVL snapshots and summaries: protocol name.
protocolIdstring | nullDefiLlama id
Protocol id on DefiLlama.
categorystring | nullCategory
DefiLlama category (Lending, Dexs, Liquid Staking…).
chainsarrayChains
Chains the protocol is deployed on.
chainstring | nullChain
Protocols: DefiLlama's main chain (Multi-Chain when several); pools: the pool's chain.
symbolstring | nullSymbol
Token symbol (protocols, stablecoins) or pool symbol (yields).
tvlUsdnumber | nullTVL (USD)
Total value locked in USD (protocols: DefiLlama default TVL without staking, pool2 and borrowed amounts).
tvlOnChainUsdnumber | nullTVL on chain (USD)
Protocols with a chain filter: the TVL on that chain.
change1hPctnumber | nullTVL change 1 h (%)
Protocols.
change1dPctnumber | nullChange 1 d (%)
Protocols: TVL; stablecoins: circulating supply.
change7dPctnumber | nullChange 7 d (%)
Protocols: TVL; stablecoins: circulating supply.
change30dPctnumber | nullChange 30 d (%)
Protocols: TVL (from the site list); stablecoins: circulating supply.
mcapUsdnumber | nullMarket cap (USD)
Protocol token market cap.
mcapToTvlnumber | nullMcap / TVL
Market cap divided by TVL.
chainTvlsobject | nullTVL per chain
Chain → TVL in USD, largest first (staking, pool2 and borrowed left out).
parentProtocolstring | nullParent protocol
Slug of the parent protocol (e.g. aave for Aave V3).
urlstring | nullWebsite
Protocol website.
twitterstring | nullX handle
Protocol X/Twitter handle.
geckoIdstring | nullCoinGecko id
CoinGecko id of the token.
listedAtstring | nullListed at
When DefiLlama listed the protocol (ISO).
defillamaUrlstring | nullDefiLlama page
Link to the row on defillama.com.
rankintegerRank
Chains: rank by TVL.
tvlSharePctnumber | nullTVL share (%)
Chains: share of the TVL of all chains.
tokenSymbolstring | nullGas token
Chains: native token symbol.
chainIdinteger | nullChain id
Chains: EVM chain id.
cmcIdstring | nullCoinMarketCap id
Chains.
datestringDate
TVL snapshots: YYYY-MM-DD (UTC).
timestampstringTimestamp
TVL snapshots: snapshot time (ISO; the newest is the current value).
fees24hUsdnumber | nullFees 24 h (USD)
Fees rows.
fees7dUsdnumber | nullFees 7 d (USD)
Fees rows.
fees30dUsdnumber | nullFees 30 d (USD)
Fees rows.
fees1yUsdnumber | nullFees 1 y (USD)
Fees rows.
feesAllTimeUsdnumber | nullFees all time (USD)
Fees rows.
feesChange1dPctnumber | nullFees change 1 d (%)
Fees rows.
feesChange7dPctnumber | nullFees change 7 d (%)
Fees rows.
feesChange30dPctnumber | nullFees change 30 d (%)
Fees rows.
revenue24hUsdnumber | nullRevenue 24 h (USD)
Fees rows: protocol revenue.
revenue7dUsdnumber | nullRevenue 7 d (USD)
Fees rows.
revenue30dUsdnumber | nullRevenue 30 d (USD)
Fees rows.
revenue1yUsdnumber | nullRevenue 1 y (USD)
Fees rows.
revenueAllTimeUsdnumber | nullRevenue all time (USD)
Fees rows.
methodologyUrlstring | nullMethodology
Fees rows: DefiLlama adapter source.
fees24hByChainobjectFees 24 h by chain
Fees by protocol: chain → 24 h fees in USD.
dailyLast30darrayLast 30 days
Fees by protocol: [{ date, feesUsd, revenueUsd }], newest first.
poolIdstring | nullPool id
Yields: DefiLlama pool id.
projectstring | nullProject
Yields: project slug.
poolMetastring | nullPool details
Yields: extra pool label (lock period, vault…).
apynumber | nullAPY (%)
Yields: total APY.
apyBasenumber | nullBase APY (%)
Yields.
apyRewardnumber | nullReward APY (%)
Yields.
apyMean30dnumber | null30-day mean APY (%)
Yields.
apyBase7dnumber | null7-day base APY (%)
Yields.
apyChange1dnumber | nullAPY change 1 d (points)
Yields.
apyChange7dnumber | nullAPY change 7 d (points)
Yields.
apyChange30dnumber | nullAPY change 30 d (points)
Yields.
isStablecoinboolean | nullStablecoin pool
Yields.
ilRiskstring | nullIL risk
Yields: impermanent-loss risk (yes/no).
exposurestring | nullExposure
Yields: single or multi asset.
rewardTokensarrayReward tokens
Yields: reward token addresses.
underlyingTokensarrayUnderlying tokens
Yields: underlying token addresses.
volumeUsd1dnumber | nullVolume 1 d (USD)
Yields.
volumeUsd7dnumber | nullVolume 7 d (USD)
Yields.
predictedClassstring | nullAPY outlook
Yields: DefiLlama's prediction (e.g. Stable/Up).
predictedProbabilitynumber | nullOutlook probability
Yields.
isOutlierboolean | nullOutlier
Yields: DefiLlama flags the APY as an outlier.
stablecoinIdstring | nullStablecoin id
Stablecoins: DefiLlama id.
pegTypestring | nullPeg
Stablecoins: peggedUSD, peggedEUR…
pegMechanismstring | nullPeg mechanism
Stablecoins: fiat-backed, crypto-backed, algorithmic.
priceUsdnumber | nullPrice (USD)
Stablecoins.
circulatingnumber | nullCirculating
Stablecoins: supply in units of the peg.
circulatingUsdnumber | nullCirculating (USD)
Stablecoins: supply × price.
chainCountintegerChains
Stablecoins: chains it is issued on.
circulatingByChainobjectSupply by chain
Stablecoins: chain → circulating supply (peg units), largest first.
circulatingOnChainnumber | nullSupply on chain
Stablecoins with a chain filter: supply on that chain.
rawobject | nullRaw
DefiLlama's own object (includeRaw).
Example record
[
  {
    "input": "protocols",
    "recordType": "protocol",
    "position": 1,
    "name": "Aave V3",
    "slug": "aave-v3",
    "protocolId": "1599",
    "category": "Lending",
    "chains": [
      "Ethereum",
      "Base",
      "Arbitrum"
    ],
    "chain": "Multi-Chain",
    "symbol": "AAVE",
    "tvlUsd": 17035004699.47,
    "tvlOnChainUsd": 14136942874.42,
    "change1hPct": -0.2934,
    "change1dPct": -2.856,
    "change7dPct": -3.6093,
    "change30dPct": -6.1217,
    "mcapUsd": null,
    "mcapToTvl": null,
    "chainTvls": {
      "Ethereum": 14136942874.42,
      "Base": 538320544.06,
      "Arbitrum": 518414684.45
    },
    "parentProtocol": "aave",
    "url": "https://aave.com",
    "twitter": "aave",
    "geckoId": null,
    "listedAt": "2022-04-01T01:34:37.000Z",
    "defillamaUrl": "https://defillama.com/protocol/aave-v3",
    "status": "ok",
    "charged": true,
    "chargedEvent": "record",
    "source": "defillama",
    "fetchedAt": "2026-10-14T22:00:00.000Z"
  },
  {
    "input": "protocols",
    "recordType": "summary",
    "mode": "protocols",
    "query": "protocols",
    "matchingResults": 41,
    "resultsDelivered": 10,
    "stopReason": "limit",
    "status": "ok",
    "charged": false,
    "source": "defillama",
    "fetchedAt": "2026-10-14T22:00:00.000Z"
  }
]

FAQ

Questions

Where does the data come from, and how fresh is it?
From DefiLlama's open API (api.llama.fi, yields.llama.fi, stablecoins.llama.fi), fetched live on every run. DefiLlama refreshes TVL roughly hourly and caches its answers for about 30 minutes; the TVL history has one snapshot per day plus the latest value.
Why is a protocol missing from the protocols dataset?
Centralized exchanges are left out unless includeCex is on (as in DefiLlama's own rankings), and filters such as chain, category or minUsd also remove rows. List the protocol under Protocols to get it whatever its size.
What does a row cost?
Every delivered row is one record event ($0.001). The summary record of each query and queries that fail or name an unknown protocol are free. Use maxResults and the filters to control the number of rows.

Machine-readable

This page for agents