CoinGecko API for crypto prices in MCP tools

developer2026-11-23

On this page

The CoinGecko API is a REST API that returns cryptocurrency prices, market capitalisation, trading volume, and coin metadata as JSON. Your code sends an HTTP GET request to an endpoint, passes an API key in a header, and reads the response. To give an AI agent the same data, expose those endpoints as MCP tools so the agent calls them by name.

What the CoinGecko API returns

CoinGecko publishes market data for many cryptocurrencies. Its REST endpoints return JSON objects with prices in fiat and crypto pairs, 24-hour volume, market capitalisation, and descriptive fields for each coin. The reference lives at https://docs.coingecko.com/.

Each coin has a stable identifier, such as bitcoin or ethereum. Most endpoints take that identifier as input. The search endpoint returns the identifier when you only know a name or ticker.

Authentication and plan limits

The API expects an API key in a request header. Requests without a valid key fail or hit stricter limits. Plan tiers, monthly call quotas, and per-minute rate limits are listed on the docs page at https://docs.coingecko.com/. Read that table before you size a workload, because the limits change.

Store the key in an environment variable. Keep it out of client-side code and out of public repositories.

Calling the main endpoints

Four endpoints cover most market-data work.

  • /simple/price returns the current price of one or more coins in the currencies you choose.
  • /coins/markets returns a ranked page of coins with price, market capitalisation, and volume.
  • /coins/{id} returns metadata and market detail for a single coin.
  • /search returns coin identifiers that match a name or symbol.

A typical price call is a GET request with ids and vs_currencies query parameters. The response maps each coin identifier to its values. Parse the JSON and check the status code before you read the body.

Map coin identifiers before you call

Identifiers are not ticker symbols. Symbols can collide across coins, so use the identifier from the search endpoint or the coin list rather than a symbol typed by a user.

Store the identifier map once and refresh it on a schedule. An agent that guesses an identifier wastes calls on empty or error responses.

Handle errors, rate limits, and caching

A 429 response means the key hit a rate limit. Back off and retry with a growing delay. Log the status code and the endpoint. Never log the key.

Cache responses for data that changes slowly, such as coin metadata. Price data changes faster, so cache it only for the window your product needs.

Validate the identifier and currency code before the call. A bad value returns an error. A retry loop that ignores the error burns quota.

Giving an agent CoinGecko data through MCP

An agent does not write HTTP calls reliably on its own. An MCP tool wraps one endpoint with a name, a description, and a typed input schema. The agent reads the schema, fills in the arguments, and receives JSON back.

APIbase is an MCP gateway with a large and growing catalog of tools. Search the catalog for a CoinGecko tool before you write a wrapper. If the catalog lists a matching tool, your agent calls it through the same MCP connection it uses for other tools.

Keep tool descriptions specific. Name the identifier format and the currency codes in the description, so the model passes valid values.

Set up a CoinGecko tool for an agent

Three steps produce a working tool.

  • Create a CoinGecko API key and store it in the environment of the gateway or server that holds the tool.
  • Pick one endpoint for the job, such as /simple/price for current prices.
  • Write a description that names the input fields, the identifier format, and the output shape.

Test the tool with one known coin, such as bitcoin, before you give it to an agent. Confirm that the response parses and that the error path returns a clear message.

What it costs through APIbase

Per-call prices in the catalog range from 0 USD to 29.99 USD. Each tool page shows its own price. Compare that figure with the upstream plan cost before you choose between a direct key and a gateway tool.

This guide does not state CoinGecko plan fees. Check https://docs.coingecko.com/ for current fees and quota terms.

When CoinGecko is the wrong source

An aggregator shows reference prices. It does not give the execution price on one exchange. Use an exchange API when an order must fill at a known venue.

Check the terms before you publish prices in a product or a report. Read the usage terms at https://docs.coingecko.com/ before you redistribute the data.

Live pricing — developer

