API Documentation

Introduction to Coinranking API

Use this documentation to add real-time prices of cryptocurrencies, like Bitcoin, Ethereum, and Dogecoin to your app or website. Get metadata on every coin we have listed, such as circulating supply, block explorers, trading pairs, logos, and much more.

Base url:

https://api.coinranking.com/v2

Start by generating a free key to get a taste of our API. When you’re convinced (you will be!), you can access more endpoints and API calls by upgrading to the PRO plan, which also includes CORS (Cross Resource Origin Sharing) and OHLC (Open High Low Close) data. Take a look at our pricing page to see which one of the subscription plans suits you best.

Need help? Don’t hesitate to reach out to us.

Enjoy and good luck building your awesome product!

Deprecation notices

  • Our old API (API V1) is discontinued since January 2022. Our migration endpoint to help you convert IDs to UUIDs to make the switch to API V2 will be online until february 2022.
  • NFT endpoints will be discontinued after March 2022.

Authentication

The Coinranking API uses API keys to authenticate requests.

Authentication to the API is performed via a custom HTTP header. Provide your API key as the value of the X-Access-Token, like x-access-token: coinranking53a...9e4. Create a free account to get an API key.

All API requests must be made over HTTPS. Calls made over plain HTTP will redirect to HTTPS.

Example:

curl https://api.coinranking.com/v2/coins \
  -H x-access-token: 53a0b0a7e4f2fa59519e4

Why would I authenticate?

You can only do a very limited amount of requests without authenticating. Read on to learn more about our rate-limits, or get immediate unlimited requests with our PRO subscription plan.

Rate limits

The amount of requests you can do before you run into our rate limit depends on your subscription. With our free API key, you can make 10K requests per month. If you need more you can upgrade very easily.

Without a key, you can still make a very limited amount of requests so you can quickly test if our endpoints fit your needs, or debug a little bit during development. The unauthenticated requests are not guaranteed to work, so we advise you to get a key to not unexpectedly run into the rate limiter.

Types of rate limiting

We have rate limits for several time intervals. We protect against burst requests by limiting the free keys to about five requests per second. Our free key is limited to 10K requests per month. Unauthenticated requests are limited much more per month, and have limits per minute and hour as well. The current unauthenticated rate limits might change in the future to whatever we see fit; for guaranteed rate limits get one of our free keys.

Rate limit response headers

Every request you do returns information about the rate-limit, so your application can adapt before reaching the limit.

HeaderDescription
X-RateLimit-Limit-Second

The maximum amount of requests in a second

X-RateLimit-Limit-Minute

The maximum amount of requests in a minute

X-RateLimit-Limit-Hour

The maximum amount of requests in an hour

X-RateLimit-Limit-Month

The maximum amount of requests in a month

X-RateLimit-Remaining-Second

The amount of requests you can still do in a second

X-RateLimit-Remaining-Minute

The amount of requests you can still do in a minute

X-RateLimit-Remaining-Hour

The amount of requests you can still do in a hour

X-RateLimit-Remaining-Month

The amount of requests you can still do in an hour

RateLimit-Limit

This is the rate-limit that is the first to run out. E.g. when you can still do 10000 requests this month, but only 5 this minute, it will show 5

RateLimit-Reset

This will tell you the amount of seconds remain until the quota of your lowest rate-limit will be restored to its maximum

RateLimit-Remaining

The amount of requests remaining for the lowest remaining limit

Pricing

Try and test our API first by generating a key for free. This key is also suitable for small applications. This free tier will remain free, but it has some limitations such as a more restrained rate limit and it lacks some endpoints. So if you need more than the free tier provides, you can upgrade to our hobbyist or PRO plan.

CORS

If you are developing an application that directly makes requests from the browser to our API, you will run into issues with Cross Origin Resource Sharing (CORS). To prevent this, our API will respond with your custom domain in a CORS header. You can set your custom domain on the settings page. CORS is supported in our Hobbyist plan and above.

After you've set your custom domain on the settings page, your requests should pass an X-Access-Token header, like x-access-token: coinranking53a...9e4 and an Origin header with your custom domain. For the X-Access-Token header, see Authentication.

When using the JavaScript Fetch API sending the X-Access-Token header will not work, because the Fetch API will do a preflight-request without the header and fail on CORS. To get around this problem, you can pass the API token as a query string. See our JS Bin example for more information.

Icons

Icon URLs are provided as .svg, for example the logo for Bitcoin is:

https://cdn.coinranking.com/Sy33Krudb/btc.svg

We also support .png on all our coin and exchange logos. If you prefer this, just replace the svg extension with png:

https://cdn.coinranking.com/Sy33Krudb/btc.png

Feedback

We’re constantly trying to improve our API, to provide you with the best possible experience. That’s why we love to hear if you find it as simple and good as we hope you do; let us know by answering two short questions.

Migrating to V2

We’ve disabled API v1 since January 2022. Haven’t you migrated to v2 yet? Use our short guide to migrate:

  1. You need a free api key for API V2. Create a free api key which is to be used in requests to our service. Read about authenticating in our docs.
  2. Reorganized responses. You can access all the same data in API V2 as you could in V1, however we had to reorganize it due to performance reasons and ease-of-use. Consult our documentation for both API V1 and API V2.
  3. UUIDs instead of IDs. The biggest change between API V1 and API V2 is the identifier for all our assets. In V1 we used numerical IDs, which we replaced with UUIDs (which are strings). Since IDs are not available in API V2, and UUIDs are not available in API V1, we made a migration endpoint where both types of identifiers are mapped. This endpoint will be available for a month after disabling API V1.

Other resources

  • Open source JavaScript library to get crypto supplies from block explorers: GitHub, npm
  • Open source JavaScript library from fetching exchange tickers: GitHub, npm