# Coingecko (`real1ty/coingecko`) Actor

This Actor scrapes cryptocurrency data from CoinGecko, a popular cryptocurrency tracking website. It extracts detailed information about cryptocurrencies including their rank, name, symbol, price, market cap, and more.

- **URL**: https://apify.com/real1ty/coingecko.md
- **Developed by:** [Real1ty](https://apify.com/real1ty) (community)
- **Categories:** Other, Automation
- **Stats:** 74 total users, 3 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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?

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 Cryptocurrency Scraper

This Actor scrapes cryptocurrency data from [CoinGecko](https://www.coingecko.com/), a popular cryptocurrency tracking website. It extracts detailed information about cryptocurrencies including their rank, name, symbol, price, market cap, and more.

### Features

- Scrapes cryptocurrency data from CoinGecko using Cheerio
- Handles pagination automatically to get data from multiple pages
- Extracts key information like rank, name, symbol, price, market cap, etc.
- Option to collect basic data or detailed information from individual cryptocurrency pages
- Configurable number of pages to scrape
- Data saved in structured format for easy analysis

### Output data structure

The Actor stores data in one of two formats depending on the `scrapeDetails` input option:

#### Basic Data (scrapeDetails = false)

```json
{
	"rank": 1,
	"name": "Bitcoin",
	"symbol": "BTC",
	"price": "$83,036.43",
	"priceChange1h": "0.3%",
	"priceChange24h": "1.0%",
	"priceChange7d": "0.8%",
	"priceChange30d": "6.3%",
	"volume24h": "$16,812,048,183",
	"marketCap": "$1,647,676,993,507",
	"fullyDilutedMarketCap": "$1,647,676,993,507",
	"marketCapToFullyDilutedMarketCapRatio": "1.0",
	"url": "https://www.coingecko.com/en/coins/bitcoin"
}
```

#### Detailed Data (scrapeDetails = true)

When `scrapeDetails` is enabled, the Actor visits each cryptocurrency's detail page and extracts additional information:

```json
{
	"rank": 6,
	"name": "Solana",
	"symbol": "SOL",
	"price": "$132.13",
	"priceChange1h": "0.1%",
	"priceChange24h": "0.8%",
	"priceChange7d": "21.2%",
	"priceChange30d": "0.3%",
	"volume24h": "$4,133,918,355",
	"marketCap": "$68,227,762,583",
	"fullyDilutedMarketCap": "$79,112,028,715",
	"marketCapToFullyDilutedMarketCapRatio": "0.86",
	"url": "https://www.coingecko.com/en/coins/solana",
	"priceChange14d": "3.1%",
	"priceChange1y": "14.0%",
	"range24h": {
		"low": "$128.36",
		"high": "$134.19"
	},
	"range7d": {
		"low": "$103.16",
		"high": "$134.05"
	},
	"allTimeHigh": {
		"price": "$293.31",
		"changePercentage": "55.0%",
		"date": "Jan 19, 2025",
		"daysAgo": "3 months"
	},
	"allTimeLow": {
		"price": "$0.5008",
		"changePercentage": "26274.8%",
		"date": "May 11, 2020",
		"daysAgo": "almost 5 years"
	},
	"circulatingSupply": "516,227,214",
	"totalSupply": "598,580,118",
	"maxSupply": "∞",
	"description": "Solana is a Layer 1 blockchain that offers users fast speeds and affordable costs. It supports smart contracts and facilitates the creation of decentralized applications (dApps). Projects built on Solana include a variety of DeFi platforms as well as NFT marketplaces, where users can buy Solana-based NFT projects. Its high performance means Solana doesn't require a traditional scaling Layer 2 solution; instead, Layer 2s on Solana focus on interoperability and connecting Solana to other chains.",
	"sentiment": {
		"bullish": "79%",
		"bearish": "21%"
	},
	"markets": [
		{
			"rank": "1",
			"exchange": "Binance",
			"type": "CEX",
			"pair": "SOL/USDC",
			"price": "$132.00",
			"volume24h": "$602,038,421",
			"volumePercentage": "14.56%"
		},
		{
			"rank": "2",
			"exchange": "Binance",
			"type": "CEX",
			"pair": "SOL/USDT",
			"price": "$132.18",
			"volume24h": "$466,768,020",
			"volumePercentage": "11.29%"
		},
		{
			"rank": "3",
			"exchange": "Toobit",
			"type": "CEX",
			"pair": "SOL/USDC",
			"price": "$132.23",
			"volume24h": "$179,231,181",
			"volumePercentage": "4.33%"
		},
		{
			"rank": "4",
			"exchange": "Coinbase Exchange",
			"type": "CEX",
			"pair": "SOL/USD",
			"price": "$132.23",
			"volume24h": "$195,552,188",
			"volumePercentage": "4.73%"
		},
		{
			"rank": "5",
			"exchange": "KuCoin",
			"type": "CEX",
			"pair": "SOL/USDT",
			"price": "$132.32",
			"volume24h": "$117,349,479",
			"volumePercentage": "2.84%"
		},
		{
			"rank": "6",
			"exchange": "Bitget",
			"type": "CEX",
			"pair": "SOL/USDT",
			"price": "$132.26",
			"volume24h": "$154,304,408",
			"volumePercentage": "3.73%"
		},
		{
			"rank": "7",
			"exchange": "OKX",
			"type": "CEX",
			"pair": "SOL/USDT",
			"price": "$132.22",
			"volume24h": "$146,968,970",
			"volumePercentage": "3.55%"
		},
		{
			"rank": "8",
			"exchange": "Bybit",
			"type": "CEX",
			"pair": "SOL/USDT",
			"price": "$132.28",
			"volume24h": "$129,909,096",
			"volumePercentage": "3.14%"
		},
		{
			"rank": "9",
			"exchange": "Binance",
			"type": "CEX",
			"pair": "SOL/FDUSD",
			"price": "$132.35",
			"volume24h": "$150,611,085",
			"volumePercentage": "3.64%"
		},
		{
			"rank": "10",
			"exchange": "Gate.io",
			"type": "CEX",
			"pair": "SOL/USDT",
			"price": "$132.09",
			"volume24h": "$98,974,151",
			"volumePercentage": "2.39%"
		}
	],
	"lastUpdated": "2025-04-15T11:47:43.664Z"
}
```

### Input parameters

The input schema for this Actor supports the following parameters:

| Field           | Type    | Description                                                                                                                                                                                                              |
| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `maxPages`      | integer | Maximum number of pages to scrape. Default is 10 pages (1000 cryptocurrencies).                                                                                                                                          |
| `scrapeDetails` | boolean | If enabled, the scraper will visit each cryptocurrency's detail page to extract additional information. This is more resource-intensive as it requires visiting each cryptocurrency page individually. Default is false. |

### Performance considerations

When `scrapeDetails` is enabled, the Actor needs to visit each cryptocurrency's individual page, which significantly increases the runtime and resource usage. For example:

- With `scrapeDetails = false`: Scraping 10 pages (1000 cryptocurrencies) requires only 10 HTTP requests.
- With `scrapeDetails = true`: Scraping 10 pages requires 10 + 1000 = 1010 HTTP requests.

Consider this when configuring the Actor for your needs.

### Expected Cost

This Actor uses a Pay-Per-Event (PPE) pricing model, which means you are charged based on the specific data elements scraped rather than compute time. Costs are transparent and proportional to the amount of data collected.

#### Pricing Structure

| Event Type                      | Description                                        | Price (USD) |
| ------------------------------- | -------------------------------------------------- | ----------- |
| Actor start                     | Flat fee for starting the Actor                    | $0.005      |
| Cryptocurrency scraped          | Cost per cryptocurrency scraped (basic data)       | $0.0002     |
| Detailed cryptocurrency scraped | Cost per cryptocurrency with detailed data scraped | $0.00125    |

#### Cost Scenarios

##### Default Run (10 Pages, No Details)

By default, the Actor scrapes 10 pages (100 cryptocurrencies per page, total of 1000 cryptocurrencies) with basic data only:

- Actor start: 1 × $0.005 = $0.005
- Cryptocurrency scraped: 1000 × $0.0002 = $0.200
- **Total estimated cost: $0.205**

##### Comprehensive Run (10 Pages, With Details)

For a comprehensive run with detailed data enabled and 10 pages (100 cryptocurrencies per page, total of 1000 cryptocurrencies):

- Actor start: 1 × $0.005 = $0.005
- Detailed cryptocurrency scraped: 1000 × $0.00125 = $1.250
- **Total estimated cost: $1.255**

### Data uses

The data extracted by this Actor can be used for:

- Cryptocurrency market analysis
- Price tracking and monitoring
- Building financial dashboards
- Investment research
- Data visualization projects

### Feature requests and bug reports

If you need additional data from CoinGecko that is not currently being scraped by this Actor or want to request any additional feature, please open an issue in the Apify platform. Describe the specific data points you need and their location on the website, and we'll consider implementing these features in future updates. Similarly, if you encounter any bugs or issues while using this Actor, please report them through the issue tracker with detailed steps to reproduce.

### Support the project

If you find this Actor useful, please consider:

- Rating it on the Apify platform
- Writing a review about your experience

Your feedback helps improve the Actor and guides future development priorities.

# Actor input Schema

## `maxPages` (type: `integer`):

Maximum number of pages to scrape, each page contains 100 cryptocurrencies. Default is 10 pages (1000 cryptocurrencies).

## `scrapeDetails` (type: `boolean`):

If enabled, the scraper will visit each cryptocurrency's detail page to extract additional information. This is more resource-intensive as it requires visiting each cryptocurrency page individually.

## Actor input object example

```json
{
  "maxPages": 10,
  "scrapeDetails": 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("real1ty/coingecko").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("real1ty/coingecko").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 real1ty/coingecko --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,real1ty/coingecko"
        }
    }
}

```

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/L2lXHypdE3O3H7TXr/builds/Uhg07viLhCMIMLxBk/openapi.json
