# DeFiLlama Fees and Revenue Scraper (`parseforge/defillama-fees-revenue-scraper`) Actor

Collects daily fees or daily revenue data for DeFi protocols from DeFiLlama. Each protocol row includes 24-hour, 7-day, and 30-day totals with percentage changes and annualized run-rates. Filter by category or protocol name.

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

## Pricing

from $7.50 / 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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### DeFiLlama Fees and Revenue Scraper

**Scrape daily fees and revenue for thousands of DeFi protocols from DeFiLlama, filtered by category or name.** Each protocol row includes its 24-hour, 7-day, and 30-day totals, plus annualized run-rates and percentage changes. Export to CSV, JSON, Excel, or XML.

DeFiLlama is the standard ledger for protocol financials, but manually pulling fee and revenue data across categories is slow. This actor reads the public DeFiLlama API directly, collecting daily fees or daily revenue for up to a million protocols per run. You get a flat dataset ready for fundamental analysis, competitor benchmarking, or trend tracking, with no API key required.

| Who uses it | What they scrape DeFiLlama for |
|---|---|
| Crypto fundamental analysts | Rank protocols by 30-day annualized revenue to find undervalued tokens. |
| DeFi investors | Track fee generation across a watchlist of protocols to spot growth trends. |
| Market researchers | Compare fee structures across DeFi categories like DEXs, lending, and liquid staking. |
| Data journalists | Pull the latest protocol revenue figures for weekly DeFi market roundups. |

### What it does

This Actor collects daily fees or daily revenue data for DeFi protocols from DeFiLlama and returns each protocol as a flat row with its 24-hour, 7-day, and 30-day totals.

- 💰 **Daily Fees or Daily Revenue:** Choose the exact aggregate you need from the DeFiLlama endpoint.
- 🏷️ **Category filter:** Narrow results to a single DeFiLlama category, such as Dexes, Lending, or Yield.
- 🔍 **Name search:** Supply a case-insensitive substring to match only protocols whose name contains it.
- 📊 **Multi-period totals:** Every row delivers 24-hour, 7-day, and 30-day figures with percentage changes.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with DeFiLlama data

**📈 Rank protocols by revenue.**

A fundamental analyst pulls daily revenue for all protocols in the Dexes category, sorts by 30-day annualized run-rate, and identifies the top five fee-generating DEXs for a portfolio rebalance.

**🔎 Monitor a watchlist for fee spikes.**

An investor runs the scraper daily with a name filter matching their ten held protocols, then checks the 24-hour change column to detect sudden fee surges that may precede token price movement.

**🏦 Compare fee models across categories.**

A market researcher collects daily fees for Lending, CDP, and Liquid Staking protocols, then compares the ratio of fees to TVL across categories to understand which verticals monetize most efficiently.

**📰 Feed a DeFi dashboard or newsletter.**

A data journalist schedules a weekly run for the top 100 protocols by revenue, exports the CSV, and uses the 7-day change figures to write a 'biggest movers' section in their newsletter.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key** | Reads the public DeFiLlama API with zero registration or authentication. |
| **Flat schema** | Every protocol is one row with consistent columns, ready for pivot tables. |
| **Scalable** | Collect up to a million protocols in a single run. |
| **Flexible output** | Export to CSV, JSON, Excel, or XML for your existing workflow. |

### How it compares

This actor focuses specifically on DeFiLlama fee and revenue endpoints with category and name filters, while the broader DefiLlama scrapers cover TVL, chains, and DEX volumes.

| Feature | ParseForge | DefiLlama Scraper | 🧾 DefiLlama Protocol Fees & Revenue Tracker | DeFi Fee & Revenue Ranker |
|---|---|---|---|---|
| Daily fees data | Yes | Yes | Yes | Yes |
| Daily revenue data | Yes | Not listed | Yes | Yes |
| Filter by DeFiLlama category | Yes | Not listed | Yes | Not listed |
| Filter by protocol name substring | Yes | Not listed | Not listed | Not listed |
| TVL and chain metrics | Not listed | Yes | Not listed | Not listed |
| Revenue margin calculation | Not listed | Not listed | Not listed | Yes |

