{"skill":{"slug":"cmc-api-dex","displayName":"[Outdated] CoinMarketCap Onchain Data","summary":"API reference for CoinMarketCap DEX endpoints including token lookup, pools, transactions, trending, and security analysis. Use this skill whenever the user...","description":"---\nname: cmc-api-dex\ndescription: |\n  API reference for CoinMarketCap DEX endpoints including token lookup, pools, transactions, trending, and security analysis.\n  Use this skill whenever the user mentions DEX API, asks about on-chain token data, wants to look up tokens by contract address, needs security/rug risk checks, or is building DEX integrations. This is the definitive reference for CMC DEX API questions.\n  Trigger: \"DEX API\", \"token by contract address\", \"CMC security API\", \"liquidity pool API\", \"/cmc-api-dex\"\nuser-invocable: true\nrequires-credentials:\n  - name: X-CMC_PRO_API_KEY\n    description: CoinMarketCap Pro API key for REST API access\n    obtain-from: https://pro.coinmarketcap.com/login\n    storage: User provides in API request headers\nallowed-tools:\n  - Bash\n  - Read\n---\n\n# CoinMarketCap DEX API\n\nThis skill covers CoinMarketCap's DEX (Decentralized Exchange) APIs for on-chain token data. Unlike CEX endpoints, these APIs fetch data directly from blockchain DEXs like Uniswap, PancakeSwap, and Raydium.\n\n## Authentication\n\nAll requests require an API key in the header:\n\n```bash\ncurl -X GET \"https://pro-api.coinmarketcap.com/v1/dex/platform/list\" \\\n  -H \"X-CMC_PRO_API_KEY: your-api-key\"\n```\n\nGet your API key at: https://pro.coinmarketcap.com/login\n\n## Base URL\n\n```\nhttps://pro-api.coinmarketcap.com\n```\n\n## POST vs GET Endpoints\n\nMany DEX endpoints use POST for complex queries with body parameters. Always check the method:\n\n1. GET endpoints pass parameters as query strings\n2. POST endpoints pass parameters in JSON body with `Content-Type: application/json`\n\n## Common Use Cases\n\nSee [use-cases.md](references/use-cases.md) for goal-based guidance on which endpoint to use:\n\n1. Get DEX token price by contract address\n2. Find a token's contract address by name\n3. Get prices for multiple tokens at once\n4. Check token security before trading\n5. Find liquidity pools for a token\n6. Find trending DEX tokens\n7. Find today's biggest DEX gainers\n8. Find newly launched tokens\n9. Detect potential rug pulls (liquidity removal)\n10. Get recent trades for a token\n11. Get supported networks and DEXs\n12. Get meme coins\n\n## API Overview\n\n| Endpoint | Method | Description | Reference |\n|----------|--------|-------------|-----------|\n| /v1/dex/token | GET | Token details by platform/address | [tokens.md](references/tokens.md) |\n| /v1/dex/token/price | GET | Latest DEX price for a token | [tokens.md](references/tokens.md) |\n| /v1/dex/token/price/batch | POST | Batch token prices | [tokens.md](references/tokens.md) |\n| /v1/dex/token/pools | GET | Liquidity pools for a token | [tokens.md](references/tokens.md) |\n| /v1/dex/token-liquidity/query | GET | Token liquidity over time | [tokens.md](references/tokens.md) |\n| /v1/dex/tokens/batch-query | POST | Batch token metadata | [tokens.md](references/tokens.md) |\n| /v1/dex/tokens/transactions | GET | Recent DEX transactions | [tokens.md](references/tokens.md) |\n| /v1/dex/tokens/trending/list | POST | Trending DEX tokens | [tokens.md](references/tokens.md) |\n| /v4/dex/pairs/quotes/latest | GET | Latest DEX pair quotes | [pairs.md](references/pairs.md) |\n| /v4/dex/spot-pairs/latest | GET | DEX spot pairs listing | [pairs.md](references/pairs.md) |\n| /v1/dex/platform/list | GET | List supported DEX platforms | [platforms.md](references/platforms.md) |\n| /v1/dex/platform/detail | GET | Platform details | [platforms.md](references/platforms.md) |\n| /v1/dex/search | GET | Search DEX tokens/pairs | [platforms.md](references/platforms.md) |\n| /v1/dex/gainer-loser/list | POST | Top DEX gainers/losers | [discovery.md](references/discovery.md) |\n| /v1/dex/liquidity-change/list | GET | Tokens with liquidity changes | [discovery.md](references/discovery.md) |\n| /v1/dex/meme/list | POST | Meme tokens on DEX | [discovery.md](references/discovery.md) |\n| /v1/dex/new/list | POST | Newly discovered DEX tokens | [discovery.md](references/discovery.md) |\n| /v1/dex/security/detail | GET | Token security/risk signals | [security.md](references/security.md) |\n\n## Common Workflows\n\n### Get DEX Token Information\n\n1. Search for token: `/v1/dex/search?keyword=PEPE`\n2. Get token details: `/v1/dex/token?network_slug=ethereum&contract_address=0x...`\n3. Check security risks: `/v1/dex/security/detail?network_slug=ethereum&contract_address=0x...`\n\n### Analyze Token Liquidity\n\n1. Get token pools: `/v1/dex/token/pools?network_slug=ethereum&contract_address=0x...`\n2. Get liquidity history: `/v1/dex/token-liquidity/query?network_slug=ethereum&contract_address=0x...`\n\n### Find Trending Tokens\n\n1. Get trending tokens: POST `/v1/dex/tokens/trending/list` with filters\n2. Get gainers/losers: POST `/v1/dex/gainer-loser/list`\n3. Find new tokens: POST `/v1/dex/new/list`\n\n### Monitor DEX Activity\n\n1. Get recent transactions: `/v1/dex/tokens/transactions?network_slug=ethereum&contract_address=0x...`\n2. Get pair quotes: `/v4/dex/pairs/quotes/latest?network_slug=ethereum&contract_address=0x...`\n\n## Key Parameters\n\nMost DEX endpoints require:\n\n1. `network_slug` or `platform_crypto_id`: Identifies the blockchain (ethereum, solana, bsc)\n2. `contract_address`: The token's on-chain contract address\n\nUse `/v1/dex/platform/list` to get valid network slugs and platform IDs.\n\n## Error Handling\n\n| Code | Meaning |\n|------|---------|\n| 400 | Bad request (invalid parameters) |\n| 401 | Unauthorized (invalid or missing API key) |\n| 403 | Forbidden (endpoint not in your plan) |\n| 429 | Rate limit exceeded |\n| 500 | Server error |\n\nExample error response:\n\n```json\n{\n  \"status\": {\n    \"error_code\": 400,\n    \"error_message\": \"Invalid value for 'contract_address'\"\n  }\n}\n```\n\n## Rate Limits\n\nRate limits depend on your API plan. Check response headers:\n\n1. `X-CMC_PRO_API_KEY_CREDITS_REMAINING`: Credits left\n2. `X-CMC_PRO_API_KEY_CREDITS_RESET`: Reset timestamp\n\n## Response Format\n\nAll responses follow this structure:\n\n```json\n{\n  \"status\": {\n    \"timestamp\": \"2024-01-15T12:00:00.000Z\",\n    \"error_code\": 0,\n    \"error_message\": null\n  },\n  \"data\": { ... }\n}\n```\n","tags":{"latest":"1.0.1","archive":"1.0.0"},"stats":{"comments":0,"downloads":811,"installsAllTime":1,"installsCurrent":1,"stars":0,"versions":2},"createdAt":1772454185624,"updatedAt":1778994524444},"latestVersion":{"version":"1.0.1","createdAt":1772468788809,"changelog":"Use https://clawhub.ai/bryan-cmc/cmc-api-onchain-data for the latest onchain data skill.","license":null},"metadata":null,"owner":{"handle":"bryan-cmc","userId":"s17bca3zner64rbfxfnh3vp5s183nv6n","displayName":"CoinMarketCap","image":"https://avatars.githubusercontent.com/u/158990050?v=4"},"moderation":null}