# DefiLlama DeFi Scraper - Protocols, TVL & Chains (`ninhothedev/defillama-scraper`) Actor

Scrape DefiLlama for DeFi protocols, TVL, market cap and blockchain rankings. Clean JSON, no API key. Great for crypto research, DeFi analytics and dashboards.

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

## Pricing

from $0.20 / 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.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## DefiLlama DeFi Scraper 🦙📈

**Scrape DeFi protocols, TVL (Total Value Locked), market caps and blockchain rankings from DefiLlama — no API key, clean JSON, datacenter-friendly.**

DefiLlama is the leading, transparency-first aggregator of DeFi data. This Actor turns its public data into structured, ready-to-use JSON you can drop straight into a spreadsheet, dashboard, database, or trading model. It is fast, cheap, and needs no proxies or login.

***

### ✨ What you get

- **All DeFi protocols** ranked by TVL — name, symbol, category, chains, TVL, 1d/7d change, market cap, logo and URL.
- **All blockchains** ranked by TVL — name, native token symbol, TVL and chain ID.
- **Optional filters** — narrow protocols to a single **category** (e.g. `Lending`) or **chain** (e.g. `Ethereum`).
- **Clean, flat JSON** with a `scraped_at` timestamp on every row, plus an **Overview** table view.

***

### 🚀 Modes

#### `protocols` — every DeFi protocol by TVL

Returns thousands of protocols sorted by TVL descending. Add a `category` and/or `chain` filter to zoom in.

#### `chains` — every blockchain by TVL

Returns all chains DefiLlama tracks, ranked by total value locked.

***

### 🧾 Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | `protocols` or `chains`. |
| `category` | string (optional) | Filter protocols by category, case-insensitive. E.g. `Dexs`, `Lending`, `Liquid Staking`, `Derivatives`. |
| `chain` | string (optional) | Filter protocols by chain, case-insensitive. E.g. `Ethereum`, `Solana`, `Base`, `Arbitrum`. |
| `maxItems` | integer | Max rows after sort/filter. Default `200`, max `5000`. |

#### Example input

```json
{
  "mode": "protocols",
  "category": "Lending",
  "chain": "Ethereum",
  "maxItems": 100
}
```

***

### 📦 Output

#### Protocol

```json
{
  "type": "protocol",
  "id": "182",
  "name": "Lido",
  "symbol": "LDO",
  "category": "Liquid Staking",
  "chains": ["Ethereum", "Moonbeam"],
  "tvl": 16384383977.7,
  "change_1d": 1.2,
  "change_7d": 3.4,
  "mcap": 900000000,
  "url": "https://lido.fi/",
  "logo": "https://icons.llamao.fi/icons/protocols/lido",
  "slug": "lido",
  "scraped_at": "2026-07-04T18:00:00+00:00"
}
```

#### Chain

```json
{
  "type": "chain",
  "name": "Ethereum",
  "symbol": "ETH",
  "tvl": 40026244926.0,
  "chain_id": 1,
  "scraped_at": "2026-07-04T18:00:00+00:00"
}
```

***

### 💡 Use cases

- **Crypto research** — pull the full protocol universe with TVL and momentum (1d/7d change) in seconds.
- **DeFi analytics** — track TVL flows across chains and categories over time.
- **Dashboards** — feed a Google Sheet, Notion, Grafana or Power BI board with fresh DeFi metrics.
- **Trading** — build screeners and signals from TVL growth, market cap and per-chain exposure.

***

### 💰 Pricing

Roughly **$1 per 1,000 items** (input and output), billed as clean JSON. A typical `chains` run or a filtered `protocols` run costs a fraction of a cent. There is no third-party API cost — DefiLlama's public data is free and this Actor is a thin, fast wrapper around it.

| Run | Approx. items | Approx. cost |
|-----|---------------|--------------|
| All chains | ~450 | < $0.01 |
| Top 200 protocols | 200 | < $0.01 |
| 5,000 protocols | 5,000 | ~$0.005 |

***

### 🆚 Why this Actor

| | DefiLlama DeFi Scraper | Manual API scripting | Generic web scraper |
|---|---|---|---|
| No API key | ✅ | ✅ | ✅ |
| Structured, typed JSON | ✅ | ⚠️ DIY | ❌ |
| Sorting + filtering built in | ✅ | ⚠️ DIY | ❌ |
| Datacenter-friendly (no proxy) | ✅ | ✅ | ❌ often blocked |
| Overview table view | ✅ | ❌ | ❌ |

***

### 🔗 Related Actors by the same author

- [CoinGecko Crypto Scraper](https://apify.com/ninhothedev/coingecko-crypto-scraper)
- [Binance Crypto Scraper](https://apify.com/ninhothedev/binance-crypto-scraper)
- [Yahoo Finance Scraper](https://apify.com/ninhothedev/yahoo-finance-scraper)
- [SEC EDGAR Scraper](https://apify.com/ninhothedev/sec-edgar-scraper)

***

### 🛟 Support

Questions, feature requests or a field you need added? Open an issue on the Actor's Issues tab and I'll help. Data quality and reliability are the priority.

***

### 🔍 Keywords

DefiLlama scraper, DeFi data, TVL scraper, total value locked, DeFi analytics, crypto scraper, blockchain TVL, DeFi protocols, on-chain data, crypto research, DeFi dashboard, market cap, liquidity, Ethereum DeFi, Solana DeFi.

# Actor input Schema

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

What to scrape. 'protocols' returns every DeFi protocol tracked by DefiLlama (sorted by TVL, with optional category/chain filters). 'chains' returns every blockchain ranked by total value locked.

## `category` (type: `string`):

Optional. Keep only protocols in this DefiLlama category, matched case-insensitively. Examples: 'Dexs', 'Lending', 'Liquid Staking', 'Derivatives', 'CEX', 'Bridge'. Leave empty for all categories.

## `chain` (type: `string`):

Optional. Keep only protocols deployed on this blockchain, matched case-insensitively. Examples: 'Ethereum', 'Solana', 'Base', 'Arbitrum'. Leave empty for all chains.

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

Maximum number of items to return after sorting and filtering. Default 200, maximum 5000.

## Actor input object example

```json
{
  "mode": "protocols",
  "category": "Dexs",
  "chain": "Ethereum",
  "maxItems": 200
}
```

# Actor output Schema

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

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/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("ninhothedev/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 ninhothedev/defillama-scraper --silent --output-dataset

```

## MCP server setup

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