---
title: "CoinGecko API: coin search, coin details as JSON"
description: "CoinGecko API for coin search, coin details, price history, listings, markets, exchanges and trending coins as JSON. 1 credit per successful call."
url: https://perceptlayer.com/apis/coingecko
---

[APIs](https://perceptlayer.com/apis) / [Finance](https://perceptlayer.com/verticals/finance) / CoinGecko

1 credit per call 7 endpoints 5 datapoints 

# CoinGecko API

CoinGecko API for coin search, coin details, price history, listings, markets, exchanges and trending coins as JSON. 1 credit per successful call.

[Get a free API key](https://perceptlayer.com/signup) Run it below

CoinGecko

GET /v1/coingecko/search?q=bitcoin 

```
{
  "success": true,
  "data": {
    "query": "bitcoin",
    "search": [
      {
        "id": "bitcoin",
        "name": "Bitcoin",
        "symbol": "btc",
        "image": "https://coin-images.coingecko.com/coins/images/1/large/bitcoin.png",
        "rank": 1
      },
      {
        "id": "bitcoin-cash",
        "name": "Bitcoin Cash",
        "symbol": "bch",
        "image": "https://coin-images.coingecko.com/coins/images/780/large/bitcoin-cash-circle.png",
        "rank": 23
      },
      {
        "id": "bitcoin-cash-sv",
        "name": "Bitcoin SV",
        "symbol": "bsv",
        "image": "https://coin-images.coingecko.com/coins/images/6799/large/BSV.png",
        "rank": 123
      }
    ],
    "pagination": {
      "page": 1,
      "per_page": 100,
      "total": 25,
      "total_pages": 1,
      "has_more": false
    }
  },
  "meta": {
    "endpoint_family": "search",
    "source": "coingecko",
    "request_id": "req_21ed862f82f6429dbc64faa5211564f3",
    "credits_charged": 1,
    "credits_remaining": 999
  }
}
```

200 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

Sample data

## What one call returns

A recorded run of `search`: the fields and shapes you will get, shortened to 3 items.

| # | id string | name string | symbol string | image url | rank integer |
| --- | --- | --- | --- | --- | --- |
| 1 | bitcoin | Bitcoin | btc | https://coin-images.coingecko.com/coins/images/1/large/bitcoin.png | 1 |
| 2 | bitcoin-cash | Bitcoin Cash | bch | https://coin-images.coingecko.com/coins/images/780/large/bitcoin-cash-circle.png | 23 |
| 3 | bitcoin-cash-sv | Bitcoin SV | bsv | https://coin-images.coingecko.com/coins/images/6799/large/BSV.png | 123 |

Recorded from our API · 3 items shown · 5 datapoints per item GET /v1/coingecko/search?q=bitcoin

5 datapoints

### Identity

-   id string
-   name string

### Reputation

-   image url

### Other

-   symbol string
-   rank integer

Playground

## Run this API

cURL shell 

```
curl "https://api.perceptlayer.com/v1/coingecko/search?q=bitcoin" \
  -H "X-API-Key: $API_KEY"
```

CoinGecko · 7 endpoints

## Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

| Endpoint | Required parameters | Returns | Cost |
| --- | --- | --- | --- |
| [GET `/v1/coingecko/coin`](https://perceptlayer.com/apis/coingecko/coin) | `id` +1 optional | `coin` | 1 credit |
| [GET `/v1/coingecko/exchanges`](https://perceptlayer.com/apis/coingecko/exchanges) | none +2 optional | `id` `name` `country` `url` `image` `trust_score` +3 more | 1 credit |
| [GET `/v1/coingecko/history`](https://perceptlayer.com/apis/coingecko/history) | `id` +2 optional | `id` `days` `currency` `points` `history` | 1 credit |
| [GET `/v1/coingecko/listings`](https://perceptlayer.com/apis/coingecko/listings) | none +5 optional | `id` `symbol` `name` `image` `rank` `price` +16 more | 1 credit |
| [GET `/v1/coingecko/markets`](https://perceptlayer.com/apis/coingecko/markets) | `id` +2 optional | `id` `markets` `pagination` | 1 credit |
| [GET `/v1/coingecko/search`](https://perceptlayer.com/apis/coingecko/search) | `q` +2 optional | `id` `name` `symbol` `image` `rank` | 1 credit |
| [GET `/v1/coingecko/trending`](https://perceptlayer.com/apis/coingecko/trending) | none +1 optional | `id` `coin_id` `symbol` `name` `image` `rank` +4 more | 1 credit |

Overview

## About the CoinGecko API

## What you can get

The CoinGecko API returns CoinGecko crypto market data as JSON through 7 endpoints.

-   **Search:** `search` takes a `q`, with `page` and `per_page`.
-   **One coin:** `coin` takes an `id`, with `currency` ( `USD`, `EUR`, `GBP` or `BTC`).
-   **Price history:** `history` takes an `id`, with `days` and `currency`.
-   **Listings:** `listings` takes `page`, `per_page`, `currency`, `category` and `order` ( `market_cap_desc`, `volume_desc`, `volume_asc`, `id_asc` or `id_desc`).
-   **Markets:** `markets` takes an `id`, with `page` and `currency`, and lists the trading pairs for that coin.
-   **Exchanges and trending:** `exchanges` takes `page` and `per_page`; `trending` takes an optional `currency`.

The recorded `search` for "bitcoin" returns `query`, `search` and `pagination`. Each result has `id`, `name`, `symbol`, `image` and `rank`, and `pagination` reports a `total` of 25 matches on one page. The first result is `bitcoin` at `rank` 1, followed by `bitcoin-cash` and `bitcoin-cash-sv`.

## How a call works

Search, then read the coin: `GET /v1/coingecko/search?q=bitcoin`, with your key in the `X-API-Key` header, returns each coin's `id`. Pass that to `coin`, `history` or `markets`, for example `GET /v1/coingecko/history?id=bitcoin&days=30`, which returned 31 `points`, each with `timestamp`, `price`, `market_cap` and `volume`. Check `has_more` in `pagination` before asking for the next `page`. Every successful call costs 1 credit; failed calls cost nothing.

Finance JSON REST MCP

### More finance APIs

[CoinMarketCap](https://perceptlayer.com/apis/coinmarketcap) [Stocktwits](https://perceptlayer.com/apis/stocktwits) [TradingView](https://perceptlayer.com/apis/tradingview) [Yahoo Finance](https://perceptlayer.com/apis/yahoo-finance)

Use cases

### Rank coins by market cap or volume with \`listings\`

`` Use the CoinGecko API to rank coins by market cap or volume with `listings` `` 

### Chart a coin's price, market cap and volume over \`days\`

`` Use the CoinGecko API to chart a coin's price, market cap and volume over `days` `` 

### Compare a coin's price and volume across trading pairs with \`markets\`

`` Use the CoinGecko API to compare a coin's price and volume across trading pairs with `markets` `` 

### Watch which coins are trending

`Use the CoinGecko API to watch which coins are trending` 

FAQ

## Questions

**How much does the CoinGecko API cost?**

Each successful call costs one credit, whichever endpoint you call, and each page is one call. New accounts get free credits to start, and credit packs bring the price down as you scale.

**Which currencies can prices come back in?**

\`coin\`, \`history\`, \`listings\`, \`markets\` and \`trending\` take a \`currency\` of \`USD\`, \`EUR\`, \`GBP\` or \`BTC\`.

**What format are responses in?**

Every endpoint returns JSON, with no HTML parsing on your side.

**Do I need a CoinGecko account?**

No. You call this CoinGecko API with your Perceptlayer key in the \`X-API-Key\` header, with no CoinGecko login.

**Is this the official CoinGecko API?**

No. Perceptlayer is an independent service and is not affiliated with CoinGecko. It returns CoinGecko data as JSON with a Perceptlayer key, so there is no CoinGecko developer account, app review or partner approval to get first. It only reads data: if CoinGecko has an official API and you need to act on your own CoinGecko account, such as posting, managing orders or reading private data, use that one.

**Should I build a CoinGecko scraper instead?**

You can, but a CoinGecko scraper is code you maintain: page changes break it, requests get blocked, and CoinGecko's terms govern how you collect data. The CoinGecko API gives you 7 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

## Try the CoinGecko API with 100 free credits

No credit card. Failed calls are never billed.

[Get a free API key](https://perceptlayer.com/signup) [Read the docs](https://docs.perceptlayer.com)
