DEX API
GitHub repo: coinmarketcap-official/skills-for-ai-agents-by-CoinMarketCap
On-chain token data APIs for decentralized exchanges like Uniswap, PancakeSwap, and Raydium.
Authentication
Code
Get your API key at https://pro.coinmarketcap.com/login
Base URL: https://pro-api.coinmarketcap.com
Writing code: use the official SDKs
When you want a script, an app or an integration rather than a one-off lookup, the skill tells your agent to write it with the official SDKs instead of raw HTTP or a third-party wrapper: @coinmarketcap/sdk (npm install @coinmarketcap/sdk), coinmarketcap-sdk (pip install coinmarketcap-sdk) and the Go SDK (go get github.com/OpenCMC/coinmarketcap-api-go/v5).
Code
Code
Code
The skill's references/sdk.md lists the SDK method for every endpoint below and which ones also work without an API key.
POST vs GET Endpoints
Many DEX endpoints use POST for complex queries with body parameters:
- GET endpoints pass parameters as query strings
- POST endpoints pass parameters in JSON body with
Content-Type: application/json
API Overview
| Endpoint | Method | Description |
|---|---|---|
| /v1/dex/token | GET | Token details by platform/address |
| /v1/dex/token/price | GET | Latest DEX price for a token |
| /v1/dex/token/price/batch | POST | Batch token prices |
| /v1/dex/token/pools | GET | Liquidity pools for a token |
| /v1/dex/token-liquidity/query | GET | Token liquidity over time |
| /v1/dex/tokens/batch-query | POST | Batch token metadata |
| /v1/dex/tokens/transactions | GET | Recent DEX transactions |
| /v1/dex/tokens/trending/list | POST | Trending DEX tokens |
| /v4/dex/pairs/quotes/latest | GET | Latest DEX pair quotes |
| /v4/dex/spot-pairs/latest | GET | DEX spot pairs listing |
| /v1/dex/platform/list | GET | List supported DEX platforms |
| /v1/dex/platform/detail | GET | Platform details |
| /v1/dex/search | GET | Search DEX tokens/pairs |
| /v1/dex/gainer-loser/list | POST | Top DEX gainers/losers |
| /v1/dex/liquidity-change/list | GET | Tokens with liquidity changes |
| /v1/dex/meme/list | POST | Meme tokens on DEX |
| /v1/dex/new/list | POST | Newly discovered DEX tokens |
| /v1/dex/security/detail | GET | Token security/risk signals |
Common Workflows
Get DEX Token Information
- Search for token:
/v1/dex/search?keyword=PEPE - Get token details:
/v1/dex/token?network_slug=ethereum&contract_address=0x... - Check security risks:
/v1/dex/security/detail?network_slug=ethereum&contract_address=0x...
Analyze Token Liquidity
- Get token pools:
/v1/dex/token/pools?network_slug=ethereum&contract_address=0x... - Get liquidity history:
/v1/dex/token-liquidity/query?network_slug=ethereum&contract_address=0x...
Find Trending Tokens
- Get trending tokens: POST
/v1/dex/tokens/trending/listwith filters - Get gainers/losers: POST
/v1/dex/gainer-loser/list - Find new tokens: POST
/v1/dex/new/list
Key Parameters
Most DEX endpoints require:
network_slugorplatform_crypto_id: Identifies the blockchain (ethereum, solana, bsc)contract_address: The token's on-chain contract address
Use /v1/dex/platform/list to get valid network slugs and platform IDs.
Common Use Cases
- Get DEX token price by contract address
- Find a token's contract address by name
- Get prices for multiple tokens at once
- Check token security before trading
- Find liquidity pools for a token
- Find trending DEX tokens
- Find today's biggest DEX gainers
- Find newly launched tokens
- Detect potential rug pulls (liquidity removal)
- Get recent trades for a token
- Get supported networks and DEXs
- Get meme coins