# 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:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 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/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

## 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(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 iamnsilva/coingecko-scraper --silent --output-dataset

```

## MCP server setup

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