# DefiLlama Scraper: TVL, Yields, Stablecoins, Hacks (`parselab/defillama-protocols-yields-stablecoins-scraper`) Actor

Scrape DefiLlama data on DeFi: protocols with TVL, fees, revenue and volume, yield pools with APY and risk flags, stablecoin supply and peg, chain rankings and the history of hacks. Valuation ratios and trends included. Export to CSV or Excel.

- **URL**: https://apify.com/parselab/defillama-protocols-yields-stablecoins-scraper.md
- **Developed by:** [ParseLab](https://apify.com/parselab) (community)
- **Categories:** Other, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $12.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## DefiLlama Scraper: DeFi Protocols, Yields, Stablecoins, Chains and Hacks

This DefiLlama scraper turns the open data of DefiLlama into clean tables for the whole DeFi market. Pick a mode and get one row per protocol, yield pool, stablecoin, blockchain or hack. Protocol rows carry the value locked, its change over an hour, a day and a week, fees, revenue and trading volume, and valuation ratios that DefiLlama does not give in one place: market cap to TVL, price to fees, price to revenue and the annual fees as a share of TVL. Yield rows carry the base yield, the reward yield, the 30 day average, the trend forecast and a rule based risk screen.

The other modes cover stablecoin supply with the peg deviation and the chains that hold each coin, a ranking of blockchains by TVL with the stablecoins on each, and the full history of hacks with amounts, techniques, targets and the funds returned.

DeFi investors, analysts, researchers, journalists, risk teams and tool builders use it to screen protocols, compare yields and track the market without opening dozens of pages.

### What can you do with this DefiLlama scraper?

- Rank protocols by TVL, fees, revenue, volume or growth
- Find protocols that grew or shrank by a set percent in a week
- Find the newest protocols that already have fees
- Compare how expensive a token is against the fees and revenue it earns
- Find yield pools above a minimum APY, on stablecoins, without impermanent loss
- Drop pools whose yield comes mostly from reward tokens
- Watch which stablecoins lost their peg and how much supply moved
- See which chains hold the most TVL and the most stablecoins
- Study hacks by year, technique, chain and amount lost
- Export to CSV or Excel, or send the tables to your own tools

### What data can you extract?

| Mode | One row is | Highlights |
|---|---|---|
| Protocols | One protocol | Name, category, chains and top chains with their share, TVL, change 1 hour, 1 day and 7 days, market cap, market cap to TVL, fees, revenue and volume for 24 hours, 7 days and 30 days, annualized revenue, annual fees to TVL, price to fees, price to revenue, listing date, age, audits, forks, links |
| Yield pools | One pool | Chain, project, symbol, pool note, TVL, APY, base APY, reward APY, reward share, 30 day average APY, APY versus average, APY change over 1, 7 and 30 days, impermanent loss risk, exposure, predicted trend with its probability, days of history, reward and underlying tokens, risk flags |
| Stablecoins | One stablecoin | Name, symbol, peg type and mechanism, price, deviation from the peg, off peg flag, supply, market share, supply change over 1, 7 and 30 days, number of chains, dominant chain, top chains with their share |
| Chains | One blockchain | Rank, name, token, chain id, TVL, share of all TVL, stablecoins on the chain, stablecoins to TVL |
| Hacks | One incident | Date, year, name, amount lost, funds returned, net loss, chains, classification, technique, target type, bridge flag, description, source |

### How to scrape DefiLlama

1. Choose **Protocols**, **Yield pools**, **Stablecoins**, **Chains** or **Hacks**.
2. Add search words, chains, categories or projects.
3. Add filters: minimum TVL, APY, supply, dates and more.
4. Choose how to sort, set **Max Items** and click **Start**.
5. Export the dataset as CSV, Excel or from the Apify console.

### Input example

```json
{
  "mode": "yields",
  "chains": ["Ethereum", "Base", "Arbitrum"],
  "minTvlUsd": 5000000,
  "stablecoinsOnly": true,
  "noImpermanentLoss": true,
  "sortBy": "apy",
  "maxItems": 100
}
```

### Protocol output example

```json
{
  "name": "Aave V3",
  "category": "Lending",
  "chainCount": 21,
  "tvlUsd": 15346842379,
  "tvlChange7dPct": -7.5,
  "fees24hUsd": 1242729,
  "revenue24hUsd": 151284,
  "annualizedRevenueUsd": 87697448,
  "annualizedFeesToTvlPct": 4.09,
  "listedAt": "2022-04-01",
  "auditCount": 2
}
```

### Stablecoin output example

```json
{
  "name": "Tether",
  "symbol": "USDT",
  "pegMechanism": "fiat-backed",
  "priceUsd": 0.99884,
  "depegPct": -0.116,
  "change30dPct": -3.11,
  "dominantChain": "Tron"
}
```

### How much does it cost to scrape DefiLlama?

You pay per result: $16 per 1,000 rows plus a tiny start fee. The free plan returns up to 10 rows per run.

### Tips for better results

- TVL, fees and volume are what DefiLlama tracks and publishes. Methods differ by protocol, so compare within a category.
- Fees, revenue and volume come from separate lists and are joined by name, so a protocol without a match has empty columns. Turn off the earnings option to skip those three extra lists.
- Price to fees and price to revenue need the market cap, which many protocols do not have, and parent protocols hold the market cap of their versions.
- The default for yield pools drops pools that DefiLlama marks as outliers. Turn on keep outliers to see them.
- A high APY is often temporary reward tokens. The reward share and the risk flags help to see that.
- The predicted trend is DefiLlama's own model. Treat it as a hint, not a promise.
- Stablecoin deviation is the price against one dollar for dollar coins. A small gap is normal for the market price.
- Hacks include centralized exchanges and some very large incidents. Use the target type to keep what you need.
- DefiLlama keeps raises, bridge volumes and emissions behind a paid plan, so they are not in this Actor.

### Who uses this data?

- **DeFi investors and analysts** screen protocols and yields.
- **Risk and compliance teams** watch pegs, hacks and concentration.
- **Researchers and journalists** study the market over time.
- **Tool and dashboard builders** feed charts and alerts.
- **Token teams** compare themselves with peers.

### Automate and connect

Schedule the Actor every day and send the tables to Google Sheets, Slack, Telegram, Zapier, Make or n8n, or trigger a webhook when a run ends.

### FAQ

**Do I need an account or a login?**
No. The Actor works without any login.

**Does it give financial advice?**
No. It collects public data and simple rule based flags. Do your own research.

**How current is the data?**
The Actor reads DefiLlama when you run it. TVL and yields update many times a day.

**Does it return history over time?**
No. It returns the current state and the changes over short periods. Schedule runs to build your own history.

**Which blockchains are covered?**
All the chains that DefiLlama tracks, hundreds of them.

### Legal note

This Actor collects information that is publicly visible on the website. The data belongs to DefiLlama and its sources, so credit DefiLlama when you publish results. Check the source site's terms and your local rules before using the data. Nothing here is investment advice.

### Support

Missing a field or found a bug? Open an issue from the Actor page.

# Actor input Schema

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000.

## `mode` (type: `string`):

Protocols returns one row per DeFi protocol with TVL, fees, revenue and volume. Yield pools returns farming and lending pools with APY. Stablecoins returns supply and peg data. Chains ranks blockchains by TVL. Hacks returns the history of exploits.

## `searchTerms` (type: `array`):

Part of a name or a symbol, for example aave, uniswap or USDC. In the hacks mode the words are also searched in the description.

## `chains` (type: `array`):

Keep items on these chains, for example Ethereum, Solana, Base, Arbitrum.

## `categories` (type: `array`):

Protocols mode. For example Dexs, Lending, Liquid Staking, Bridge, Derivatives, Yield.

## `projects` (type: `array`):

Yield pools mode. Project names as DefiLlama writes them, for example aave-v3, lido, uniswap-v3, morpho.

## `sortBy` (type: `string`):

Largest first. Protocols: tvl, change1d, change7d, fees24h, revenue24h, volume24h, marketCap, listed. Yield pools: apy, tvl, apyBase, apyMean30d. Stablecoins: circulating, change7d, change30d, depeg. Chains: tvl, stablecoins. Hacks: date, amount.

## `minTvlUsd` (type: `integer`):

Protocols, yield pools and chains. Keep items with at least this much value locked.

## `maxTvlUsd` (type: `integer`):

Protocols, yield pools and chains. Useful to find small protocols early.

## `minMarketCapUsd` (type: `integer`):

Protocols mode.

## `minTvlChange7dPct` (type: `number`):

Protocols mode. For example 20 to find protocols that grew at least 20% in a week.

## `maxTvlChange7dPct` (type: `number`):

Protocols mode. For example -20 to find protocols that lost at least 20% in a week.

## `minFees24hUsd` (type: `integer`):

Protocols mode. Keep protocols that earned at least this much in fees in 24 hours.

## `listedAfter` (type: `string`):

Protocols mode. Keep protocols listed on or after this date, in the form 2026-09-30.

## `includeEarnings` (type: `boolean`):

Protocols mode. Adds fees, revenue and volume of each protocol and the valuation ratios. Reads three more lists.

## `minApy` (type: `number`):

Yield pools mode.

## `maxApy` (type: `number`):

Yield pools mode. Very high APY is often a risk sign, so a cap helps.

## `minBaseApy` (type: `number`):

Yield pools mode. The part of the yield that does not come from reward tokens.

## `stablecoinsOnly` (type: `boolean`):

Yield pools mode.

## `noImpermanentLoss` (type: `boolean`):

Yield pools mode. Keep pools that DefiLlama marks as without impermanent loss risk.

## `singleExposureOnly` (type: `boolean`):

Yield pools mode. Keep pools that hold one asset instead of a pair.

## `keepOutliers` (type: `boolean`):

Yield pools mode. DefiLlama marks pools with an unusual APY as outliers. They are dropped unless you turn this on.

## `pegTypes` (type: `array`):

Stablecoins mode. For example peggedUSD, peggedEUR, peggedVAR.

## `mechanisms` (type: `array`):

Stablecoins mode. For example fiat-backed, crypto-backed, algorithmic.

## `minCirculatingUsd` (type: `integer`):

Stablecoins mode.

## `onlyDepegged` (type: `boolean`):

Stablecoins mode. Keep dollar stablecoins whose price is away from 1 dollar by at least the threshold below.

## `depegThresholdPct` (type: `number`):

Stablecoins mode. Distance from the peg that counts as off the peg.

## `dateFrom` (type: `string`):

Hacks mode. Start date in the form 2026-01-01.

## `dateTo` (type: `string`):

Hacks mode. End date in the form 2026-10-31.

## `minAmountUsd` (type: `integer`):

Hacks mode.

## `classifications` (type: `array`):

Hacks mode. For example Infrastructure, Smart Contract Language, Protocol Logic, Governance.

## `techniques` (type: `array`):

Hacks mode. Part of the technique, for example private key, reentrancy, flash loan, oracle.

## `targetTypes` (type: `array`):

Hacks mode. For example CeFi, Bridge, Token, Contract.

## `bridgeHacksOnly` (type: `boolean`):

Hacks mode.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "protocols",
  "sortBy": "",
  "includeEarnings": true,
  "stablecoinsOnly": false,
  "noImpermanentLoss": false,
  "singleExposureOnly": false,
  "keepOutliers": false,
  "onlyDepegged": false,
  "depegThresholdPct": 0.5,
  "bridgeHacksOnly": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parselab/defillama-protocols-yields-stablecoins-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parselab/defillama-protocols-yields-stablecoins-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 10
}' |
apify call parselab/defillama-protocols-yields-stablecoins-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parselab/defillama-protocols-yields-stablecoins-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9C1mzaGDktQh3RxeD/builds/gRJoBe6mU6fVn02mV/openapi.json
