CoinGecko API

Get CoinGecko data as clean JSON with one key: 13 endpoints, 1 to 5 credits per call, the same response shape as every other platform.

What you get#

Onekey exposes CoinGecko as 13 endpoints behind one API key: 6 endpoints return one record (data is an object) and 7 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for CoinGecko also works for the rest of the finance & markets category.

Endpoints#

EndpointWhat it doesParametersCreditsStatus
categoriesCoin categories with aggregate market cap and 24h volume.-5stable
coinCoin profile with live market data (price, market cap, supply, ATH).id*1stable
defi_globalGlobal DeFi market summary (market cap, dominance, top coin).-1stable
exchangeOne exchange: trust score, 24h BTC volume, country, links.id*1stable
exchange_ratesBTC-denominated exchange rates for fiat, crypto and commodities.-1stable
exchangesCrypto exchanges ranked by trust score.per_page, page5stable
globalGlobal crypto market: total market cap, volume, BTC/ETH dominance.-1stable
historyCoin snapshot (price, market cap, volume) on a past date (public API: last 365 days only).id*, date*1stable
market_chartPrice time series (price points) for a coin over N days.id*, vs_currency, days5stable
marketsTop coins by market cap with prices, volume and 24h change.vs_currency, per_page, page5beta
ohlcOHLC candles for a coin (days: 1,7,14,30,90,180,365).id*, vs_currency, days5stable
searchSearch coins by name or symbol.q*5stable
trendingTrending coins on CoinGecko in the last 24h.-5stable

A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.

Make a request#

This calls coingecko.coin (1 credit, stable). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.

curl "https://api.onekey.dev/v1/coingecko/coin?id=bitcoin" \
  -H "x-api-key: YOUR_API_KEY"

Fields you get back#

These unified fields come back from CoinGecko, with the same names as on every other platform. The count is how many of its 13 mapped endpoints return the field; a field the source lacks is null, never missing. 28 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.

FieldTypeEndpoints
entity.namestring9
entity.idstring7
media.thumbnailUrlURL7
entity.dateISO 8601 date6
market.pricenumber5
market.symbolstring5
market.volume24hnumber5
market.change24hPctnumber4
market.marketCapnumber4
market.marketCapRankinteger4
entity.categorystring3
entity.urlURL3
entity.descriptionstring2
entity.createdAtISO 8601 date1
market.closenumber1
market.highnumber1
market.lownumber1
market.opennumber1

The full schema is in Unified schema.

Pricing#

CoinGecko calls cost 1 to 5 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.