# CoinGecko Crypto Market Data (`mranderson323/coingecko-crypto-market-data`) Actor

Fetches live and historical cryptocurrency data from CoinGecko. Top coins, trending, portfolio prices, market overview. No API key needed. Perfect for scheduling.

- **URL**: https://apify.com/mranderson323/coingecko-crypto-market-data.md
- **Developed by:** [Jeff](https://apify.com/mranderson323) (community)
- **Categories:** Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Crypto Market Data

Fetch live and historical cryptocurrency data from [CoinGecko](https://coingecko.com) — the most comprehensive free crypto data API. No API key required. Runs reliably on a schedule for price monitoring, portfolio tracking, and market alerts.

### What it does

- **Top coins** — live prices, market caps, 24h/7d % changes, volume, supply, ATH for the top N coins by market cap
- **Trending** — the 7 coins trending on CoinGecko in the last 24 hours, with full market data
- **Specific coins** — exact coin IDs you choose (bitcoin, ethereum, solana, etc.)
- **Market overview** — global totals: total market cap, 24h volume, BTC/ETH dominance %, active coins
- **Price history** — daily OHLCV (open/high/low/close) for any coin, up to 365 days back
- **Social stats** — GitHub stars/forks, Twitter followers, Reddit subscribers (optional)

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `top_coins` | `top_coins`, `trending`, `specific_coins`, or `market_overview` |
| `coinIds` | array | `["bitcoin","ethereum","solana"]` | Coin IDs for `specific_coins` mode |
| `topN` | integer | `100` | How many top coins to return (max 250) |
| `currency` | string | `usd` | Quote currency: `usd`, `eur`, `gbp`, `btc`, `eth`, etc. |
| `includeHistory` | boolean | `false` | Fetch daily OHLCV price history |
| `historyDays` | integer | `30` | Days of history per coin (1–365) |
| `includeSocialStats` | boolean | `false` | Add GitHub, Twitter, Reddit stats per coin |

### Output

Each coin record:

```json
{
  "id": "bitcoin",
  "recordType": "coin",
  "symbol": "BTC",
  "name": "Bitcoin",
  "rank": 1,
  "price": 67420.15,
  "priceChange24h": 1205.80,
  "priceChangePct24h": 1.82,
  "priceChangePct7d": -3.41,
  "marketCap": 1328456789012,
  "volume24h": 24567890123,
  "circulatingSupply": 19700000,
  "totalSupply": 21000000,
  "ath": 73738.0,
  "athDate": "2024-03-14T07:10:36.635Z",
  "athChangePct": -8.59,
  "currency": "usd",
  "fetchedAt": "2026-06-19T10:00:00.000Z"
}
````

History record (when `includeHistory: true`):

```json
{
  "id": "bitcoin-1718755200000",
  "recordType": "history_point",
  "coinId": "bitcoin",
  "symbol": "BTC",
  "timestamp": "2026-06-19T00:00:00.000Z",
  "open": 66800.0,
  "high": 67900.0,
  "low": 66200.0,
  "close": 67420.0,
  "currency": "usd"
}
```

### Pricing

- **$0.002 per coin** (live data record)
- **$0.001 per history point** (when `includeHistory: true`)

| Run | Cost |
|---|---|
| Top 100 coins, live prices | $0.20 |
| Top 100 coins + 30 days history | $3.20 |
| Trending 7 coins | $0.014 |
| Market overview | $0.002 |

### Use cases

- **Portfolio tracker** — schedule hourly to keep a spreadsheet or dashboard current
- **Price alert system** — run every 15 minutes, pipe into n8n/Make to trigger alerts when a coin crosses a threshold
- **AI trading signal feed** — feed into an LLM agent for market commentary or trading decisions
- **DeFi dashboard** — display live top 50 prices on a custom UI
- **Research & analytics** — download 1-year OHLCV history for backtesting strategies
- **Market sentiment** — track trending coins daily to spot emerging narratives early

### Scheduling tip

Set up a scheduled run in Apify Console → Schedules. Common patterns:

- Every 15 minutes: `*/15 * * * *` (trending + specific watchlist)
- Daily at 09:00 UTC: `0 9 * * *` (top 100 + history)
- First of each month: `0 0 1 * *` (full market snapshot)

### Why CoinGecko?

CoinGecko's free API has been stable and publicly accessible since 2014. It covers 13,000+ coins across 900+ exchanges, updated every ~60 seconds. No API key required for the free tier (used by this actor). All data is sourced directly from the official CoinGecko API — no scraping, no brittle selectors, no proxies needed.

# Actor input Schema

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

What data to fetch. top\_coins = top N by market cap. trending = coins trending in last 24h. specific\_coins = exact coin IDs you provide. market\_overview = global market summary only.

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

CoinGecko coin IDs to fetch. E.g. \["bitcoin", "ethereum", "solana", "cardano"]. Only used when mode=specific\_coins.

## `topN` (type: `integer`):

How many top coins by market cap to return. Max 250.

## `currency` (type: `string`):

Currency for prices and market caps. E.g. usd, eur, gbp, jpy, btc, eth.

## `includeHistory` (type: `boolean`):

If true, fetches daily OHLCV history for each coin. Set historyDays to control range.

## `historyDays` (type: `integer`):

Number of days of price history to fetch per coin (when includeHistory is true). Max 365.

## `includeSocialStats` (type: `boolean`):

Adds GitHub stars, forks, Twitter followers, Reddit subscribers for each coin. Adds one API call per coin.

## Actor input object example

```json
{
  "mode": "top_coins",
  "coinIds": [
    "bitcoin",
    "ethereum",
    "solana"
  ],
  "topN": 100,
  "currency": "usd",
  "includeHistory": false,
  "historyDays": 30,
  "includeSocialStats": false
}
```

# 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("mranderson323/coingecko-crypto-market-data").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("mranderson323/coingecko-crypto-market-data").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 mranderson323/coingecko-crypto-market-data --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CoinGecko Crypto Market Data",
        "description": "Fetches live and historical cryptocurrency data from CoinGecko. Top coins, trending, portfolio prices, market overview. No API key needed. Perfect for scheduling.",
        "version": "0.1",
        "x-build-id": "syvmt5tXcDARIT9CC"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/mranderson323~coingecko-crypto-market-data/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-mranderson323-coingecko-crypto-market-data",
                "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/mranderson323~coingecko-crypto-market-data/runs": {
            "post": {
                "operationId": "runs-sync-mranderson323-coingecko-crypto-market-data",
                "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/mranderson323~coingecko-crypto-market-data/run-sync": {
            "post": {
                "operationId": "run-sync-mranderson323-coingecko-crypto-market-data",
                "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": [
                            "top_coins",
                            "trending",
                            "specific_coins",
                            "market_overview"
                        ],
                        "type": "string",
                        "description": "What data to fetch. top_coins = top N by market cap. trending = coins trending in last 24h. specific_coins = exact coin IDs you provide. market_overview = global market summary only.",
                        "default": "top_coins"
                    },
                    "coinIds": {
                        "title": "Coin IDs (specific_coins mode)",
                        "type": "array",
                        "description": "CoinGecko coin IDs to fetch. E.g. [\"bitcoin\", \"ethereum\", \"solana\", \"cardano\"]. Only used when mode=specific_coins.",
                        "default": [
                            "bitcoin",
                            "ethereum",
                            "solana"
                        ]
                    },
                    "topN": {
                        "title": "Number of top coins (top_coins mode)",
                        "minimum": 1,
                        "maximum": 250,
                        "type": "integer",
                        "description": "How many top coins by market cap to return. Max 250.",
                        "default": 100
                    },
                    "currency": {
                        "title": "Quote Currency",
                        "type": "string",
                        "description": "Currency for prices and market caps. E.g. usd, eur, gbp, jpy, btc, eth.",
                        "default": "usd"
                    },
                    "includeHistory": {
                        "title": "Include price history",
                        "type": "boolean",
                        "description": "If true, fetches daily OHLCV history for each coin. Set historyDays to control range.",
                        "default": false
                    },
                    "historyDays": {
                        "title": "History days",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "Number of days of price history to fetch per coin (when includeHistory is true). Max 365.",
                        "default": 30
                    },
                    "includeSocialStats": {
                        "title": "Include developer & community stats",
                        "type": "boolean",
                        "description": "Adds GitHub stars, forks, Twitter followers, Reddit subscribers for each coin. Adds one API call per coin.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
