Get a free API key Generate key

Markets

Markets are trading pairs on exchanges, which are places where to trade between two specific cryptocurrencies. E.g. a market with a trading pair of BTC/USDT is a place where people can buy or sell Bitcoins with Tether. The trade activity on these markets is summarized every minute (depending on the exchange) tickers, which includes the exchange rate for those two assets during that minute. This exchange rate is used by coinranking to calculate the price for all listed coins.

Get market

Find information on a specific market listed on coinranking.

GET /market/:uuid

Path parameters

Name Type Description
uuid Uuid

Uuid of the market you want to request

Query parameters

Name Type Description
referenceCurrencyUuid (optional) String

Uuid of reference currency, in which all the prices are calculated. Defaults to US Dollar

Default value: yhjMzLPhuIDl

Examples

Example: cURL

curl https://api.coinranking.com/v2/market/MP77r-vKf4 \
  -H 'x-access-token: your-api-key' \
  -G

Example: NodeJs

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.coinranking.com/v2/market/MP77r-vKf4',
  headers: {
    'x-access-token': 'your-api-key'
  }
};

request(options, (error, response) => {
  if (error) throw new Error(error);
  console.log(response.body);
});

Example: PHP

<?php
  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => "https://api.coinranking.com/v2/market/MP77r-vKf4",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
      "x-access-token: your-api-key"
    ),
  ));

  $response = curl_exec($curl);

  curl_close($curl);
  echo $response;

Parameters examples

bash - referenceCurrencyUuid

# By default the price and volume for a market are shown in US Dollar. In this example,
# EURO (5k-_VTxqtCEI) is used as a reference
curl https://api.coinranking.com/v2/market/MP77r-vKf4?referenceCurrencyUuid=5k-_VTxqtCEI \
  -H 'x-access-token: your-api-key' \
  -G

Success response

Name Type Description
status String

Status of the request

Allowed values:
success
data Object
data.market Object
data.market.uuid String

Uuid of the market

data.markets.base String

The coin on the left side of the pair, which price is calculated in units of the quote

data.market.base.uuid String

Uuid of the baseCurrency of the market

data.market.base.symbol String

Symbol of the baseCurrency of the market

data.market.base.type String

Indicates if the base of the market is a coin or if it is fiat

Allowed values:
coin fiat
data.market.base.name String

Name of the baseCurrency of the market

data.markets.quote String

The coin on the right side of the pair. The amount in tickers are how much quote you get for one unit of base. E.g. BTC/USD 10.000 means 1 BTC is traded for 10.000 USD.

data.market.quote.uuid String

Uuid of the quoteCurrency of the market

data.market.quote.symbol String

Symbol of the quoteCurrency of the market

data.market.quote.name String

Name of the quoteCurrency of the market

data.market.quote.type String

Indicates if the quote of the market is a coin or if it is fiat

Allowed values:
coin fiat
data.markets.exchange String

Exchange this market belongs to

data.market.exchange.name String

Name of the exchange

data.market.exchange.uuid String

Uuid of the exchange

data.market.exchange.iconUrl String

Location of the icon

data.market.exchange.websiteUrl String

Url that points to the website of the exchange

data.market.latestTicker.createdAt String

An Epoch timestamp in seconds when the latest ticker was received

data.market.latestTicker.close String

The last price received from the market

data.market.latestTicker.base24hVolume String

Moving average of the base volume of the market in the last 24 hours. For example in a BTC/USD market it would be the Bitcoins traded within a 24 hour timespan.

data.market.latestTicker.quote24hVolume String

Moving average of the quote volume of the market in the last 24 hours. For example in a BTC/USD market it would be the US dollars traded within a 24 hour timespan.

data.market.24hVolume String

The 24 hour volume of the base currency in the reference currency which defaults to US Dollar. For example in an ETH/BTC market the volume would be Ethereum in US Dollar.

data.market.price String

The latest price of the base currency in the reference currency which defaults to US Dollar. For example in an ETH/BTC market the price would be Ethereum in US Dollar.

data.market.btcPrice String

The latest price of the base currency in Bitcoin.

data.market.rank Number

Rank of the market based on volume, taking into account exchange and currency filters

data.market.marketShare String

Percentage of the total market volume reprented by this market

Success response example - Response:

