> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moralis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Get Token Pairs and Liquidity Data

> Learn how to fetch trading pairs and liquidity information for any ERC20 token using the Moralis API.

## Introduction

In this tutorial, you'll learn how to retrieve all trading pairs and liquidity data for any ERC20 token using the Moralis API. This includes pair addresses, liquidity amounts, volume data, and exchange information. This is essential for building token analytics, DEX aggregators, or trading interfaces. We'll use the following Moralis API endpoint:

* [Get Token Pairs](/data-api/evm/token/swaps/token-pairs) - Fetch all trading pairs and liquidity data for a token

## Prerequisites

* Node.js v18+ installed
* A Moralis API key ([get one free](https://admin.moralis.io))

## Step 1: Set Up Your Project

Create a new directory for your project and initialize it:

```bash theme={null}
mkdir get-token-pairs && cd get-token-pairs
npm init -y
```

## Step 2: Create the Script

Create a file called `index.js` and add the following code:

```javascript theme={null}
// index.js
const API_KEY = 'YOUR_API_KEY';
const TOKEN_ADDRESS = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'; // USDC

async function getTokenPairs() {
  const response = await fetch(
    `https://deep-index.moralis.io/api/v2.2/erc20/${TOKEN_ADDRESS}/pairs?chain=eth`,
    {
      headers: {
        'X-API-Key': API_KEY,
      },
    }
  );

  const data = await response.json();
  console.log(JSON.stringify(data, null, 2));
}

getTokenPairs();
```

Replace `YOUR_API_KEY` with your actual Moralis API key.

## Step 3: Run the Script

Execute the script to fetch the token pairs:

```bash theme={null}
node index.js
```

## Example Response

```json theme={null}
{
  "page": 1,
  "page_size": 100,
  "cursor": null,
  "result": [
    {
      "pairAddress": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
      "pairLabel": "WETH/USDC",
      "exchange": "uniswapv3",
      "exchangeAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984",
      "exchangeLogo": "https://cdn.moralis.io/eth/0x1f98431c8ad98523631ae4a59f267346ea31f984.png",
      "token0": {
        "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "name": "USD Coin",
        "symbol": "USDC",
        "decimals": 6,
        "logo": "https://cdn.moralis.io/eth/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png"
      },
      "token1": {
        "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "name": "Wrapped Ether",
        "symbol": "WETH",
        "decimals": 18,
        "logo": "https://cdn.moralis.io/eth/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
      },
      "usdPrice": 3500.50,
      "usdPriceFormatted": "3500.50",
      "liquidityUsd": 250000000,
      "volume24h": 15000000,
      "priceChange24h": 2.5
    }
  ]
}
```

## Understanding the Response

| Field               | Description                                |
| ------------------- | ------------------------------------------ |
| `pairAddress`       | The liquidity pair contract address        |
| `pairLabel`         | Human-readable pair name (e.g., WETH/USDC) |
| `exchange`          | DEX name (uniswapv2, uniswapv3, sushiswap) |
| `token0` / `token1` | Token metadata for both sides of the pair  |
| `usdPrice`          | Current price in USD                       |
| `liquidityUsd`      | Total liquidity in USD                     |
| `volume24h`         | 24-hour trading volume in USD              |
| `priceChange24h`    | 24-hour price change percentage            |

## Next Steps

* [Get OHLC Data](/get-started/tutorials/data-api/prices-and-charts/get-historical-erc-20-token-prices-ohlc-data) - Get price history
* [Get Pair Stats](/data-api/evm/token/swaps/pair-stats) - detailed market data
* [Build a DEX Screener](/get-started/tutorials/data-api/tokens-and-markets/build-a-dex-screener-clone) - Build a trading dashboard
* [API Reference](/data-api/evm/token/overview) - Full API documentation
