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

# AI Agents & LLM Apps

> Power your AI agents and LLM applications with real-time crypto prices, trending market signals, coin metadata, and onchain token data across 250+ networks from CoinGecko API.

<Note>
  ### TL;DR

  Use the [CoinGecko MCP Server](/docs/mcp-server) for plug-and-play agent integration, [/simple/price](/reference/simple-price) for real-time price lookups, [/coins/markets](/reference/coins-markets) for bulk market context, [/search/trending](/reference/trending-search) for trending signals, and [/coins/\{id}](/reference/coins-id) for deep-dive coin research.
</Note>

<br />

**AI agents** and **LLM-powered applications** need reliable, structured crypto data to answer user questions, execute workflows, and generate insights - whether you're building a **conversational trading assistant**, a **market research copilot**, or an **autonomous agent pipeline** that reacts to **real-time market signals**.

This guide walks you through the CoinGecko API endpoints and integration methods that matter most for AI agent workflows, and ties them together into a [complete workflow](#putting-it-all-together) at the end:

* **MCP Server** to connect live crypto data directly to your agent pipeline
* **Trending coins and market data** to populate your LLM's context window with timely signals
* **Onchain token and pool data** across 250+ networks for DeFi-native agent capabilities
* **Structured coin metadata** for grounding agent responses with accurate fundamentals

Estimated reading time: **10 minutes**

<Tip>
  **Want to get started even faster?**<br />Copy the contents of this page from [ai-agents-llm-apps.md](https://docs.coingecko.com/docs/ai-agents-llm-apps.md) and paste it directly into your AI tool for instant context.
</Tip>

<Card title="Navigate the API faster with AI" icon="sparkles" href="https://docs.coingecko.com/skills">
  Install the CoinGecko SKILL to give your AI coding agent built-in knowledge of every endpoint, parameter, and workflow. Setup takes less than 3 minutes.
</Card>

***

## Endpoint Overview

| Endpoint                                                                       | What It Gives You                                                      | Best For                                           |
| ------------------------------------------------------------------------------ | ---------------------------------------------------------------------- | -------------------------------------------------- |
| [/simple/price](/reference/simple-price)                                       | Real-time prices with optional market cap, volume, and 24h change      | Quick price lookups in agent responses             |
| [/coins/markets](/reference/coins-markets)                                     | Bulk market data for multiple coins in a single call                   | Populating LLM context with market overview        |
| [/coins/\{id}](/reference/coins-id)                                            | Full coin metadata, supply, ATH, volume, community, and developer data | Deep-dive coin research for agent queries          |
| [/coins/list](/reference/coins-list)                                           | Complete list of all supported coins with IDs and symbols              | Resolving coin names to API IDs in agent pipelines |
| [/search/trending](/reference/trending-search)                                 | Trending coins, NFTs, and categories in the last 24 hours              | Answering "what's trending?" queries               |
| [/global](/reference/crypto-global)                                            | Total market cap, BTC dominance, volume, and active coins              | Grounding agents with macro market context         |
| [/onchain/simple/networks/../token\_price/..](/reference/onchain-simple-price) | Onchain token prices by contract address across any network            | Pricing DEX tokens not listed on CoinGecko         |
| [/onchain/networks/trending\_pools](/reference/trending-pools-list)            | Trending liquidity pools across all networks                           | Surfacing onchain DeFi momentum for agents         |
| [/onchain/networks/../tokens/../info](/reference/token-info-contract-address)  | Token metadata, socials, websites, and analytics score                 | Researching onchain tokens for agent responses     |

<Callout icon="key" color="#FFC107" iconType="regular">
  Replace `YOUR_API_KEY` in the examples below with your actual CoinGecko API key.<br />Don't have one yet? [Get your API key here](https://www.coingecko.com/en/api/pricing).
</Callout>

***

## Connecting via MCP Server

The fastest way to give your AI agent access to CoinGecko data. The [MCP (Model Context Protocol) Server](/docs/mcp-server) lets LLM clients like Claude Desktop, Cursor, and Gemini CLI query CoinGecko directly - no custom API code needed.

**Public server (keyless)** - great for testing and quick prototyping:

<CodeGroup>
  ```json JSON theme={null}
  {
    "mcpServers": {
      "coingecko_mcp": {
        "command": "npx",
        "args": [
          "mcp-remote",
          "https://mcp.api.coingecko.com/mcp"
        ]
      }
    }
  }
  ```
</CodeGroup>

**Authenticated server** - for production apps with higher rate limits and 76+ tools:

<CodeGroup>
  ```json JSON theme={null}
  {
    "mcpServers": {
      "coingecko_mcp": {
        "command": "npx",
        "args": [
          "mcp-remote",
          "https://mcp.pro-api.coingecko.com/mcp"
        ]
      }
    }
  }
  ```
</CodeGroup>

Add either config to your client's `mcp_config.json` and your agent can immediately query prices, trending coins, onchain data, and more - all through natural language.

<Tip>
  For full setup instructions, including video walkthroughs and client-specific config paths, see the [CoinGecko MCP Server](/docs/mcp-server) page.
</Tip>

***

## Real-Time Prices for Agent Responses - `/simple/price`

*🔗 More endpoint details [here](/reference/simple-price)*

The go-to endpoint when your agent needs to answer "What's the price of X?" - fast, lightweight, and supports batching multiple coins in a single request.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://pro-api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,solana&vs_currencies=usd&include_market_cap=true&include_24hr_change=true" \
    -H "x-cg-pro-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Key parameters:**

| Parameter             | Why It Matters                                                            |
| --------------------- | ------------------------------------------------------------------------- |
| `ids` / `symbols`     | Query by CoinGecko ID or ticker symbol - batch multiple coins in one call |
| `vs_currencies`       | Return prices in multiple currencies simultaneously (e.g., `usd,eur,btc`) |
| `include_market_cap`  | Add market cap context alongside price                                    |
| `include_24hr_change` | Include 24h change for trend-aware responses                              |
| `precision`           | Control decimal places for cleaner agent output                           |

**Response highlights:**

<CodeGroup>
  ```json JSON theme={null}
  {
    "bitcoin": {
      "usd": 67432.51,
      "usd_market_cap": 1326789012345,
      "usd_24h_change": 2.34567
    },
    "ethereum": {
      "usd": 3456.78,
      "usd_market_cap": 415678901234,
      "usd_24h_change": 1.23456
    }
  }
  ```
</CodeGroup>

This response is compact and structured - ideal for injecting into an LLM context window without consuming excessive tokens.

***

## Bulk Market Data for LLM Context - `/coins/markets`

*🔗 More endpoint details [here](/reference/coins-markets)*

When your agent needs broader market awareness - top coins by market cap, price movers, or a full market snapshot to ground its reasoning.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://pro-api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=20&page=1&price_change_percentage=1h,24h,7d" \
    -H "x-cg-pro-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Key parameters:**

| Parameter                 | Why It Matters                                                                              |
| ------------------------- | ------------------------------------------------------------------------------------------- |
| `order`                   | Sort by `market_cap_desc` or `volume_desc` to surface what's most relevant                  |
| `per_page`                | Up to 250 coins per page - one call can populate an entire context window                   |
| `price_change_percentage` | Include `1h,24h,7d` for multi-timeframe momentum context                                    |
| `category`                | Filter by sector (e.g., `decentralized-finance-defi`, `layer-1`) for domain-specific agents |

**Response highlights:**

<CodeGroup>
  ```json JSON theme={null}
  {
    "id": "bitcoin",
    "symbol": "btc",
    "name": "Bitcoin",
    "current_price": 67432.51,
    "market_cap": 1326789012345,
    "market_cap_rank": 1,
    "total_volume": 28394567890,
    "price_change_percentage_24h_in_currency": 2.34,
    "price_change_percentage_7d_in_currency": 5.67
  }
  ```
</CodeGroup>

<Tip>
  For agents that need to stay within token limits, request only the top 10-20 coins and omit `sparkline=true` to keep the response compact.
</Tip>

***

## Trending Coins and Discovery

### `/search/trending`

*🔗 More endpoint details [here](/reference/trending-search)*

Surfaces the coins, NFTs, and categories trending on CoinGecko in the last 24 hours. Essential for agents that need to answer "What's hot right now?" or detect emerging market interest.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://pro-api.coingecko.com/api/v3/search/trending" \
    -H "x-cg-pro-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Response highlights:**

<CodeGroup>
  ```json JSON theme={null}
  {
    "coins": [
      {
        "item": {
          "id": "pepe",
          "name": "Pepe",
          "symbol": "PEPE",
          "market_cap_rank": 46,
          "data": {
            "price": 0.0000082,
            "price_change_percentage_24h": { "usd": 15.67 },
            "market_cap": "$3,456,789,012",
            "total_volume": "$1,234,567,890"
          }
        }
      }
    ],
    "categories": [
      {
        "name": "Meme",
        "data": {
          "market_cap_change_percentage_24h": { "usd": 8.45 }
        }
      }
    ]
  }
  ```
</CodeGroup>

### `/coins/list`

*🔗 More endpoint details [here](/reference/coins-list)*

Returns the complete list of all supported coins with their CoinGecko IDs, names, and symbols. This is a critical lookup table for agent pipelines - when a user says "tell me about Solana", your agent needs to resolve that to the ID `solana` before calling other endpoints.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://pro-api.coingecko.com/api/v3/coins/list?include_platform=true" \
    -H "x-cg-pro-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Key parameters:**

| Parameter          | Why It Matters                                                                   |
| ------------------ | -------------------------------------------------------------------------------- |
| `include_platform` | Include contract addresses per platform - useful for resolving tokens by address |

**Response highlights:**

<CodeGroup>
  ```json JSON theme={null}
  [
    {
      "id": "bitcoin",
      "symbol": "btc",
      "name": "Bitcoin",
      "platforms": {}
    },
    {
      "id": "usd-coin",
      "symbol": "usdc",
      "name": "USDC",
      "platforms": {
        "ethereum": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "solana": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
      }
    }
  ]
  ```
</CodeGroup>

<Tip>
  Cache this list locally and refresh periodically. It's a lightweight call that saves your agent from making redundant lookups on every user query.
</Tip>

***

## Deep-Dive Coin Research - `/coins/{id}`

*🔗 More endpoint details [here](/reference/coins-id)*

The most comprehensive endpoint for when your agent needs to provide a thorough answer about a specific coin - ATH, supply metrics, community data, developer activity, and more in a single call.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://pro-api.coingecko.com/api/v3/coins/ethereum?localization=false&tickers=false&community_data=true&developer_data=true" \
    -H "x-cg-pro-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Key parameters:**

| Parameter        | Why It Matters                                                               |
| ---------------- | ---------------------------------------------------------------------------- |
| `localization`   | Set to `false` to reduce response size and token usage                       |
| `tickers`        | Set to `false` if exchange data isn't needed - significantly reduces payload |
| `community_data` | Includes Twitter followers, Reddit subscribers, and Telegram members         |
| `developer_data` | Includes GitHub commits, stars, forks, and contributors                      |

**Response highlights:**

<CodeGroup>
  ```json JSON theme={null}
  {
    "id": "ethereum",
    "symbol": "eth",
    "name": "Ethereum",
    "description": { "en": "Ethereum is a decentralized platform for applications..." },
    "links": {
      "homepage": ["https://www.ethereum.org/"],
      "subreddit_url": "https://www.reddit.com/r/ethereum"
    },
    "market_data": {
      "current_price": { "usd": 3456.78 },
      "market_cap": { "usd": 415678901234 },
      "ath": { "usd": 4878.26 },
      "circulating_supply": 120234567,
      "total_supply": 120234567
    },
    "community_data": {
      "twitter_followers": 3456789,
      "reddit_subscribers": 2345678
    },
    "developer_data": {
      "commit_count_4_weeks": 234
    }
  }
  ```
</CodeGroup>

<Note>
  Set `tickers=false` and `localization=false` to keep the response under 5KB - important when injecting coin data into LLM context windows with token limits.
</Note>

***

## Global Market Context - `/global`

*🔗 More endpoint details [here](/reference/crypto-global)*

Gives your agent the big-picture view - total crypto market cap, BTC dominance, volume, and active coin count. Use this to ground agent responses with macro context before diving into specifics.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://pro-api.coingecko.com/api/v3/global" \
    -H "x-cg-pro-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Response highlights:**

<CodeGroup>
  ```json JSON theme={null}
  {
    "data": {
      "active_cryptocurrencies": 15234,
      "markets": 1089,
      "total_market_cap": { "usd": 2678901234567 },
      "total_volume": { "usd": 89012345678 },
      "market_cap_percentage": {
        "btc": 52.34,
        "eth": 16.78
      },
      "market_cap_change_percentage_24h_usd": 1.23
    }
  }
  ```
</CodeGroup>

A compact response that gives your agent everything it needs to open with "The total crypto market cap is \$2.67T, with BTC dominance at 52.3%..." before answering specific questions.

***

## Onchain Token and Pool Data

For agents that need to work with DeFi protocols, DEX tokens, and onchain analytics across 250+ supported networks.

### `/onchain/simple/networks/{network}/token_price/{addresses}`

*🔗 More endpoint details [here](/reference/onchain-simple-price)*

Get real-time prices for any onchain token by contract address - including tokens not yet listed on CoinGecko's main platform.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/simple/networks/eth/token_price/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" \
    -H "x-cg-pro-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Key parameters:**

| Parameter          | Why It Matters                                                     |
| ------------------ | ------------------------------------------------------------------ |
| `network` (path)   | The blockchain network (e.g., `eth`, `solana`, `base`, `arbitrum`) |
| `addresses` (path) | Token contract address(es) to price                                |

**Response highlights:**

<CodeGroup>
  ```json JSON theme={null}
  {
    "data": {
      "id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "type": "simple_token_price",
      "attributes": {
        "token_prices": {
          "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "1.0"
        }
      }
    }
  }
  ```
</CodeGroup>

### `/onchain/networks/trending_pools`

*🔗 More endpoint details [here](/reference/trending-pools-list)*

Surfaces the hottest liquidity pools across all networks - a powerful signal for agents tracking DeFi momentum and new token activity.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/trending_pools?include=base_token&duration=24h" \
    -H "x-cg-pro-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Key parameters:**

| Parameter  | Why It Matters                                                       |
| ---------- | -------------------------------------------------------------------- |
| `include`  | Add `base_token`, `quote_token`, `dex`, `network` for richer context |
| `duration` | Filter by `1h`, `6h`, or `24h` trending window                       |

**Response highlights:**

<CodeGroup>
  ```json JSON theme={null}
  {
    "data": [
      {
        "type": "pool",
        "attributes": {
          "name": "USDC / WETH",
          "base_token_price_usd": "3456.78",
          "reserve_in_usd": "234567890",
          "volume_usd": { "h24": "123456789" },
          "price_change_percentage": { "h24": "2.34" },
          "transactions": { "h24": { "buys": 12345, "sells": 10234 } }
        }
      }
    ]
  }
  ```
</CodeGroup>

### `/onchain/networks/{network}/tokens/{address}/info`

*🔗 More endpoint details [here](/reference/token-info-contract-address)*

Get rich metadata for any onchain token - description, socials, websites, and GeckoTerminal analytics score. Perfect for agents that need to provide context about lesser-known tokens.

**Example request:**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://pro-api.coingecko.com/api/v3/onchain/networks/eth/tokens/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/info" \
    -H "x-cg-pro-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Response highlights:**

<CodeGroup>
  ```json JSON theme={null}
  {
    "data": {
      "attributes": {
        "name": "USD Coin",
        "symbol": "USDC",
        "coingecko_coin_id": "usd-coin",
        "description": "USDC is a fully collateralized US dollar stablecoin...",
        "websites": ["https://www.circle.com/en/usdc"],
        "gt_score": 92.34,
        "twitter_handle": "circle"
      }
    }
  }
  ```
</CodeGroup>

<Tip>
  The `coingecko_coin_id` field bridges onchain data to CoinGecko's main API - use it to cross-reference with `/coins/{id}` for a complete research profile.
</Tip>

***

## Putting It All Together

Here's how these endpoints fit into a typical AI agent workflow:

1. **Connect via MCP** - Set up the CoinGecko MCP Server for instant, natural-language access to all endpoints
2. **Build a coin lookup table** - Cache `/coins/list` to resolve user queries (names, symbols, addresses) to CoinGecko IDs
3. **Set macro context** - Query `/global` to ground your agent with overall market conditions
4. **Answer price questions** - Use `/simple/price` for fast, lightweight price lookups in real time
5. **Populate market context** - Fetch `/coins/markets` to give your LLM awareness of top coins and movers
6. **Surface trending signals** - Pull `/search/trending` to keep your agent up to date on market momentum
7. **Deep-dive on demand** - Query `/coins/{id}` when users ask for detailed research on a specific coin
8. **Go onchain** - Use onchain endpoints for DEX token pricing, trending pools, and token metadata across 250+ networks

<br />

<Card title="Integrate with CoinGecko MCP Server" icon="server" href="https://docs.coingecko.com/docs/mcp-server">
  Connect your AI agent directly to CoinGecko's API using our MCP server - enabling real-time crypto data queries from tools like Claude Desktop, Cursor, and more.
</Card>

***

Have feedback or need help? Reach out to `eason.lim@coingecko[dot]com`


Built with [Mintlify](https://mintlify.com).