# CoinMarketCap Scraper (`shahidirfan/coinmarketcap-scraper`) Actor

Scrape real-time crypto prices, market cap & rankings from CoinMarketCap. Extract Bitcoin, Ethereum, altcoins & 10K+ assets instantly. Built for traders, DeFi platforms & analysis bots. Bypass API rate limits with reliable web scraping.

- **URL**: https://apify.com/shahidirfan/coinmarketcap-scraper.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, NaN 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

## CoinMarketCap Scraper

Extract cryptocurrency listings from CoinMarketCap in a clean, structured dataset for research, monitoring, and market analysis.

### Features

- **Comprehensive listings** - Collect ranked cryptocurrency records with pricing, market cap, volume, supply, and performance fields.
- **Flexible input mode** - Run with a CoinMarketCap URL, a keyword filter, or both.
- **Pagination control** - Limit requests with `max_pages` and control output size with `results_wanted`.
- **Clean dataset output** - Removes null and empty values before storing each item.
- **Deduplicated records** - Prevents duplicate coin entries in the final dataset.

### Use Cases

#### Market Monitoring
Track top assets and price movement snapshots on a schedule for ongoing market visibility.

#### Portfolio Research
Collect standardized market fields to compare assets by rank, liquidity, and supply metrics.

#### Data Pipelines
Feed fresh listing data into dashboards, BI tools, automations, or alerting workflows.

---

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `url` | String | No | `https://coinmarketcap.com/all/views/all/` | Any CoinMarketCap listing URL to anchor the run. |
| `keyword` | String | No | `bitcoin` | Optional filter by coin name, symbol, slug, or tag. |
| `results_wanted` | Integer | No | `20` | Maximum number of rows to save. |
| `max_pages` | Integer | No | `5` | Maximum number of listing pages to request. |
| `sortBy` | String | No | `market_cap` | Sort field. |
| `proxyConfiguration` | Object | No | `{ "useApifyProxy": false }` | Optional Apify proxy setup. |

Internal runtime defaults:
- Sort order is fixed to `desc`.
- Quote currency is fixed to `USD`.
- API page size is fixed to `100`.

---

### Output Data

Each dataset item can include:

| Field | Type | Description |
|-------|------|-------------|
| `id` | Integer | CoinMarketCap coin ID |
| `cmc_rank` | Integer | Current market rank |
| `name` | String | Coin name |
| `symbol` | String | Ticker symbol |
| `slug` | String | URL slug |
| `tags` | Array | Coin tags |
| `badges` | Array | Coin badges |
| `market_pair_count` | Integer | Number of market pairs |
| `circulating_supply` | Number | Circulating supply |
| `self_reported_circulating_supply` | Number | Self-reported circulating supply |
| `total_supply` | Number | Total supply |
| `max_supply` | Number | Max supply |
| `date_added` | String | Asset listing date |
| `last_updated` | String | Asset update timestamp |
| `is_active` | Integer | Active state |
| `is_audited` | Boolean | Audit state |
| `quote_currency` | String | Quote currency used |
| `price` | Number | Current price |
| `volume_24h` | Number | 24h volume |
| `volume_change_24h` | Number | 24h volume change |
| `market_cap` | Number | Market capitalization |
| `market_cap_by_total_supply` | Number | Market cap by total supply |
| `fully_diluted_market_cap` | Number | Fully diluted market cap |
| `percent_change_1h` | Number | 1h change |
| `percent_change_24h` | Number | 24h change |
| `percent_change_7d` | Number | 7d change |
| `percent_change_30d` | Number | 30d change |
| `percent_change_60d` | Number | 60d change |
| `percent_change_90d` | Number | 90d change |
| `percent_change_1y` | Number | 1y change |
| `dominance` | Number | Market dominance |
| `turnover` | Number | Turnover ratio |
| `ytd_price_change_percentage` | Number | Year-to-date price change |
| `quote_last_updated` | String | Quote timestamp |
| `coin_url` | String | Coin page URL |

---

### Usage Examples

#### Basic Run