HTTP/1.1 200 OK
{
  "status": "success",
  "data": {
    "market": {
      "uuid": "MP77r-vKf4",
      "rank": 7,
      "base": {
        "uuid": "Qwsogvtv82FCd",
        "symbol": "BTC",
        "name": "Bitcoin",
        "type": "coin",
      },
      "quote": {
        "symbol": "USDT",
        "uuid": "HIVsRcGKkPFtW",
        "name": "Tether",
        "type": "coin",
      },
      "exchange": {
        "name": "Binance",
        "uuid": "-zdvbieRdZ",
        "iconUrl": "https://cdn.coinranking.com/mDTK5qrmq/binance.svg",
        "websiteUrl": "https://www.binance.com",
      },
      "latestTicker": {
        "createdAt": 1594808541,
        "close": "10190.495525500779",
        "base24hVolume": "34878",
        "quote24hVolume": "354103375",
      },
      "marketShare": "1.23",
      "price": "9488.518829659914",
      "btcPrice": "1",
      "24hVolume": "353383358.2006244"
    }
  }
}

Error response

Error response - 422

Name Type Description
VALIDATION_ERROR Object

The request could not be validated. The response should provide more details.

REFERENCE_UNAVAILABLE Object

The reference currency used in the request is not available. Choose another UUID

Error response example - Response:

HTTP/1.1 422 Unprocessable Entity
{
  "status": "fail",
  "type": "REFERENCE_UNAVAILABLE",
  "message": "Reference currency not available"
}

Get markets

Get a list of markets. Markets are ranked by their volume over the last 24 hours. Use our filters to get a subset of the markets.

GET /markets

Query parameters

Name Type Description
referenceCurrencyUuid (optional) String

UUID of reference currency, in which all the prices are calculated. Defaults to US Dollar

Default value: yhjMzLPhuIDl
currencyUuid (optional) String

Filter markets with specific currency as either base or quote. Specifying a currencyUuid will also alter how prices are shown: By default all the markets will show the price of the base in the reference currency (e.g. an ETH/BTC market will show the price of ETH). By specifying a currencyUuid the prices of this currency will always be shown, disregarding whether or not this currency represents the base or the quote in the market (e.g. by specifying BTC as currency, both ETH/BTC as BTC/USD markets will show prices of BTC)

toCurrencyUuid (optional) String

Filter markets with specific currency as either base or quote. The toCurrencyUuid will not alter how the prices will be shown, but will keep the base price. This can be combined with the currencyUuid variable to get specific markets.

baseCurrencyUuid (optional) String

Filter markets with specific currency as base

quoteCurrencyUuid (optional) String

Filter markets with specific currency as quote

limit (optional) Number

Limit. Used for pagination. Only usable when no filters are applied

Default value: 50
Size range: 0-100
offset (optional) Number

Offset. Used for pagination only usable when no filters are applied

Default value: 0
orderBy (optional) String

Sort by either 24h volume or price. Only usable when no filters are applied

Default value: 24hVolume
Allowed values:
24hVolume price
orderDirection (optional) String

Sort in ascending or descending order. Only usable when no filters are applied.

Default value: desc
Allowed values:
desc asc
search (optional) String

Filter the results by searching for coin names, symbols or exchange names.

Examples

Example: cURL

curl https://api.coinranking.com/v2/markets \
  -H 'x-access-token: your-api-key' \
  -G

Example: NodeJs

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://api.coinranking.com/v2/markets',
  headers: {
    'x-access-token': 'your-api-key'
  }
};

request(options, (error, response) => {
  if (error) throw new Error(error);
  console.log(response.body);
});

Example: PHP

<?php
  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => "https://api.coinranking.com/v2/markets",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
      "x-access-token: your-api-key"
    ),
  ));

  $response = curl_exec($curl);

  curl_close($curl);
  echo $response;

Parameters examples

bash - referenceCurrencyUuid

# By default the price and volume for markets are shown in US Dollar. In this example,
# EURO (5k-_VTxqtCEI) is used as a reference
curl https://api.coinranking.com/v2/markets?referenceCurrencyUuid=5k-_VTxqtCEI \
  -H 'x-access-token: your-api-key' \
  -G

bash - currencyUuid

# In this example the list is filtered on markets that trade Ethereum (either as base or quote)
curl https://api.coinranking.com/v2/markets?currencyUuid=razxDUgYGNAdQ \
  -H 'x-access-token: your-api-key' \
  -G

bash - toCurrencyUuid

# In this example the list is filtered on markets that trade Ethereum (either as base or quote)
curl https://api.coinranking.com/v2/markets?toCurrencyUuid=razxDUgYGNAdQ \
  -H 'x-access-token: your-api-key' \
  -G

bash - baseCurrencyUuid

# In this example the list is filtered on markets that trade Ethereum as base (left side of a
# trading pair)
curl https://api.coinranking.com/v2/markets?baseCurrencyUuid=razxDUgYGNAdQ \
  -H 'x-access-token: your-api-key' \
  -G

bash - quoteCurrencyUuid