### Configure the run

Drive the Actor by setting a data type, an optional DeFiLlama category, and an optional protocol name substring. Filters run before data is collected so only matching protocols reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10
}
```

A larger pull:

```json
{
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0085 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.85 |
| 1,000 results | $8.50 |
| 10,000 results | $85.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [DeFiLlama Fees and Revenue Scraper](https://apify.com/parseforge/defillama-fees-revenue-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to DeFiLlama through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/defillama-fees-revenue-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting fewer results than my maxItems setting?**

The maxItems parameter is an upper bound. If you have applied a category or name filter, the actor stops when it has collected all matching protocols, which may be fewer than maxItems. Remove or broaden your filters to get more results.

**Why are some protocols missing fee or revenue data?**

Not every protocol on DeFiLlama reports fee or revenue data. The DeFiLlama API only returns entries for protocols that have submitted this information. If a protocol you expect is missing, it may not be tracked by DeFiLlama for that data type.

**Why did my name filter return no results?**

The name filter is a case-insensitive substring match. Check your spelling and try a shorter substring. For example, 'aave' will match Aave V2 and Aave V3, but 'Aave V4' will return nothing if that version does not exist on DeFiLlama.

**Why are the percentage change values sometimes null?**

DeFiLlama calculates percentage changes relative to the prior period. If a protocol has no data for the prior period, the change field will be null. This is expected for newly tracked protocols or data types.

**The run timed out. What should I do?**

Large requests with a high maxItems value can take time. Increase the run timeout in your Apify actor settings, or reduce maxItems and run multiple smaller batches.

### FAQ

| Question | Answer |
|---|---|
| What is the difference between daily fees and daily revenue? | Daily fees represent the total fees paid by users of a protocol. Daily revenue is the portion of those fees that goes to the protocol's treasury or token holders. The DeFiLlama API tracks both separately, and this actor lets you choose which to collect. |
| Do I need a DeFiLlama API key? | No. This actor reads DeFiLlama's public, permissionless API endpoints. You do not need to register an account or obtain an API key. |
| How many protocols can I scrape in one run? | You can set the maximum protocols parameter up to 1,000,000. The actor will collect data for that many protocols, subject to the filters you apply. |
| What time periods are included in the output? | Each protocol row includes 24-hour, 7-day, and 30-day totals for the selected data type, along with percentage changes and annualized run-rates calculated from those periods. |
| Can I filter by a specific DeFi category? | Yes. Use the Category input to restrict results to a single DeFiLlama category like Dexes, Lending, Yield, or Liquid Staking. |
| Can I search for a protocol by name? | Yes. The Name contains field accepts a case-insensitive substring. Entering 'uniswap' will match Uniswap V3, Uniswap V2, and any other protocol with that string in its name. |
| What export formats are supported? | You can export your dataset in CSV, JSON, Excel, or XML format from the Apify platform. |
| How often is the data updated on DeFiLlama? | DeFiLlama refreshes its fee and revenue endpoints continuously throughout the day. Each run of this actor pulls the latest available figures from the API. |
| Can I schedule this actor to run daily? | Yes. Apify supports scheduled runs. You can configure this actor to run once per day, once per hour, or on any cron schedule you need. |
| Does this actor also scrape TVL data? | No. This actor is focused on fees and revenue data. If you need TVL, chain metrics, or DEX volumes, consider a broader DeFiLlama scraper. |

### Related actors

- [defillama-scraper](https://apify.com/parseforge/defillama-scraper?fpr=vmoqkp): Use this broader scraper when you need TVL, chain metrics, DEX volumes, and stablecoin data alongside fees and revenue.

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by DeFiLlama. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

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

How many protocols to collect per run.

## `dataType` (type: `string`):

Which aggregate to fetch.

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

DeFiLlama protocol category.

## `nameContains` (type: `string`):

Case-insensitive substring match on protocol name.

## Actor input object example

```json
{
  "maxItems": 10,
  "dataType": "dailyFees"
}
```

# 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 = {
    "maxItems": 10
};

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

```

## MCP server setup

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