# Switch from CoinGecko API

How-to. Change the base URL and the key header, then check the routes you use against the table below.

coinprice.dev answers on the same paths as CoinGecko for the routes below, and the answers have the same shape. It is not a full copy: some fields are `null` and some routes do not exist. We called each route on both APIs on 24 Nov 2026 to write the table, so you can see before you change anything what your code will find.

## Change the base URL and the key

Point your client at `https://api.coinprice.dev/v2` instead of `https://api.coingecko.com/api/v3`, and send your coinprice.dev key as `Authorization: Bearer $COINPRICE_API_KEY`. The key can also go in an `X-API-Key` header or in CoinGecko's `x-cg-pro-api-key` or `x-cg-demo-api-key` header. A key in the URL query string is never read and gives 401, so a CoinGecko client that sends `x_cg_demo_api_key` in the URL fails. [Sign up](/signup) for a free key first.

curl:

```bash
curl -s -H "Authorization: Bearer $COINPRICE_API_KEY" \
  "https://api.coinprice.dev/v2/simple/price?ids=bitcoin,ethereum&vs_currencies=usd&include_24hr_change=true&include_last_updated_at=true"
```

JSON, real response, 2026-11-24 04:32 UTC:

```json
{
  "bitcoin": {
    "last_updated_at": 1795494725,
    "usd": 60439.05,
    "usd_24h_change": -1.2396356881006931
  },
  "ethereum": {
    "last_updated_at": 1795494725,
    "usd": 1698.455891,
    "usd_24h_change": -1.8185536860928275
  }
}
```

## Routes checked on both APIs

| Route | Same path and shape | What differs |
|---|---|---|
| `/simple/price` | Yes. `usd`, `usd_24h_vol`, `usd_24h_change` and `last_updated_at` have the same names. | Up to 250 ids in one call. Unknown ids are left out of the answer, not an error, and an answer with none still counts as a call. |
| `/simple/supported_vs_currencies` | Yes, a list of codes. | Ours has 150 codes and CoinGecko has 63; 50 are in both. Fiat prices are converted with exchangerate.dev rates. Candle history in another currency is converted at today's rate. |
| `/coins/list` | Yes. `id`, `symbol` and `name`. | On 24 Nov 2026 ours listed 813 coins. 786 of those ids were the same ids CoinGecko uses; 27 were not in CoinGecko's list. `tether` and `usd-coin` are not covered. |
| `/coins/markets` | Yes. 19 fields are common, including `current_price`, `total_volume`, `high_24h`, `low_24h` and `price_change_percentage_24h`. | `market_cap`, `market_cap_rank`, supply fields and `image` are `null`. `ath`, `atl` and `roi` are not returned. Ours adds `sources`, `last_updated_at` and a 7-day change. Without `ids` it lists ranked coins only: on three or more exchanges with a 24h volume. Use `/v2/coins/list` or `/v2/search?query=` to find any coin's id, and pass `ids=` to read any other coin. |
| `/coins/{id}` | Yes. `market_data` has `current_price`, `high_24h`, `low_24h`, `total_volume` and the 24h and 7d change. | Descriptions, links, categories and `market_cap_rank` are not returned. `market_cap` is `{"usd": null}`, so `market_data["market_cap"]["usd"]` works and gives `null`. Supplies are `null`. |
| `/coins/{id}/ohlc` | Yes. Rows of `[time, open, high, low, close]`, and `days` works. | Ours also takes `interval`, `limit`, `from` and `to`. At most 5,000 rows come back, and a longer window returns the newest rows, so page with `from` and `to`. |
| `/coins/{id}/market_chart` | Yes. `prices` is a list of `[time in ms, price]`. | `market_caps` and `total_volumes` are empty lists. At most 2,000 points come back, and a longer window returns the newest, so page with `from` and `to`. |
| `/coins/{id}/market_chart/range` | Yes. | Same as `market_chart`. |
| `/coins/{id}/history` | Yes, with `date=dd-mm-yyyy`. | Only `id`, `symbol`, `name` and `market_data.current_price` come back. |
| `/search` | Yes. `coins` has `id`, `name`, `symbol` and `api_symbol`. | `thumb`, `large` and `market_cap_rank` are `null`. There are no `categories`, `exchanges` or `nfts`. |

These routes return 404 on coinprice.dev: `/ping`, `/global`, `/search/trending`, `/exchanges`, `/coins/{id}/tickers` and `/simple/token_price/{platform}`.

## What to test before you switch

- Anything that reads market cap, rank, supply, `image` or `ath`. These are `null` or missing.
- Coin ids outside the 786 shared ones. Look them up in `/v2/coins/list` or `/v2/search?query=` first.
- Chart code that expects volumes or market caps in `market_chart`.
- Candle code that depends on how CoinGecko picks the interval for a `days` value. Here, with no window the default is 1h. With `days` or `from` the step is picked from the window: 15m up to 2 days when minute data covers it, else 1h; 4h up to 30 days; 1d over 30. Pass `interval` to be exact.

Prices are the median of up to seven exchanges, so they can differ from CoinGecko's by a small amount. [How a price is made](/methodology).

## Questions

**Do I need to change my code beyond the URL?** Change the base URL and the key header. Then check the fields in the table that come back as null or missing, because the code may read them.

**Does coinprice.dev have market cap?** No. Market cap, supply and rank are null. In `/coins/{id}`, `market_cap` is `{"usd": null}`.

**Is there a free plan?** Yes, 50,000 calls a month and 100 calls a minute with no card.
