# 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:** 5 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## 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 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

## 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

Download the OpenAPI definition: https://api.apify.com/v2/actors/2RPObsTL0dTOCCYai/builds/wEZfw3qimWmoSnMpd/openapi.json