```json
{
  "url": "https://coinmarketcap.com/all/views/all/",
  "results_wanted": 20
}
````

#### Keyword Filtering

```json
{
  "url": "https://coinmarketcap.com/all/views/all/",
  "keyword": "eth",
  "results_wanted": 50,
  "max_pages": 10
}
```

#### Custom Sorting

```json
{
  "url": "https://coinmarketcap.com/all/views/all/?page=2",
  "sortBy": "volume_24h",
  "results_wanted": 100,
  "max_pages": 5
}
```

***

### Sample Output

```json
{
  "id": 1,
  "cmc_rank": 1,
  "name": "Bitcoin",
  "symbol": "BTC",
  "slug": "bitcoin",
  "market_pair_count": 12326,
  "circulating_supply": 19872778,
  "total_supply": 19872778,
  "max_supply": 21000000,
  "price": 110588.94313277966,
  "volume_24h": 68565612484.21353,
  "market_cap": 2197962364601.5906,
  "percent_change_24h": 3.45776338,
  "quote_currency": "USD",
  "coin_url": "https://coinmarketcap.com/currencies/bitcoin/"
}
```

***

### Tips For Best Results

#### Use Real Listing URLs

- Use CoinMarketCap listing URLs so sorting and pagination context stays consistent.
- Start with the default `all/views/all` page for complete coverage.

#### Keep QA-Friendly Defaults

- Keep `results_wanted` near `20` for quick validation runs.
- Increase `results_wanted` and `max_pages` for production collection.

#### Manage Throughput

- Use proxy settings if your network needs additional request stability.
- Scale gradually and monitor result counts in each run.

***

### Integrations

Connect output datasets with:

- **Google Sheets** - Create analysis sheets and reports.
- **Airtable** - Build searchable asset tables.
- **Make** - Automate downstream workflows.
- **Zapier** - Trigger alerts and notifications.
- **Webhooks** - Push records to custom services.

#### Export Formats

- **JSON** - Best for APIs and engineering workflows.
- **CSV** - Best for spreadsheet analysis.
- **Excel** - Best for business reporting.
- **XML** - Best for legacy integrations.

***

### Frequently Asked Questions

#### Can I run with only a keyword?

Yes. If no URL is provided, the scraper uses the default CoinMarketCap all-listings page.

#### Can I run with only a URL?

Yes. A URL alone is enough to run the scraper.

#### Will user input override defaults?

Yes. Values sent in the run input always take priority.

#### Why are some fields missing on some rows?

Not every asset includes every market field at every moment; empty fields are removed from output.

#### Can I collect more than one page?

Yes. Increase `max_pages` and `results_wanted`.

***

### Support

For issues or feature requests, contact support through the Apify Console.

#### Resources

- [Apify Documentation](https://docs.apify.com/)
- [API Reference](https://docs.apify.com/api/v2)
- [Scheduling Runs](https://docs.apify.com/platform/schedules)

***

### Legal Notice

This actor is designed for legitimate data collection and analysis use. You are responsible for complying with website terms and applicable laws in your jurisdiction.

# Actor input Schema

## `url` (type: `string`):

Any CoinMarketCap listing URL. Example: https://coinmarketcap.com/all/views/all/

## `keyword` (type: `string`):

Optional filter by coin name, symbol, slug, or tag.

## `results_wanted` (type: `integer`):

Maximum number of rows to return.

## `max_pages` (type: `integer`):

Safety cap for listing page requests.

## `sortBy` (type: `string`):

Sorting field.

## `proxyConfiguration` (type: `object`):

Use Apify Proxy if needed.

## Actor input object example

```json
{
  "url": "https://coinmarketcap.com/all/views/all/",
  "keyword": "bitcoin",
  "results_wanted": 20,
  "max_pages": 5,
  "sortBy": "market_cap",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "url": "https://coinmarketcap.com/all/views/all/",
    "keyword": "bitcoin",
    "results_wanted": 20,
    "max_pages": 5,
    "sortBy": "market_cap"
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/coinmarketcap-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 = {
    "url": "https://coinmarketcap.com/all/views/all/",
    "keyword": "bitcoin",
    "results_wanted": 20,
    "max_pages": 5,
    "sortBy": "market_cap",
}

# Run the Actor and wait for it to finish
run = client.actor("shahidirfan/coinmarketcap-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 '{
  "url": "https://coinmarketcap.com/all/views/all/",
  "keyword": "bitcoin",
  "results_wanted": 20,
  "max_pages": 5,
  "sortBy": "market_cap"
}' |
apify call shahidirfan/coinmarketcap-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CoinMarketCap Scraper",
        "description": "Scrape real-time crypto prices, market cap & rankings from CoinMarketCap. Extract Bitcoin, Ethereum, altcoins & 10K+ assets instantly. Built for traders, DeFi platforms & analysis bots. Bypass API rate limits with reliable web scraping.",
        "version": "0.0",
        "x-build-id": "wEZfw3qimWmoSnMpd"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/shahidirfan~coinmarketcap-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-shahidirfan-coinmarketcap-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/shahidirfan~coinmarketcap-scraper/runs": {
            "post": {
                "operationId": "runs-sync-shahidirfan-coinmarketcap-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/shahidirfan~coinmarketcap-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-shahidirfan-coinmarketcap-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": {
                    "url": {
                        "title": "CoinMarketCap URL",
                        "type": "string",
                        "description": "Any CoinMarketCap listing URL. Example: https://coinmarketcap.com/all/views/all/"
                    },
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Optional filter by coin name, symbol, slug, or tag."
                    },
                    "results_wanted": {
                        "title": "Results wanted",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of rows to return.",
                        "default": 20
                    },
                    "max_pages": {
                        "title": "Max pages",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Safety cap for listing page requests.",
                        "default": 5
                    },
                    "sortBy": {
                        "title": "Sort by",
                        "enum": [
                            "market_cap",
                            "cmc_rank",
                            "name",
                            "price",
                            "volume_24h",
                            "percent_change_24h"
                        ],
                        "type": "string",
                        "description": "Sorting field.",
                        "default": "market_cap"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Use Apify Proxy if needed.",
                        "default": {
                            "useApifyProxy": 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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
