# DefiLlama Scraper — Protocols, Yields, Chains & Stablecoins (`hipersoft/defillama-scraper`) Actor

Scrape DefiLlama for DeFi protocols (TVL, category, chains, market cap), yield pools (APY, TVL), blockchain TVL rankings and stablecoins. Filter by chain, category, TVL or APY.

- **URL**: https://apify.com/hipersoft/defillama-scraper.md
- **Developed by:** [Hipersoft](https://apify.com/hipersoft) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0004 / item scraped

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 — Protocols, Yields, Chains & Stablecoins in Clean JSON

Pull **DeFi market data** and export it as clean, structured **JSON, CSV, Excel or XML**. In one run you can scrape the full **protocol universe (TVL, category, chains)**, **yield pools with live APY**, **blockchain TVL rankings**, or the **stablecoin landscape** — filtered by chain, category, minimum TVL or minimum APY. Fast and reliable.

![DefiLlama Scraper input — dataset choice, chain and category filters in the Apify Console](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/defillama-scraper-input.png?v=2)

### What does DefiLlama Scraper do?

This DefiLlama scraper turns DeFi analytics into a structured dataset. Choose one of four datasets — protocols, yields, chains or stablecoins — apply filters, and it returns a flat record per item with TVL, category, chain coverage, price changes and direct links. Use it to build dashboards, screen yields and feed research models, and export the results in any format the Apify platform supports.

### What data can you scrape from DefiLlama?

| Data point | Description |
| --- | --- |
| Protocol name & symbol | Name and token symbol of the protocol. |
| Category | DefiLlama category (e.g. Dexs, Lending, Liquid Staking). |
| Chain & chains | Primary chain and the full list of chains a protocol runs on. |
| TVL | Total value locked in USD. |
| Price changes | 1h, 1d and 7d change percentages. |
| Description & logo | Short description and logo URL. |
| Links | Project URL and a direct DefiLlama page URL. |
| Yields fields | For the yields dataset: APY, base/reward APY, pool id and risk flags. |
| Stablecoin fields | For the stablecoins dataset: peg type, price and circulating supply. |

### Use cases

- **TVL dashboards** — build a DeFi TVL leaderboard that refreshes on a schedule.
- **Yield screening** — surface pools above a target APY on specific chains.
- **Stablecoin monitoring** — track circulating supply and peg mechanisms across the market.
- **Research pipelines** — feed clean protocol and chain data into models or internal analytics.
- **Dataset building** — assemble a structured snapshot of the DeFi market.

### How to scrape DefiLlama data

1. Add **DefiLlama Scraper** to your Apify account and open its input.
2. Pick a **dataset**: `protocols`, `yields`, `chains` or `stablecoins`.
3. Set filters — **chains**, **categories**, **minTvl**, **minApy** — and a **maxItems** cap.
4. Click **Run**.
5. Export the results as JSON, CSV, Excel or XML, or fetch them through the Apify API.

### Input

```json
{
  "dataset": "protocols",
  "chains": ["Ethereum", "Arbitrum"],
  "categories": ["Dexs", "Lending"],
  "minTvl": 1000000,
  "minApy": 0,
  "maxItems": 200
}
```

| Field | Description |
| --- | --- |
| `dataset` | Which dataset to scrape: `protocols`, `yields`, `chains` or `stablecoins`. |
| `chains` | Only include items on these chains (e.g. `Ethereum`, `Solana`). Empty = all chains. |
| `categories` | For protocols: keep only these exact DefiLlama categories. Empty = all. |
| `minTvl` | Minimum total value locked (USD) an item must have. |
| `minApy` | For the yields dataset: minimum APY % a pool must have. |
| `maxItems` | Cap on output items (0 = all). Highest TVL/APY kept first. |

### What you get

Each record is a flat JSON object; the example below is from the `protocols` dataset. Ready to export to CSV, Excel, JSON or XML.

![DefiLlama Scraper output example — protocol rows with TVL, category and chains as structured JSON](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/defillama-scraper-output.png?v=5)

```json
{
  "name": "Lido",
  "symbol": "LDO",
  "category": "Liquid Staking",
  "chain": "Ethereum",
  "chains": ["Ethereum", "Moonbeam", "Moonriver"],
  "tvl": 32150000000,
  "change1h": 0.12,
  "change1d": -1.45,
  "change7d": 3.88,
  "url": "https://lido.fi",
  "description": "Lido is a liquid staking solution.",
  "logo": "https://icons.llama.fi/lido.png",
  "geckoId": "lido-dao",
  "defillamaUrl": "https://defillama.com/protocol/lido"
}
```

#### Output schema (protocols dataset)

| Field | Type | Description |
| --- | --- | --- |
| `name` | string | Protocol name. |
| `symbol` | string | Token symbol for the protocol. |
| `category` | string | DefiLlama category (e.g. Dexs, Lending). |
| `chain` | string | Primary chain for the protocol. |
| `chains` | array | All chains the protocol runs on. |
| `tvl` | number | Total value locked in USD. |
| `change1h` | number | Price/TVL change over the last hour (%). |
| `change1d` | number | Change over the last day (%). |
| `change7d` | number | Change over the last 7 days (%). |
| `url` | string (URL) | The protocol's own website. |
| `description` | string | Short description of the protocol. |
| `logo` | string (URL) | URL of the protocol's logo. |
| `geckoId` | string | Associated CoinGecko id, when available. |
| `defillamaUrl` | string (URL) | Direct link to the DefiLlama page. |

The `yields`, `chains` and `stablecoins` datasets return their own relevant fields (for example `apy`, `apyBase`, `poolId` for yields, and `pegType`, `price`, `circulating` for stablecoins).

### Need more market data?

- [CoinGecko Scraper](https://apify.com/hipersoft/coingecko-scraper) — live crypto prices, market cap, volume and ATH/ATL.
- [Yahoo Finance Scraper](https://apify.com/hipersoft/yahoo-finance-scraper) — live quotes and OHLCV history for stocks, ETFs, crypto and forex.
- [SEC EDGAR Filings Scraper](https://apify.com/hipersoft/sec-edgar-scraper) — 10-K, 10-Q and 8-K filings by ticker or CIK.

### FAQ

**How many items can I get per run?**
Set `maxItems` to cap the output, or use `0` to fetch everything in the chosen dataset. Results are sorted by TVL (or APY for yields), so a cap keeps the largest entries first.

**Which datasets can I scrape?**
Protocols, yields, chains and stablecoins — selectable with the `dataset` input.

**How fresh is the data?**
It reflects DefiLlama's latest published values at the moment the run starts.

**What export formats are available?**
JSON, CSV, Excel and XML, plus programmatic access through the Apify API.

**Can I connect this to my other tools?**
The DefiLlama Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). It works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Airbyte](https://docs.apify.com/platform/integrations/airbyte), [GitHub](https://docs.apify.com/platform/integrations/github), [Google Drive](https://docs.apify.com/platform/integrations/drive) and [many more](https://apify.com/integrations), plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients and MCP. Or use [webhooks](https://docs.apify.com/platform/integrations/webhooks) to trigger an action whenever a run finishes.

**Is this official DefiLlama data?**
The data reflects public DefiLlama analytics, but this actor is an independent tool and is not affiliated with or endorsed by DefiLlama.

### Related Actors

- [CoinGecko Scraper](https://apify.com/hipersoft/coingecko-scraper)
- [Yahoo Finance Scraper](https://apify.com/hipersoft/yahoo-finance-scraper)
- [SEC EDGAR Filings Scraper](https://apify.com/hipersoft/sec-edgar-scraper)

### Notes

Original clean-room implementation. Returns only public market data; you are responsible for compliant use. Not affiliated with DefiLlama; all trademarks belong to their respective owners.

# Actor input Schema

## `dataset` (type: `string`):

Which DefiLlama dataset to scrape.

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

Only include items on these chains, e.g. "Ethereum", "Arbitrum", "Solana". Empty = all chains.

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

Only include protocols in these DefiLlama categories (exact names), e.g. "Dexs", "Lending", "Liquid Staking", "Derivatives", "CDP", "Yield". Empty = all.

## `minTvl` (type: `integer`):

Only include items with at least this total value locked.

## `minApy` (type: `integer`):

For the yields dataset: only include pools with at least this APY.

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

Maximum items to output (0 = all).

## Actor input object example

```json
{
  "dataset": "protocols",
  "chains": [
    "Ethereum",
    "Arbitrum"
  ],
  "categories": [
    "Dexs",
    "Lending"
  ],
  "minTvl": 0,
  "minApy": 0,
  "maxItems": 0
}
```

# Actor output Schema

## `results` (type: `string`):

All dataset items produced by this run.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/defillama-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/defillama-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 '{}' |
apify call hipersoft/defillama-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hipersoft/defillama-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/C4plhJMOTYbvk7e7m/builds/uzwtl3toCnJmDM3ak/openapi.json
