# CoinGEecko Scraper (`iamnsilva/coingecko-scraper`) Actor

Scrapes CoinGecko market data (coins, prices, market caps), trending coins, and global crypto market stats. No API key required for basic use.

- **URL**: https://apify.com/iamnsilva/coingecko-scraper.md
- **Developed by:** [ian](https://apify.com/iamnsilva) (community)
- **Categories:** AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## CoinGecko Scraper

Scrape live crypto data from CoinGecko — no browser, no headless Chrome, just clean API data.

Supports three modes:

- **Markets** — coin prices, market caps, volumes, ATH/ATL, and price change % across any time interval
- **Trending** — the 15 coins trending on CoinGecko right now
- **Global** — total market cap, 24h volume, BTC/ETH dominance, active cryptocurrency count

No API key required for basic use. Add a free CoinGecko Demo API key for higher rate limits.

### Use Cases

- Portfolio tracking dashboards
- Price alert pipelines (connect to Zapier/Make)
- Daily crypto newsletters and digests
- Market research and data analysis
- Altcoin screeners by category (DeFi, L1/L2, NFT tokens, etc.)

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `markets` | `markets`, `trending`, or `global` |
| `vsCurrency` | string | `usd` | Price currency (usd, eur, btc, eth, etc.) |
| `coinIds` | string[] | `[]` | Filter to specific coins by CoinGecko ID (e.g. `bitcoin`, `ethereum`). Empty = all |
| `category` | string | — | CoinGecko category slug (e.g. `decentralized-finance-defi`, `layer-1`) |
| `order` | string | `market_cap_desc` | Sort order for markets mode |
| `maxResults` | integer | `100` | Max coins to return (markets mode only, up to 5000) |
| `includeSparkline` | boolean | `false` | Include 7-day sparkline price array |
| `priceChangePercentages` | string[] | `["24h"]` | Price change % intervals: `1h`, `24h`, `7d`, `14d`, `30d`, `1y` |
| `apiKey` | string | — | CoinGecko Demo API key (optional, for higher rate limits) |

### Output — Markets Mode

```json
{
  "id": "bitcoin",
  "symbol": "btc",
  "name": "Bitcoin",
  "image": "https://...",
  "currentPrice": 67842,
  "marketCap": 1337000000000,
  "marketCapRank": 1,
  "fullyDilutedValuation": 1424000000000,
  "totalVolume": 28500000000,
  "high24h": 68100,
  "low24h": 66500,
  "priceChange24h": 450.12,
  "priceChangePercentage24h": 0.67,
  "marketCapChange24h": 8900000000,
  "marketCapChangePercentage24h": 0.67,
  "circulatingSupply": 19700000,
  "totalSupply": 21000000,
  "maxSupply": 21000000,
  "ath": 73738,
  "athChangePercentage": -7.99,
  "athDate": "2024-03-14T07:10:36.635Z",
  "atl": 67.81,
  "atlChangePercentage": 99900.12,
  "atlDate": "2013-07-06T00:00:00.000Z",
  "lastUpdated": "2024-10-20T12:00:00.000Z"
}
````

### Output — Trending Mode

```json
{
  "id": "solana",
  "name": "Solana",
  "symbol": "SOL",
  "marketCapRank": 5,
  "score": 0,
  "thumb": "https://...",
  "large": "https://...",
  "priceChange24h": 3.21,
  "marketCap": "$76.5 B"
}
```

### Output — Global Mode

```json
{
  "activeCryptocurrencies": 15230,
  "markets": 1120,
  "totalMarketCap": { "usd": 2650000000000, "btc": 38900, "eth": 890000 },
  "totalVolume": { "usd": 98000000000 },
  "marketCapPercentage": { "btc": 56.2, "eth": 13.1 },
  "marketCapChangePercentage24hUsd": 1.23,
  "updatedAt": "2024-10-20T12:00:00.000Z"
}
```

### Rate Limits

CoinGecko's free (public) API allows ~30 requests/minute. This Actor automatically handles rate limiting with retries and delays.

For higher limits, get a free Demo API key at [coingecko.com](https://www.coingecko.com/en/api) and pass it as `apiKey`.

### Category Slugs

Popular CoinGecko category slugs for the `category` input:

- `decentralized-finance-defi` — DeFi
- `layer-1` — L1 blockchains
- `layer-2` — L2 / rollups
- `non-fungible-tokens-nft` — NFT tokens
- `artificial-intelligence` — AI coins
- `real-world-assets-rwa` — RWA
- `meme-token` — Meme coins
- `gaming` — GameFi

Find all category slugs via the CoinGecko API: `/api/v3/coins/categories/list`

# Actor input Schema

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

What data to fetch from CoinGecko.

## `vsCurrency` (type: `string`):

Currency to express prices in (e.g. usd, eur, btc, eth).

## `coinIds` (type: `array`):

Filter to specific coins by CoinGecko ID (e.g. bitcoin, ethereum, solana). Leave empty to fetch all.

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

Filter by CoinGecko category slug (e.g. decentralized-finance-defi, layer-1, non-fungible-tokens-nft). Leave blank for all.

## `order` (type: `string`):

How to sort coins in markets mode.

## `maxResults` (type: `integer`):

Max number of coins to save (markets mode only). CoinGecko free tier: ~30 req/min.

## `includeSparkline` (type: `boolean`):

Include 7-day price sparkline data (last 48 data points).

## `priceChangePercentages` (type: `array`):

Which time intervals to include for price change %. Options: 1h, 24h, 7d, 14d, 30d, 1y.

## `apiKey` (type: `string`):

Optional CoinGecko Demo API key (free at coingecko.com) for higher rate limits.

## Actor input object example

```json
{
  "mode": "markets",
  "vsCurrency": "usd",
  "coinIds": [],
  "order": "market_cap_desc",
  "maxResults": 100,
  "includeSparkline": false,
  "priceChangePercentages": [
    "24h"
  ]
}
```

# 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("iamnsilva/coingecko-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("iamnsilva/coingecko-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 iamnsilva/coingecko-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=iamnsilva/coingecko-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CoinGEecko Scraper",
        "description": "Scrapes CoinGecko market data (coins, prices, market caps), trending coins, and global crypto market stats. No API key required for basic use.",
        "version": "0.1",
        "x-build-id": "MIegu77uQve4ayL3g"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/iamnsilva~coingecko-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-iamnsilva-coingecko-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/iamnsilva~coingecko-scraper/runs": {
            "post": {
                "operationId": "runs-sync-iamnsilva-coingecko-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/iamnsilva~coingecko-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-iamnsilva-coingecko-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "markets",
                            "trending",
                            "global"
                        ],
                        "type": "string",
                        "description": "What data to fetch from CoinGecko.",
                        "default": "markets"
                    },
                    "vsCurrency": {
                        "title": "vs Currency",
                        "type": "string",
                        "description": "Currency to express prices in (e.g. usd, eur, btc, eth).",
                        "default": "usd"
                    },
                    "coinIds": {
                        "title": "Coin IDs (optional)",
                        "type": "array",
                        "description": "Filter to specific coins by CoinGecko ID (e.g. bitcoin, ethereum, solana). Leave empty to fetch all.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "category": {
                        "title": "Category (optional)",
                        "type": "string",
                        "description": "Filter by CoinGecko category slug (e.g. decentralized-finance-defi, layer-1, non-fungible-tokens-nft). Leave blank for all."
                    },
                    "order": {
                        "title": "Sort order",
                        "enum": [
                            "market_cap_desc",
                            "market_cap_asc",
                            "volume_desc",
                            "volume_asc",
                            "id_asc",
                            "id_desc"
                        ],
                        "type": "string",
                        "description": "How to sort coins in markets mode.",
                        "default": "market_cap_desc"
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Max number of coins to save (markets mode only). CoinGecko free tier: ~30 req/min.",
                        "default": 100
                    },
                    "includeSparkline": {
                        "title": "Include sparkline",
                        "type": "boolean",
                        "description": "Include 7-day price sparkline data (last 48 data points).",
                        "default": false
                    },
                    "priceChangePercentages": {
                        "title": "Price change % intervals",
                        "type": "array",
                        "description": "Which time intervals to include for price change %. Options: 1h, 24h, 7d, 14d, 30d, 1y.",
                        "default": [
                            "24h"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "apiKey": {
                        "title": "CoinGecko Demo API Key (optional)",
                        "type": "string",
                        "description": "Optional CoinGecko Demo API key (free at coingecko.com) for higher rate limits."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