Price per call, developer tools Horizontal bar chart of the price per call and the cache-hit price, in US dollars, for 12 developer tools. The same values are in the table below the chart. Price per call Cache-hit price $0.0 $0.0005 $0.001 Usage Time SeriesUsage Time Series $0.0 $0.0 Per-Tool Usage BreakdownPer-Tool Usage Breakdown $0.0 $0.0 Usage SummaryUsage Summary $0.0 $0.0 Discover ToolsDiscover Tools $0.0 $0.0 Batch Tool CallsBatch Tool Calls $0.0 $0.0 Tool Quality MetricsTool Quality Metrics $0.0 $0.0 Tool Quality RankingsTool Quality Rankings $0.0 $0.0 List Programming LanguagesList Programming Languages $0.001 $0.0001 Check CVE ID Reservation Stat…Check CVE ID Reservation Status $0.001 $0.0001 Security Advisories (deps.dev)Security Advisories (deps.dev) $0.001 $0.0001 Dependency Tree (deps.dev)Dependency Tree (deps.dev) $0.001 $0.0001 Package Info (deps.dev)Package Info (deps.dev) $0.001 $0.0001 US dollars per call
Price per call for developer tools, cheapest first.

Data source: live tool catalog snapshot, fetched 2026-11-23.

Chart data as a table
ToolPrice per callCache-hit price
Usage Time Series$0.0$0.0
Per-Tool Usage Breakdown$0.0$0.0
Usage Summary$0.0$0.0
Discover Tools$0.0$0.0
Batch Tool Calls$0.0$0.0
Tool Quality Metrics$0.0$0.0
Tool Quality Rankings$0.0$0.0
List Programming Languages$0.001$0.0001
Check CVE ID Reservation Status$0.001$0.0001
Security Advisories (deps.dev)$0.001$0.0001
Dependency Tree (deps.dev)$0.001$0.0001
Package Info (deps.dev)$0.001$0.0001
ToolProviderPrice/callCache-hit
Usage Time Seriesaccount$0$0
Per-Tool Usage Breakdownaccount$0$0
Usage Summaryaccount$0$0
Discover Toolsapibase$0$0
Batch Tool Callsplatform$0$0
Tool Quality Metricsplatform$0$0
Tool Quality Rankingsplatform$0$0
List Programming Languagesjudge0$0.001$0.0001
Check CVE ID Reservation Statuscve-mitre$0.001$0.0001
Security Advisories (deps.dev)depsdev$0.001$0.0001
Dependency Tree (deps.dev)depsdev$0.001$0.0001
Package Info (deps.dev)depsdev$0.001$0.0001

Connect via MCP

How a tool call worksAn AI agent sends a tool call to the APIbase gateway. The gateway checks payment, calls the provider API, and returns the JSON result to the agent.Your agentAPIbase gatewayProvider API1. tool call2. paid call3. JSON result flows back to the agent
Diagram: the path of one tool call.

Data source: gateway design, no measured values.

$ curl -X POST https://apibase.pro/api/v1/tools/account.timeseries/call \
  -H "Content-Type: application/json" -d '{"params": {}}'

FAQ

Does the CoinGecko API need an API key?

Yes. Requests send an API key in a request header. Plan limits differ by tier, and the docs page at https://docs.coingecko.com/ lists current limits.

Which CoinGecko endpoint returns the current price?

The /simple/price endpoint returns the current price of coins you name by identifier, in the currencies you pass.

How does an agent call CoinGecko?

Through an MCP tool. The tool wraps one endpoint, the agent sends arguments that match the schema, and the tool returns the JSON response.

What does a CoinGecko call cost through APIbase?

Per-call prices range from 0 USD to 29.99 USD. Each tool page lists its exact price.

  1. STEP 1/2 Connect your MCP client
  2. STEP 2/2 Browse the full catalog

Written with AI assistance from APIbase's published documentation and public data; checked automatically against them. Corrections: https://apibase.pro/

Published: 2026-11-23Source: live apibase.pro catalog snapshot