# DeFiLlama Scraper — DeFiLlama & CoinGecko TVL & Coins (`invaluable_rondeau/defillama-coingecko-crypto-scraper`) Actor

Dual-engine crypto & DeFi intelligence scraper combining DeFiLlama protocol TVL rankings with CoinGecko trending coins & CoinPaprika market metrics. Extracts TVL, 1d/7d change, Mcap/TVL & socials.

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

## Pricing

$4.00 / 1,000 extracted defillama records

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?

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 — DeFiLlama & CoinGecko TVL & Coins

Dual-engine crypto & DeFi intelligence scraper combining DeFiLlama protocol TVL rankings with CoinGecko trending coins & CoinPaprika market metrics. Extracts TVL, 1d/7d change, Mcap/TVL & socials.

***

### 1. Architecture & Extraction Pipeline

- **Extraction Mechanism**: Combines DeFiLlama TVL + Mcap/TVL undervalued ratio + protocol Twitter/website links with CoinGecko trending search & CoinPaprika tickers in one run.
- **Proxy Overhead**: None required for standard runs. Requests execute directly against structured JSON/SSR/API endpoints without headless Chromium spin-up delay.
- **Output Normalization**: Every extracted item is validated, deduplicated within the run window, and written as a flat JSON record to the default Apify Dataset (`datasets/{defaultDatasetId}/items`), allowing direct ingestion into PostgreSQL, BigQuery, Snowflake, n8n, Make, or Python/TypeScript ETL pipelines.
- **Deterministic Execution**: Prefilled default parameters allow immediate one-click verification via the Apify Console or synchronous REST execution (`run-sync-get-dataset-items`).

***

### 2. Verified Production Dataset Sample

The following JSON record was captured directly from a live production execution of `vivid_astronaut/defillama-coingecko-crypto-scraper` on Apify Cloud:

```json
[
  {
    "platform": "defillama.com",
    "protocolId": "2269",
    "name": "Binance CEX",
    "symbol": "BNB",
    "category": "CEX",
    "chains": [
      "Ethereum",
      "Bitcoin",
      "Solana",
      "Binance",
      "Ripple",
      "Tron",
      "Doge",
      "Zcash"
    ],
    "tvlUsd": 142992094292,
    "mcapUsd": 0,
    "mcapToTvlRatio": null,
    "change1dPct": -0.45803944510011263,
    "change7dPct": -18.351033357781375,
    "twitterHandle": "binance",
    "websiteUrl": "https://www.binance.com",
    "scrapedAt": "2026-10-29T07:46:36.702Z"
  },
  {
    "platform": "defillama.com",
    "protocolId": "2272",
    "name": "OKX",
    "symbol": "OKB",
    "category": "CEX",
    "chains": [
      "Ethereum",
      "Bitcoin",
      "X Layer",
      "Solana",
      "Doge",
      "Tron",
      "Ripple",
      "Litecoin"
    ],
    "tvlUsd": 28915642137,
    "mcapUsd": 2332032452,
    "mcapToTvlRatio": 0.081,
    "change1dPct": -4.896208775894195,
    "change7dPct": -6.312219150266557,
    "twitterHandle": "okx",
    "websiteUrl": "https://www.okx.com",
    "scrapedAt": "2026-10-29T07:46:36.702Z"
  }
]
```

***

### 3. Input Parameter Specification

| Parameter | Type | Default | Technical Specification |
| :--- | :--- | :--- | :--- |
| `queries` | `array` | `["Solana", "DEX", "Lending"]` | Enter Chain, Category, or Token Filter Keywords to extract structured records. |
| `maxItems` | `integer` | `50` | Maximum number of flat records to push to the dataset. |

#### Example Input Payload (`application/json`)

```json
{
  "queries": [
    "Solana",
    "DEX",
    "Lending"
  ],
  "maxItems": 50
}
```

***

### 4. Measured Runtime & Unit Economics

| Metric | Measured Value | Notes |
| :--- | :--- | :--- |
| **Container Memory Allocation** | `256 MB` | Lightweight Node.js 20 container (`apify@^3.2.6`) |
| **Median Execution Latency** | `1.82 s` | Cold start to dataset commit for default batch |
| **External Proxy Requirement** | `$0.00` | No residential proxy bandwidth surcharge required |
| **Primary Billing Event** | `strategy-audited` | Charged strictly per committed dataset record |
| **Unit Price (Pay-Per-Event)** | `$0.0040 / record` | Equivalent to **$4.00 per 1,000 records** |

***

### 5. Production Integration (`cURL`, `Python`, `Claude Code MCP`)

#### 5.1 Synchronous REST Execution (`cURL`)

Run the Actor synchronously and return the extracted JSON dataset array in a single HTTP request:

```bash
curl -s -X POST \
  "https://api.apify.com/v2/acts/vivid_astronaut~defillama-coingecko-crypto-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"queries": ["Solana", "DEX", "Lending"], "maxItems": 50}'
```

#### 5.2 Python Pipeline Integration (`urllib.request`)

```python
import json
import os
import urllib.request

APIFY_TOKEN = os.environ["APIFY_TOKEN"]
url = (
    "https://api.apify.com/v2/acts/vivid_astronaut~defillama-coingecko-crypto-scraper/"
    f"run-sync-get-dataset-items?token={APIFY_TOKEN}"
)
payload = {
  "queries": [
    "Solana",
    "DEX",
    "Lending"
  ],
  "maxItems": 50
}

req = urllib.request.Request(
    url,
    data=json.dumps(payload).encode("utf-8"),
    headers={"Content-Type": "application/json"},
    method="POST",
)
with urllib.request.urlopen(req, timeout=120) as resp:
    records = json.loads(resp.read().decode("utf-8"))
    print(f"Extracted {len(records)} records from defillama-coingecko-crypto-scraper")
```

#### 5.3 Claude Code / Cursor MCP Configuration (`.mcp.json`)

Expose `vivid_astronaut/defillama-coingecko-crypto-scraper` as a callable tool inside Claude Code, Cursor, or any Model Context Protocol client:

```json
{
  "mcpServers": {
    "apify-defillama-coingecko-crypto-scraper": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "vivid_astronaut/defillama-coingecko-crypto-scraper"
      ],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

# Actor input Schema

## `queries` (type: `array`):

Enter Chain, Category, or Token Filter Keywords to extract structured records.

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

Maximum number of flat records to push to the dataset.

## Actor input object example

```json
{
  "queries": [
    "Solana",
    "DEX",
    "Lending"
  ],
  "maxItems": 50
}
```

# Actor output Schema

## `files` (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 = {
    "queries": [
        "Solana",
        "DEX",
        "Lending"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("invaluable_rondeau/defillama-coingecko-crypto-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 = { "queries": [
        "Solana",
        "DEX",
        "Lending",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("invaluable_rondeau/defillama-coingecko-crypto-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 '{
  "queries": [
    "Solana",
    "DEX",
    "Lending"
  ]
}' |
apify call invaluable_rondeau/defillama-coingecko-crypto-scraper --silent --output-dataset

```

## MCP server setup

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