# In this example the list is filtered on markets that trade Ethereum as quote (right side of a
# trading pair)
curl https://api.coinranking.com/v2/markets?quoteCurrencyUuid=razxDUgYGNAdQ \
  -H 'x-access-token: your-api-key' \
  -G

bash - limit

curl https://api.coinranking.com/v2/markets?limit=10 \
  -H 'x-access-token: your-api-key' \
  -G

bash - offset

curl https://api.coinranking.com/v2/markets?offset=50 \
  -H 'x-access-token: your-api-key' \
  -G

bash - orderBy

curl https://api.coinranking.com/v2/markets?orderBy=price \
  -H 'x-access-token: your-api-key' \
  -G

bash - orderDirection

curl https://api.coinranking.com/v2/markets?orderDirection=asc \
  -H 'x-access-token: your-api-key' \
  -G

bash - orderDirection

curl https://api.coinranking.com/v2/markets?search=bitcoin \
  -H 'x-access-token: your-api-key' \
  -G

Success response

Name Type Description
status String

Status of the request

Allowed values:
success
data Object
data.stats Object
data.stats.24hVolume String

Total 24h volume of markets in the reference currency

data.stats.total Number

Total number of markets

data.markets Object[]

List of markets

data.markets.uuid String

UUID of the market

data.markets.base String

The coin on the left side of the pair, which price is calculated in units of the quote

data.markets.base.uuid String

UUID of the baseCurrency of the market

data.markets.base.symbol String

Symbol of the baseCurrency of the market

data.markets.quote String

The coin on the right side of the pair. The amount in tickers are how much quote you get for one unit of base. E.g. BTC/USD 10.000 means 1 BTC is traded for 10.000 USD.

data.markets.quote.uuid String

UUID of the quoteCurrency of the market

data.markets.quote.symbol String

Symbol of the quoteCurrency of the market

data.markets.exchange String

Exchange this market belongs to

data.markets.exchange.name String

Name of the exchange

data.markets.exchange.uuid String

UUID of the exchange

data.markets.exchange.iconUrl String

Location of the icon

data.markets.24hVolume String

The 24 hour volume of the base currency in the reference currency which defaults to US Dollar. For example in an ETH/BTC market the volume would be Ethereum in US Dollar.

data.markets.price String

The latest price of the base currency in the reference currency which defaults to US Dollar. For example in an ETH/BTC market the price would be Ethereum in US Dollar.

data.markets.btcPrice String

The latest price of the base currency in Bitcoin.

data.markets.rank Number

Rank of the market based on volume, taking into account exchange and currency filters

data.markets.marketShare String

Percentage of the total market volume reprented by this market, taking into account exchange and currency filters

Success response example - Response:

HTTP/1.1 200 OK
{
  "status": "success",
  "data": {
    "stats": {
      "24hVolume": "6554685985.623574",
      "total": 27521
    },
    "markets": [
      {
        "uuid": "xk9M2LuHuID5",
        "base": {
          "uuid": "Qwsogvtv82FCd",
          "symbol": "BTC",
        },
        "quote": {
          "uuid": "yhjMzLPhuIDl",
          "symbol": "USD",
        },
        "exchange": {
          "name": "Binance",
          "uuid": "-zdvbieRdZ",
          "iconUrl": "https://cdn.coinranking.com/d6w2Hj3z0/BitMEX.svg",
        },
        "24hVolume": "771875964.9750752",
        "price": "3842.9444791178726",
        "btcPrice": "1",
        "rank": 1,
        "marketShare": "30.48"
      },
      {
        "uuid": "bn7nTLHHuIq2",
        "base": {
          "uuid": "Qwsogvtv82FCd",
          "symbol": "BTC",
        },
        "quote": {
          "uuid": "HIVsRcGKkPFtW",
          "symbol": "USDT",
        },
        "exchange": {
          "name": "Coinbase Pro",
          "uuid": "qn5ZJmPFP",
          "iconUrl": "https://cdn.coinranking.com/Ama6htyHL/coinbase.svg",
        },
        "24hVolume": "311344830.86823833",
        "price": "3869.146354559396",
        "btcPrice": "1",
        "rank": 2,
        "marketShare": "12.35"
      }
    ]
  }
}

Error response

Error response - 422

Name Type Description
VALIDATION_ERROR Object

The request could not be validated. The response should provide more details.

REFERENCE_UNAVAILABLE Object

The reference currency used in the request is not available. Choose another UUID.

Error response example - Response:

HTTP/1.1 422 Unprocessable Entity
{
  "status": "fail",
  "type": "REFERENCE_UNAVAILABLE",
  "message": "Reference currency not available"
}