API Documentation

Our API URLS are as follows:

REST https://api.marketcap.cc
Socket.io https://socket.marketcap.cc
REST API
Authentication There is not authentication needed for the RESTful API at this time.
Limits The current rate limit for the RESTful API is 100 requests per second. If you send more requests than the limit your IP will be banned for a short amount of time.


Get overall Statistics GET          /v1/stats
Get all Assets GET          /v1/assets
Get specific asset by symbol GET          /v1/assets/{symbol}
Get all Exchanges GET          /v1/exchanges
Get specific Exchange by slug GET          /v1/exchanges/{exchangeSlug}
Get all Markets GET          /v1/markets
Get all Markets from specific Exchange GET          /v1/markets/exchange/{exchangeSlug}
Get all Markets of specific Pair GET          /v1/markets/pair/{pair}
Get all Markets of specific Asset Symbol GET          /v1/markets/symbol/{assetSymbol}
Get all USD Prices GET          /v1/usdPrices
Get Global Chart Data GET          /v1/globalChartData
Get Asset Chart Data GET          /v1/chartData/{assetSymbol}
Get Exchange Chart Data GET          /v1/exchangeChartData/{exchangeSlug}
Get Orderbook Data GET          /v1/orderbook/{exchangeSlug}/{pair}


Need more API endpoints? No problem, just contact us!


Socket.io API

All examples are in Node.js.



Connecting
						
const socketIOClient = require("socket.io-client");

const socket = socketIOClient("https://socket.marketcap.cc");

socket.on("connect", () => {
	console.log("Connected to MarketCap.cc socket!");
});

socket.on("{channel}", (data) => {
	console.log("Received data from socket:", data);
});

socket.on("close", () => {
	console.log("Disconnected from MarketCap.cc socket!");
});
						
					
Limits The current rate limit for sending messages to the Socket.io server is 10 messages every 1 second. If you send more messages than the limit your connection will automatically be closed.
Authentication Our Socket.io API currently needs no authentication, but the server will remove you from your subscription list if you do not send a heartbeat at least once every 30 seconds.
Heartbeat
						
socket.emit("heartbeat");

// That is all you need to do to stay connected
// The server will not answer to your heartbeat
						
					
Subscribing to a Channel
						
socket.emit("subscribe", {
	channel: "v1/trades" // Subscribe to v1/trades to receive all trade updates
});

socket.on("v1/trades", (data) => {
	//do something with "data"
});

// The server will not answer to your subscription call
						
					
Channels
v1/trades All trades across all Exchanges
v1/trades/exchange/{exchangeSlug} All trades on Exchange {exchangeSlug} (e.g. "binance")
v1/trades/pair/{pair} All trades across all Exchanges but only on the {pair} pair (e.g. "BTC_USDT")
v1/trades/pair/{exchangeSlug}/pair/{pair} All trades on exchange {exchangeSlug} with {pair} pair (e.g. "binance", "BTC_USDT")
v1/trades/{asset} All trades across all Exchanges where {asset} is included (e.g. "BTC")
v1/exchangeVolume USD Volume summary of all Exchanges
v1/exchangeVolume/{exchangeSlug} USD Volume summary of Exchange {exchangeSlug} (e.g. "binance")
v1/usdPrices USD price of all assets
v1/assetPrice USD Price and change of given asset
v1/assetPrice/{asset} USD Price and change of asset {asset} (e.g. "BTC")
v1/assetVolume Volume summary of given asset
v1/assetVolume/{asset} Volume summary of asset {asset} (e.g. "BTC")
v1/marketVolume (Not in USD) Volume summary of given pair and Exchange
v1/marketVolume/exchange/{exchangeSlug} (Not in USD) Volume summary of given pair and Exchange {exchangeSlug} (e.g. "binance")
v1/marketVolume/pair/{pair} (Not in USD) Volume summary of {pair} pair (e.g. "BTC_USDT") and given Exchange
v1/marketPrice (Not in USD) Price and change of given Exchange and pair
v1/marketPrice/exchange/{exchangeSlug} (Not in USD) Price and change of given pair and Exchange {exchangeSlug} (e.g. "binance")
v1/marketPrice/pair/{pair} (Not in USD) Price and change of {pair} pair (e.g. "BTC_USDT") and given Exchange
v1/whaleAlert Realtime Whale Alert updates
v1/liquidity Realtime Liquidity updates
v1/liquidity/{assetSymbol} Realtime Liquidity updates for asset {assetSymbol} (e.g. "BTC")