Markets

Get markets

GET /public/markets

Parameter

Name Type Description
refCurrencyId (optional) Number

Id of currency in which prices are calculated, defaults to USD

Default value: 1509
currencyId (optional) Number

Filter markets with specific currency as either base or quote. Specifying a currencyId will also alter how prices are shown: By default all the markets will show the price of the base in the refCurrency (e.g. an ETH/BTC market will show the price of ETH). By specifying a currencyId 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)

toCurrencyId (optional) Number

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

baseCurrencyId (optional) Number

Filter markets with specific currency as base

quoteCurrencyId (optional) Number

Filter markets with specific currency as quote

sourceId (optional) Number

Filter markets from specific source

limit (optional) Number

Limit. Used for pagination

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

Offset. Used for pagination

Default value: 0
order (optional) String

Sort by either volume or price

Default value: volume
Allowed values:
volume price
orderDirection (optional) String

Sort in ascending or descending order

Default value: desc
Allowed values:
desc asc

Parameters examples

curl - Example:

curl -X GET \
  'https://api.coinranking.com/v1/public/markets?refCurrencyId=2&orderDirection=desc'

Success response

Name Type Description
status String

Status of the request

Allowed values:
success
data Object
data.stats Object
data.stats.volume Number

Total 24h volume of markets in the refCurrency

data.stats.total Number

Total number of markets

data.stats.limit Number

Amount of markets fetched, starting from the offset position. So, the ending position is the offset plus the limit

data.stats.offset Number

Starting position in the list of markets, often used in combination with the limit parameter

data.currencies Object[]

Currencies used as parameters, i.e. refCurrency, currency, baseCurrency and quoteCurrency

data.currencies.id Number

Id of the currency

data.currencies.type String

Type of the currency: fiat (e.g. USD), coin (e.g. BTC), or denominator (e.g. Satoshi)

Allowed values:
fiat coin denominator
data.currencies.symbol String

Symbol of the currency

data.currencies.name String

Name of the currency

data.currencies.iconUrl String

Location of the icon

data.sign Number

Some coins have a symbol, like $ for USD and Ƀ for BTC

data.markets Object[]

List of markets

data.markets.id Number

Id of the market

data.markets.baseSymbol String

Symbol of the baseCurrency of the market

data.markets.quoteSymbol String

Symbol of the quoteCurrency of the market

data.markets.sourceName String

Name of the exchange

data.markets.sourceIconUrl String

Location of the icon

data.markets.tickerCreatedAt Number

Timestamp of the latest ticker

data.markets.close Number

Close price of the latest ticker

data.markets.tickerBaseVolume Number

Base volume of the latest ticker

data.markets.tickerQuoteVolume Number

Quote volume of the latest ticker

data.markets.volume Number

Volume of the latest ticker in refCurrency

data.markets.price Number

Price of the latest ticker in refCurrency

data.markets.rank Number

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

data.markets.marketShare Number

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

Success response example - Response:

HTTP/1.1 200 OK
{
  "status": "success",
  "data": {
    "stats": {
      "volume": 6554685985.623574,
      "total": 27521,
      "limit": 50,
      "offset": 0
    },
    "currencies": [
      {
        "id": 1509,
        "type": "fiat",
        "symbol": "USD",
        "name": "US Dollar",
        "iconUrl": "https://cdn.coinranking.com/OjL-P17sq/usd.svg",
        "sign": "$"
      }
    ]
    "markets": [
      {
        "id": 13062,
        "baseSymbol": "BTC",
        "quoteSymbol": "USD",
        "sourceName": "BitMEX",
        "sourceIconUrl": "https://cdn.coinranking.com/d6w2Hj3z0/BitMEX.svg",
        "tickerCreatedAt": 1546522068000,
        "tickerClose": 3843,
        "tickerBaseVolume": 199521.66376739068,
        "tickerQuoteVolume": 766759203,
        "volume": 771875964.9750752,
        "price": 3842.9444791178726,
        "rank": 1,
        "marketShare": 30.48
      },
      {
        "id": 15723,
        "baseSymbol": "BTC",
        "quoteSymbol": "USDT",
        "sourceName": "CoinBene",
        "sourceIconUrl": "https://cdn.coinranking.com/fWL5Jugm_/coinbene.svg",
        "tickerCreatedAt": 1546522139000,
        "tickerClose": 3813.58,
        "tickerBaseVolume": 80479.30170000007,
        "tickerQuoteVolume": 306866427,
        "volume": 311344830.86823833,
        "price": 3869.146354559396,
        "rank": 2,
        "marketShare": 12.35
      }
   ]
}

Error response

Error response - Error

Name Type Description
status String

Status of the request

Allowed values:
fail error
type String

Error code

Allowed values:
VALIDATION_ERROR REF_UNAVAILABLE
message String

Human readable error message

Error response example - Response:

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