# CoinMarketCap Listings Scraper (`marcomigozzi/coinmarketcap-listings-scraper`) Actor

Extract cryptocurrency market data from CoinMarketCap including trending cryptocurrencies, gainers/losers, and recently added tokens. Gets prices, market caps, volumes, percentage changes, and logo URLs.

- **URL**: https://apify.com/marcomigozzi/coinmarketcap-listings-scraper.md
- **Developed by:** [Marco Migozzi](https://apify.com/marcomigozzi) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Full permissions
- **Stats:** 3 total users, 3 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 results

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## CoinMarketCap Listings Scraper for Apify

A powerful Selenium-based web scraper for CoinMarketCap that extracts cryptocurrency market data from three different sections: Trending Cryptocurrencies, Gainers/Losers, and Recently Added cryptocurrencies.

### 🚀 Features

- **Three Data Sources**: Scrapes data from multiple CoinMarketCap sections
- **Comprehensive Data**: Extracts prices, market caps, volumes, percentage changes, logos, and more
- **Smart Classification**: Automatically categorizes gainers vs losers
- **Logo URLs**: Includes cryptocurrency and blockchain logo URLs
- **Robust Error Handling**: Continues processing even if individual rows fail
- **Selenium-based**: Uses headless Chrome for reliable scraping

### 📊 Data Sources

#### 1. Trending Cryptocurrencies

**URL**: `https://coinmarketcap.com/trending-cryptocurrencies/`

**Data Extracted**:

- Position
- Symbol
- Name
- Logo URL
- Price
- 24h % Change
- 7d % Change
- 30d % Change
- Market Cap
- Volume 24H

#### 2. Gainers & Losers

**URL**: `https://coinmarketcap.com/gainers-losers/`

**Data Extracted**:

- Ranking
- Symbol
- Name
- Logo URL
- Price
- 24h % Change
- Volume 24H
- Type (gainer/loser)

#### 3. Recently Added

**URL**: `https://coinmarketcap.com/new/`

**Data Extracted**:

- Position
- Symbol
- Name
- Logo URL
- Price
- 1h % Change
- 24h % Change
- Fully Diluted Market Cap
- Volume
- Blockchain
- Blockchain Logo URL
- Added (time)

### 🔧 Input Configuration

The actor accepts a single input parameter:

```json
{
  "type": "trending"
}
```

**Valid types**:

- `"trending"` - Scrapes trending cryptocurrencies
- `"gl"` - Scrapes gainers and losers (both tables)
- `"recently"` - Scrapes recently added cryptocurrencies

### 📤 Output Format

#### Trending Output Example

```json
{
  "position": "1",
  "symbol": "ETH",
  "name": "Ethereum",
  "logo_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png",
  "price": "$4,652.06",
  "change_24h": "8.37%",
  "change_7d": "28.40%",
  "change_30d": "52.11%",
  "market_cap": "$561,543,737,841",
  "volume_24h": "$64,585,962,733"
}
```

#### Gainers/Losers Output Example

```json
{
  "ranking": "66",
  "symbol": "FORM",
  "name": "Four",
  "logo_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/23635.png",
  "price": "$3.80",
  "change_24h": "-0.86%",
  "volume_24h": "$12,613,060",
  "type": "loser"
}
```

#### Recently Added Output Example

```json
{
  "position": "1",
  "symbol": "SKITTEN",
  "name": "SKITTEN",
  "logo_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/37701.png",
  "price": "$0.001118",
  "change_1h": "-0.01%",
  "change_24h": "0.72%",
  "fully_diluted_market_cap": "$1,108,034",
  "volume": "$58,284",
  "blockchain": "Base",
  "blockchain_logo_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/27716.png",
  "added": "1 hours ago"
}
```

### 🎯 Use Cases

- **Market Analysis**: Track trending cryptocurrencies and market movements
- **Trading Signals**: Monitor gainers/losers for trading opportunities
- **New Token Discovery**: Stay updated with recently added cryptocurrencies
- **Portfolio Management**: Get comprehensive market data for decision making
- **Research**: Analyze cryptocurrency market trends and patterns

### 🔒 Rate Limiting & Best Practices

- Uses appropriate delays between requests
- Implements robust error handling
- Respects CoinMarketCap's structure and styling
- Uses headless Chrome for reliable rendering

### 🛠 Technical Details

- **Runtime**: Python 3.11+
- **Browser**: Headless Chrome
- **Framework**: Selenium WebDriver
- **Platform**: Apify Cloud
- **Output**: JSON dataset

### 📝 Notes

- Percentage changes correctly handle negative values with proper signs
- Logo URLs are high-resolution (64x64px) official images
- The actor extracts from both gainers and losers tables automatically
- Recently added cryptocurrencies include blockchain information and logos
- All monetary values are formatted as displayed on CoinMarketCap

### 🚨 Disclaimer

This actor is for educational and research purposes. Please respect CoinMarketCap's terms of service and use responsibly. The data extracted is publicly available information displayed on the website.

### 📞 Support

For issues, feature requests, or questions about this actor, please contact the developer or submit an issue in the project repository.

# Changelog

This Actor's version history is a separate document: https://apify.com/marcomigozzi/coinmarketcap-listings-scraper/changelog.md

# Actor input Schema

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

Select which CoinMarketCap data to scrape: Trending cryptocurrencies, Gainers/Losers, or Recently Added cryptocurrencies

## Actor input object example

```json
{
  "type": "trending"
}
```

# 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("marcomigozzi/coinmarketcap-listings-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("marcomigozzi/coinmarketcap-listings-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 marcomigozzi/coinmarketcap-listings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,marcomigozzi/coinmarketcap-listings-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/tJoQxqfp3Lt6ucfM1/builds/P8KrIJMScbtnaLTjq/openapi.json
