# Dexscreener Pair Scraper (`crypto-scraper/dexscreener-pair-scraper`) Actor

A powerful scraper that scrapes real-time data for any token pair from DexScreener. Get prices, liquidity, volume, transaction data, contract addresses, and social links in a clean JSON format.

- **URL**: https://apify.com/crypto-scraper/dexscreener-pair-scraper.md
- **Developed by:** [Crypto Scraper](https://apify.com/crypto-scraper) (community)
- **Categories:** Integrations, Other, Developer tools
- **Stats:** 22 total users, 1 monthly users, 100.0% runs succeeded, 1 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/actors/running/actors-in-store.md#pay-per-usage

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

## 🚀 DexScreener Pair Scraper

Unlock the power of **real-time pair data** from DexScreener with this powerful Apify Actor. For traders, developers, and crypto enthusiasts, this tool provides detailed insights into any trading pair, helping you make informed decisions and stay ahead of the market.

### Why Choose DexScreener Pair Scraper?

For those who need a granular view of token pairs, this Actor is your go-to solution. It extracts comprehensive data, from liquidity and volume to social links and contract addresses, giving you a complete picture of any pair's activity.

### 💎 Key Benefits

- **Deep Dive into Pairs**: Get detailed information on specific token pairs, not just individual tokens.
- **Real-Time Data**: Access up-to-the-minute data to inform your trading strategies.
- **Comprehensive Insights**: Collect everything from price action and liquidity to social media links and contract addresses.
- **Seamless Integration**: Export clean, structured JSON data that's ready for your analytics tools, dashboards, or custom applications.

### 🌐 Multi-Blockchain Coverage

This Actor can scrape pair data from any blockchain supported by DexScreener, including:

- **Ethereum (ETH)**
- **Binance Smart Chain (BSC)**
- **Solana (SOL)**
- **Polygon (MATIC)**
- **Avalanche (AVAX)**
- **Fantom (FTM)**
- **...and many more!**

### 📊 Comprehensive Data Fields

When you run the Actor, you’ll receive a detailed JSON output with the following fields:

- **URL**: The DexScreener URL of the pair.
- **Token Name, Symbol, and Base Token Symbol**: Identifiers for the tokens in the pair.
- **Price Data**: Prices in both USD and the native token.
- **Liquidity, FDV, and Market Cap**: Key financial metrics.
- **Price Changes**: 5-minute, 1-hour, 6-hour, and 24-hour price percentage changes.
- **24-Hour Stats**: Transaction counts, volume, and maker counts.
- **Buy/Sell Data**: Detailed breakdown of buy/sell volumes and unique buyer/seller counts.
- **Contract Addresses**: Pair, token, and base token addresses.
- **Social Links**: Website, Twitter, and Telegram links for the token.

### 📝 Input Parameters

The Actor accepts two input parameters:

1. **`urls`** - An array of strings containing direct DexScreener URLs
2. **`tokens`** - An array of objects for token configurations (chain + pair address)

#### Input Structure

| Property | Type   | Required | Description |
|----------|--------|----------|-------------|
| `urls`   | array  | No       | List of full DexScreener URLs to scrape. |
| `tokens` | array  | No       | List of token configurations with chain and pair address. |

##### Token Configuration Object

| Key            | Type   | Required | Description |
|----------------|--------|----------|-------------|
| `chain`        | string | Yes      | The blockchain of the pair (e.g., `solana`, `ethereum`). |
| `pairAddress`  | string | Yes      | The address of the token pair. |

#### Example Input

##### Using URLs

```json
{
  "urls": [
    "https://dexscreener.com/solana/9yxd9lg6n7kszfi56qj1ge6limjiuviqpsj8zca6reyh",
    "https://dexscreener.com/ethereum/0x1234567890abcdef"
  ]
}
```

##### Using Token Configurations

```json
{
  "tokens": [
    {
      "chain": "solana",
      "pairAddress": "9yxd9lg6n7kszfi56qj1ge6limjiuviqpsj8zca6reyh"
    },
    {
      "chain": "ethereum", 
      "pairAddress": "0x1234567890abcdef"
    }
  ]
}
```

##### Combined Usage

```json
{
  "urls": [
    "https://dexscreener.com/solana/9yxd9lg6n7kszfi56qj1ge6limjiuviqpsj8zca6reyh"
  ],
  "tokens": [
    {
      "chain": "ethereum",
      "pairAddress": "0x1234567890abcdef"
    }
  ]
}
```

##### Default Behavior

If no input is provided, the Actor will scrape a default Solana pair as an example.

### 📈 Example Output Structure

```json
{
  "url": "https://dexscreener.com/solana/9yxd9lg6n7kszfi56qj1ge6limjiuviqpsj8zca6reyh",
  "token_name": "airfryer coin",
  "token_symbol": "AIRFRY",
  "base_token_symbol": "SOL",
  "price_usd": 0.0006539,
  "price_native": "0.053313",
  "liquidity": 104000.0,
  "fdv": 653000.0,
  "mkt_cap": 653000.0,
  "change_5m": 0.0135,
  "change_1h": 0.0572,
  "change_6h": 0.2112,
  "change_24h": 2.01,
  "txns_24h": 40744,
  "volume_24h": 3900000.0,
  "makers_24h": 12475,
  "buys_24h": 23119,
  "sells_24h": 17625,
  "buy_vol_24h": 1900000.0,
  "sell_vol_24h": 1900000.0,
  "buyers_24h": 10960,
  "sellers_24h": 8295,
  "pair_created": "DEX",
  "pooled_token": "SOL",
  "pooled_base_token": "So11111111111111111111111111111111111111112",
  "pair_address": "9Yxd9LG6n7KszFi56QJ1GE6LiMjiuviqPSJ8ZcA6reyh",
  "token_address": "4qTJV18HH5YUz9KSAdGEnVQuxPkR9c4gDwV7TaMxbonk",
  "website": "https://www.airfryercoin.com",
  "twitter": "https://x.com/airfryercoin",
  "telegram": "https://t.me/airfryersolana"
}
```

### 🔍 TypeScript Type

```typescript
interface PairData {
  url: string;
  token_name?: string;
  token_symbol?: string;
  base_token_symbol?: string;
  price_usd?: number;
  price_native?: string;
  liquidity?: number;
  fdv?: number;
  mkt_cap?: number;
  change_5m?: number;
  change_1h?: number;
  change_6h?: number;
  change_24h?: number;
  txns_24h?: number;
  volume_24h?: number;
  makers_24h?: number;
  buys_24h?: number;
  sells_24h?: number;
  buy_vol_24h?: number;
  sell_vol_24h?: number;
  buyers_24h?: number;
  sellers_24h?: number;
  pair_created?: string;
  pooled_token?: string;
  pooled_base_token?: string;
  pair_address?: string;
  token_address?: string;
  website?: string;
  twitter?: string;
  telegram?: string;
}
```

### 🐍 Pydantic Model

```python
from pydantic import BaseModel
from typing import Optional

class PairData(BaseModel):
    url: str
    token_name: Optional[str] = None
    token_symbol: Optional[str] = None
    base_token_symbol: Optional[str] = None
    price_usd: Optional[float] = None
    price_native: Optional[str] = None
    liquidity: Optional[float] = None
    fdv: Optional[float] = None
    mkt_cap: Optional[float] = None
    change_5m: Optional[float] = None
    change_1h: Optional[float] = None
    change_6h: Optional[float] = None
    change_24h: Optional[float] = None
    txns_24h: Optional[int] = None
    volume_24h: Optional[float] = None
    makers_24h: Optional[int] = None
    buys_24h: Optional[int] = None
    sells_24h: Optional[int] = None
    buy_vol_24h: Optional[float] = None
    sell_vol_24h: Optional[float] = None
    buyers_24h: Optional[int] = None
    sellers_24h: Optional[int] = None
    pair_created: Optional[str] = None
    pooled_token: Optional[str] = None
    pooled_base_token: Optional[str] = None
    pair_address: Optional[str] = None
    token_address: Optional[str] = None
    website: Optional[str] = None
    twitter: Optional[str] = None
    telegram: Optional[str] = None
```

### 🚀 Get Started

Simply provide a DexScreener pair URL to the Actor and run it. You'll get a detailed JSON output with all the information you need to analyze the pair's performance and potential.

# Actor input Schema

## `urls` (type: `array`):

List of dexscreener.com URLs to scrape

## `tokens` (type: `array`):

Token configurations to scrape (chain + pair address)

## Actor input object example

```json
{
  "urls": [
    "https://dexscreener.com/solana/9yxd9lg6n7kszfi56qj1ge6limjiuviqpsj8zca6reyh"
  ],
  "tokens": [
    {
      "chain": "solana",
      "pairAddress": "7rfmqpu8vgckj78gpuf4tnw83sp5dxwyay1jxc9j5hwb"
    }
  ]
}
```

# 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 = {
    "urls": [
        "https://dexscreener.com/solana/9yxd9lg6n7kszfi56qj1ge6limjiuviqpsj8zca6reyh"
    ],
    "tokens": [
        {
            "chain": "solana",
            "pairAddress": "7rfmqpu8vgckj78gpuf4tnw83sp5dxwyay1jxc9j5hwb"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("crypto-scraper/dexscreener-pair-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 = {
    "urls": ["https://dexscreener.com/solana/9yxd9lg6n7kszfi56qj1ge6limjiuviqpsj8zca6reyh"],
    "tokens": [{
            "chain": "solana",
            "pairAddress": "7rfmqpu8vgckj78gpuf4tnw83sp5dxwyay1jxc9j5hwb",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("crypto-scraper/dexscreener-pair-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 '{
  "urls": [
    "https://dexscreener.com/solana/9yxd9lg6n7kszfi56qj1ge6limjiuviqpsj8zca6reyh"
  ],
  "tokens": [
    {
      "chain": "solana",
      "pairAddress": "7rfmqpu8vgckj78gpuf4tnw83sp5dxwyay1jxc9j5hwb"
    }
  ]
}' |
apify call crypto-scraper/dexscreener-pair-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crypto-scraper/dexscreener-pair-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/pRFodAZ0O3yADhS9D/builds/WZqTtNYILcYSEqJcx/openapi.json
