Introduction
The best API for getting cryptocurrency pricing, OHLC and volume data from multiple exchanges. We have integrated so far with: Cryptsy, BTCChina, Bitstamp, BTER, OKCoin, Coinbase, Poloniex, Cexio, BTCE, BitTrex, Kraken, Bitfinex, Yacuna, LocalBitcoins, Yunbi, itBit, HitBTC, btcXchange, BTC38, Coinfloor, Huobi, CCCAGG, LakeBTC, ANXBTC, Bit2C, Coinsetter, CCEX, Coinse, MonetaGo, Gatecoin, Gemini, CCEDK, Cryptopia, Exmo, Yobit, Korbit, BitBay, BTCMarkets, Coincheck, QuadrigaCX, BitSquare, Vaultoro, MercadoBitcoin, Bitso, Unocoin, BTCXIndia, Paymium, TheRockTrading, bitFlyer, Quoine, Luno, EtherDelta, bitFlyerFX, TuxExchange, CryptoX, Liqui, MtGox, BitMarket, LiveCoin, Coinone, Tidex, Bleutrade, EthexIndia, Bithumb, CHBTC, ViaBTC, Jubi, Zaif, Novaexchange, WavesDEX, Binance, Lykke, Remitano, Coinroom, Abucoins, BXinth, Gateio, HuobiPro, OKEX and the list keeps growing every month. We are your one stop shop for all your cryptocurrency APIs and data needs.
All our APIs are available under free to use under a Creative Commons Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0) license ( https://creativecommons.org/licenses/by-nc/3.0/ ) Please make sure you credit us with a link if you use our data on your website or app.
Inform us on [email protected] that you are using our API so we can let you know if we make any updates. (If Vlad sent you here, you are already on the list). DUE TO ABUSIVE USAGE, IF YOU WANT YOUR CLIENTS TO DIRECTLY USE OUR APIS, USE THE MIN-API PATH. (THE HEADER Access-Control-Allow-Origin: * is only set on min-api paths)
Some of the great services using our pricing API: https://etherchain.org/, http://etherscan.io/, https://www.exodus.io/, https://github.com/ethereum/meteor-dapp-wallet, http://nanopool.org/, Ethereum Stats App, https://gastracker.io/ Ethereum Classic Stats, https://explorer.zcha.in/, https://moon.cryptothis.com/, Sentiment Data
Requests
Most of the requests that are related to pricing data are public at the moment and generally available via GET functions. Please do not abuse them, a request every 10 sec should be more than enough. There is also a streaming api based on socket.io that is public as well. At the moment the public rest api and streaming apis are not delayed.
WE RECOMMEND YOU USE - https://min-api.cryptocompare.com/ for all your pricing API needs. We have had the API abused and I've put a limit in place of 6000 requests per hour per IP for the historical paths. You can see the limits here: hour limits , second limits .
Public API invocation
Public APIs are accessible via GET, and the parameters for the request are included in the query string.
Private API invocation
Authentication
CryptoCompare uses session cookies to allow access to private data. You can obtain the cookie by logging in.
Sessions
A session key is only valid for 30 days and it has a sliding window period, so each time you use it, it will get extended by 30 days.
Responses
If successful, API requests will return an HTTP 200 OK code, as well as
a Response.Type >= 100 any Response.Type less than 100 will mean there was an error.
Note that the responses to all requests, both public and private, are sent as the response body.
Data
This section deals with all the requests for price data, social data and historical data. Most of it is used for dealing with subscription, top list, historical and snapshot data.
CoinList
var url = 'https://www.cryptocompare.com/api/data/coinlist/';
Success examples
{
"Response": "Success",
"Message": "Coin list succesfully returned!",
"BaseImageUrl": "https://www.cryptocompare.com",
"BaseLinkUrl": "https://www.cryptocompare.com",
"Data": {
"LTC": {
"Id": "3808",
"Url": "/coins/ltc/overview",
"ImageUrl": "/media/19782/ltc.png",
"Name": "LTC",
"CoinName": "Litecoin",
"FullName": "Litecoin (LTC)",
"Algorithm": "Scrypt",
"ProofType": "PoW",
"SortOrder": "2"
}
...
},
"Type": 100
}
This api should never return an error, maybe a 500 error if there is an issue with cryptocompare
Get general info for all the coins available on the website.
URL Parameters
None
Return data
| Parameter | Type | Always returned | Description |
| Response | string | yes | The type of the response (Success or Error) |
| Message | string | yes | The message for the response |
| BaseImageUrl | url | yes | The base url for all the images from the ImageUrl field |
| BaseLinkUrl | url | yes | The base url for all the links from the Url field |
| Type | integer | yes | Integer representing the type of response. |
| Data | Object | yes | Empty if there is no data to return or there is an error |
| Data[Symbol]:Id | int | yes | The internal id, this is used in other calls |
| Data[Symbol]:Url | string | yes | The url of the coin on cryptocompare |
| Data[Symbol]:ImageUrl | string | yes | The logo image of the coin |
| Data[Symbol]:Name | string | yes | The symbol |
| Data[Symbol]:CoinName | string | yes | The name |
| Data[Symbol]:FullName |
string | yes | A combination of the name and the symbol |
| Data[Symbol]:Algorithm | string | yes | The algorithm of the cryptocurrency |
| Data[Symbol]:ProofType | string | yes | The proof type of the cryptocurrency |
| Data[Symbol]:SortOrder | int | yes | The order we rank the coin inside our internal system |
Request examples
Get coin list example
https://www.cryptocompare.com/api/data/coinlist/
Price
Price success examples
{"BTC":0.009878,"USD":10.79,"EUR":10.37}
Pricemulti success examples
{"BTC":{"USD":1090.39,"EUR":1047.31},"ETH":{"USD":10.77,"EUR":10.35}}
Pricemultifull success examples
{
"RAW":{
"BTC":{
"USD":{
"TYPE":"5",
"MARKET":"CCCAGG",
"FROMSYMBOL":"BTC",
"TOSYMBOL":"USD",
"FLAGS":"2",
"PRICE":1082.13,
"LASTUPDATE":1483529467,
"LASTVOLUME":2.31159402,
"LASTVOLUMETO":2496.5215415999996,
"LASTTRADEID":12826318,
"VOLUME24HOUR":72040.63471484324,
"VOLUME24HOURTO":75043516.07861365,
"OPEN24HOUR":1020.95,
"HIGH24HOUR":1097.54,
"LOW24HOUR":980,
"LASTMARKET":"Bitstamp",
"CHANGE24HOUR":61.180000000000064,
"CHANGEPCT24HOUR":5.992458004799457
},
...
},
...
"DISPLAY":{ ...}
}
GenerateAvg success examples
{
"RAW":{
"MARKET":"CUSTOMAGG",
"FROMSYMBOL":"ETH",
"TOSYMBOL":"BTC",
"FLAGS":"2",
"PRICE":0.009772,
"LASTUPDATE":1483537879,
"LASTVOLUME":69.48502597,
"LASTVOLUMETO":0.6799109791164499,
"LASTTRADEID":1483537879.1759,
"VOLUME24HOUR":2527207.437619751,
"VOLUME24HOURTO":23938.219374823766,
"OPEN24HOUR":0.008391,
"HIGH24HOUR":0.01048,
"LOW24HOUR":0.00835,
"LASTMARKET":"Kraken",
"CHANGE24HOUR":0.0013810000000000003,
"CHANGEPCT24HOUR":16.458109879632946
},
"DISPLAY":{
"FROMSYMBOL":"Ξ",
"TOSYMBOL":"Ƀ",
"MARKET":"CUSTOMAGG",
"PRICE":"Ƀ 0.009772",
"LASTVOLUME":"Ξ 69.49",
"LASTVOLUMETO":"Ƀ 0.6799",
"LASTTRADEID":1483537879.1759,
"VOLUME24HOUR":"Ξ 2,527,207.44",
"VOLUME24HOURTO":"Ƀ 23,938.22",
"OPEN24HOUR":"Ƀ 0.008391",
"HIGH24HOUR":"Ƀ 0.01048",
"LOW24HOUR":"Ƀ 0.008350",
"LASTMARKET":"Kraken",
"CHANGE24HOUR":"Ƀ 0.0014",
"CHANGEPCT24HOUR":"16.46"
}
}
Error examples
{"Response":"Error",
"Message":"Additional supply depots required. (Invalid Market)",
"Data":[],
"Type":99}
{"Response":"Error",
"Message":"I'm sorry, if you were right, I'd agree with you.(missing tsyms parameter - the symbol or commas separated symbol of the currency to want the quote in)",
"Data":[],
"Type":99}
{"Response":"Error",
"Message":"I'm sorry, if you were right, I'd agree with you.(missing fsym parameter - the symbol, ticker of the coin you want to get the data for)",
"Data":[],
"Type":99}
Get the latest price for a list of one or more currencies. Really fast, 20-60 ms. Cached each 10 seconds.
This API moved to
https://min-api.cryptocompare.com/data/
Documentation at https://min-api.cryptocompare.com/.
price
Get the price of a currency against multiple currencies.
| Parameter | Type | Required | Default | Info |
| fsym | string | true | From Symbol | |
| tsyms | string | true | To Symbols, include multiple symbols | |
| e | string | false | CCCAGG | Name of exchange. Default: CCCAGG |
| extraParams | string | false | NotAvailable | Name of your application |
| sign | bool | false | false | If set to true, the server will sign the requests. |
| tryConversion | bool | false | true | If set to false, it will try to get values without using any conversion at all |
Examples:
https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=BTC,USD,EUR
https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=BTC,USD,EUR&extraParams=your_app_name
https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=XMR,ETH,ZEC&extraParams=your_app_name
https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=XMR,REP,ZEC&extraParams=your_app_name
pricemulti
Get a matrix of currency prices.
| Parameter | Type | Required | Default | Info |
| fsyms | string | true | From Symbols, include multiple symbols | |
| tsyms | string | true | To Symbols, include multiple symbols | |
| e | string | false | CCCAGG | Name of exchange. Default: CCCAGG |
| extraParams | string | false | NotAvailable | Name of your application |
| sign | bool | false | false | If set to true, the server will sign the requests. |
| tryConversion | bool | false | true | If set to false, it will try to get values without using any conversion at all |
Examples:
https://min-api.cryptocompare.com/data/pricemulti?fsyms=ETH,DASH&tsyms=BTC,USD,EUR
pricemultifull
Get all the current trading info (price, vol, open, high, low etc) of any list of cryptocurrencies in any other currency that you need.If the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. This API also returns Display values for all the fields.If the opposite pair trades we invert it (eg.: BTC-XMR).
| Parameter | Type | Required | Default | Info |
| fsyms | string | true | From Symbol | |
| tsyms | string | true | To Symbols, include multiple symbols | |
| e | string | false | CCCAGG | Name of exchange. Default: CCCAGG |
| extraParams | string | false | NotAvailable | Name of your application |
| sign | bool | false | false | If set to true, the server will sign the requests. |
| tryConversion | bool | false | true | If set to false, it will try to get values without using any conversion at all |
Examples:
https://min-api.cryptocompare.com/data/pricemultifull?fsyms=ETH,DASH&tsyms=BTC,USD,EUR
generateAvg
Compute the current trading info (price, vol, open, high, low etc) of the requested pair as a volume weighted average based on the markets requested.
| Parameter | Type | Required | Default | Info |
| fsym | string | true | From Symbol | |
| tsym | string | true | To Symbols | |
| markets | string | true | CCCAGG | Name of exchanges, include multiple |
| extraParams | string | false | NotAvailable | Name of your application |
| sign | bool | false | false | If set to true, the server will sign the requests. |
| tryConversion | bool | false | true | If set to false, it will try to get values without using any conversion at all |
Examples:
https://min-api.cryptocompare.com/data/generateAvg?fsym=BTC&tsym=USD&markets=Coinbase,Bitfinex
dayAvg
Get day average price. The values are based on hourly vwap data and the average can be calculated in different waysIt uses BTC conversion if data is not available because the coin is not trading in the specified currency. If tryConversion is set to false it will give you the direct data. If no toTS is given it will automatically do the current day. Also for different timezones use the UTCHourDiff paramThe calculation types are: HourVWAP - a VWAP of the hourly close price,MidHighLow - the average between the 24 H high and low.VolFVolT - the total volume from / the total volume to (only avilable with tryConversion set to false so only for direct trades but the value should be the most accurate price)
| Parameter | Type | Required | Default | Info |
| fsym | string | true | From Symbol | |
| tsym | string | true | To Symbols | |
| e | string | false | CCCAGG | Name of exchange |
| extraParams | string | false | NotAvailable | Name of your application |
| sign | bool | false | false | If set to true, the server will sign the requests. |
| tryConversion | bool | false | true | If set to false, it will try to get values without using any conversion at all |
| avgType | string | false | HourVWAP | |
| UTCHourDiff | int | false | 0 | By deafult it does UTC, if you want a different time zone just pass the hour difference. For PST you would pass -8 for example. |
| toTs | timestamp | false | hour unit |
Examples:
PriceHistorical
Success examples
{"ETH":{"BTC":0.00261,"USD":1.14,"EUR":1.04}}
Error examples
{"Response":"Error",
"Message":"Additional supply depots required. (Invalid Market)",
"Data":[],
"Type":99}
{"Response":"Error",
"Message":"I'm sorry, if you were right, I'd agree with you.(missing tsyms parameter - the symbol or commas separated symbol of the currency to want the quote in)",
"Data":[],
"Type":99}
{"Response":"Error",
"Message":"I'm sorry, if you were right, I'd agree with you.(missing fsym parameter - the symbol, ticker of the coin you want to get the data for)",
"Data":[],
"Type":99}
{"Response":"Error",
"Message":"I'm sorry, if you were right, I'd agree with you.(missing ts parameter - timestamp for price)","Data":[],"Type":99}
Get the price of any cryptocurrency in any other currency that you need at a given timestamp. The price comes from the daily info - so it would be the price at the end of the day GMT based on the requested TS. If the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Tries to get direct trading pair data, if there is none or it is more than 30 days before the ts requested, it uses BTC conversion. If the opposite pair trades we invert it (eg.: BTC-XMR)
This API moved to
https://min-api.cryptocompare.com/data/pricehistorical
Documentation at https://min-api.cryptocompare.com/
Get the price of a currency against multiple currencies.
| Parameter | Type | Required | Default | Info |
| fsym | string | true | From Symbol | |
| tsyms | string | true | To Symbols, include multiple | |
| ts | timestamp | false | ||
| markets | string | true | CCCAGG | Name of exchanges, include multiple |
| extraParams | string | false | NotAvailable | Name of your application |
| sign | bool | false | false | If set to true, the server will sign the requests. |
| tryConversion | bool | false | true | If set to false, it will try to get values without using any conversion at all |
Example:
CoinSnapshot
Success examples
{"Response":"Success",
"Message":"Coin snapshot succesfully returned",
"Type":100,
"Data":{"Algorithm":"SHA256",
"ProofType":"PoW",
"BlockNumber":378345,
"NetHashesPerSecond":465548431.66333866,
"TotalCoinsMined":14707625.0,
"BlockReward":25.0,
"AggregatedData":{"TYPE":"5",
"MARKET":"CCCAGG",
"FROMSYMBOL":"BTC",
"TOSYMBOL":"USD",
"FLAGS":"4",
"PRICE":"245.41",
"LASTUPDATE":"1444520460",
"LASTVOLUME":"0.0086",
"LASTVOLUMETO":"2.110268",
"LASTTRADEID":"1444520460357",
"VOLUME24HOUR":"49591.48108707269",
"VOLUME24HOURTO":"12139110.189163648",
"OPEN24HOUR":"244.41",
"HIGH24HOUR":"258.37",
"LOW24HOUR":"239.01000004",
"LASTMARKET":"Huobi"},
"Exchanges":[
{"TYPE":"2",
"MARKET":"LakeBTC",
"FROMSYMBOL":"BTC",
"TOSYMBOL":"USD",
"FLAGS":"2",
"PRICE":"244.37",
"LASTUPDATE":"1444513131",
"LASTVOLUME":"0.03",
"LASTVOLUMETO":"7.3311",
"LASTTRADEID":"1444513131",
"VOLUME24HOUR":"3599.0560000000005",
"VOLUME24HOURTO":"879237.6299349999",
"OPEN24HOUR":"243.83",
"HIGH24HOUR":"245.23",
"LOW24HOUR":"242.68"}
....
]
}
Error examples
{"Response":"Error",
"Message":"Coin snapshot missing fsym parameter (from symbol)",
"Type":99}
{"Response":"Error",
"Message":"Coin snapshot missing tsym parameter (to symbol)",
"Type":99}
{"Response":"Error",
"Message":"DB unexpected error",
"Type":1}
{"Response":"Error",
"Message":"Price data unexpected error",
"Type":2}
Get data for a currency pair. It returns general block explorer information, aggregated data and individual data for each exchange available.
This api is getting abused and will be moved to a min-api path in the near future. Please try not to use it.
URL Parameters
| Parameter | Type | Mandatory | Description |
| fsym | string | yes | The symbol of the currency you want to get that for |
| tsym | string | yes | The symbol of the currency that data will be in. |
Return data
| Parameter | Type | Always returned | Description |
| Response | string | yes | The type of the response (Success or Error) |
| Message | string | yes | The message for the response |
| Type | integer | yes | Integer representing the type of response. |
| Data | object | yes | Empty if there is no data to return or there is an error |
| Data:Algorithm | string | yes | The algorithm of the from currency |
| Data:ProofType | string | yes | The proof type of the from currency |
| Data:BlockNumber | integer | yes | The current block number (delayed by 1 hour max) |
| Data:NetHashesPerSecond | integer | yes | The current network hashes per second (delayed by 1 hour max) |
| Data:TotalCoinsMined | integer | yes | The current total coins mined (delayed by 1 hour max) |
| Data:BlockReward |
integer | yes | The current block reward (delayed by 1 hour max) |
| Data:AggregatedData | object | yes | See success request example |
| Data:Exchanges | Array[] | yes | See success request example |
Request examples
Get snapshot example
https://www.cryptocompare.com/api/data/coinsnapshot/?fsym=BTC&tsym=USD
https://www.cryptocompare.com/api/data/coinsnapshot/?fsym=ETH&tsym=BTC
CoinSnapshotFullById
Success examples
{
"Response": "Success",
"Message": "Coin full snapshot successfully returned",
"Data": {
"General": {
"H1Text": "Bitcoin (BTC)",
"ImageUrl": "/media/19633/btc.png",
"DangerTop": "",
"WarningTop": "",
"InfoTop": "",
"Symbol": "BTC",
"BaseUrl": "/coins/btc/",
"Name": "Bitcoin",
"Description": ".....",
"Features": ".....",
"Technology": ".....",
"TotalCoinSupply": "21000000",
"Algorithm": "SHA256",
"ProofType": "PoW",
"StartDate": "03/01/2009",
"Twitter": "@bitcoin",
"TwitterWidgetId": "605777095042539520",
"Website": "Bitcoin",
"LastBlockExplorerUpdateTS": 1449237480,
"DifficultyAdjustment": "2016 blocks",
"BlockRewardReduction": "50%",
"BlockNumber": 386680,
"BlockTime": 565,
"NetHashesPerSecond": 553105562.19548678,
"TotalCoinsMined": 14910150.0,
"PreviousTotalCoinsMined": 14910125.0,
"BlockReward": 25.0
},
"Subs": ["2~Coinfloor~BTC~GBP", "2~LocalBitcoins~BTC~PHP", "2~LocalBitcoins~BTC~IDR", "2~Kraken~BTC~GBP", "2~Huobi~BTC~USD", "2~Kraken~BTC~JPY", "2~LocalBitcoins~BTC~SEK", "2~MonetaGo~BTC~HKD", "2~itBit~BTC~SGD", "2~LocalBitcoins~BTC~GBP", "2~BTER~BTC~CNY", "2~Coinsetter~BTC~USD", "2~Gatecoin~BTC~EUR", "2~Coinbase~BTC~USD",
...
],
"StreamerDataRaw": [ "5~CCCAGG~BTC~USDT~4~393~1453110501~0.00016925~0.06651525~3568~0.009621729999999998~3.56393285~370~393~370~BitTrex~78ce9","5~CCCAGG~BTC~RSD~4~28378.38~1427195634~0.888~25200.00144~1193482~0~0~28378.38~28378.38~28378.38~LocalBitcoins~78ce9","5~CCCAGG~BTC~DOP~4~22753.13~1452105617~0.0879~2000.0001270000002~2361991~0~0~22753.13~22753.13~22753.13~LocalBitcoins~78ce9",
...
]
},
"Type": 100
}
Error examples
{"Response":"Error",
"Message":"Missing id parameter",
"Data":{"General":{},"Subs":[],"AggregatedPrices":[]},
"Type":2}
{"Response":"Error",
"Message":"Yey there is an id, but guess what... it's not a number, come on you can do better:)",
"Data":{"General":{},"Subs":[],"AggregatedPrices":[]},
"Type":3}
{"Response":"Error",
"Message":"Yay there is an id, it's numeric so 100% for the effort, but sadly the number is not useful in any way. What are you trying to do?",
"Data":{"General":{},"Subs":[],"AggregatedPrices":[]},
"Type":4}
Get the general, subs (used to connect to the streamer and to figure out what exchanges we have data for and what are the exact coin pairs of the coin) and the aggregated prices for all pairs available.
URL Parameters
| Parameter | Type | Mandatory | Description |
| id | int | yes | The id of the coin you want data for |
Return data
Data:AggregatedPricesArray[]yesSnapshot data about the coin (volume, price, open, high, low close etc)
| Parameter | Type | Always returned | Description |
| Response | string | yes | The type of the response (Success or Error) |
| Message | string | yes | The message for the response |
| BaseImageUrl | string | yes | The base url for all the images from the ImageUrl field |
| BaseLinkUrl | string | yes | The base url for all the links from the Url field |
| Type | int | yes | Integer representing the type of response. |
| Data | object | yes | Empty if there is no data to return or there is an error |
| Data:General | object | yes | The general data available for this coin |
| Data:General:H1Text | string | yes | The title used on our website (a combination of the coin name and the symbol) |
| Data:General:ImageUrl | string | yes | The relative path to the logo of the coin, prefix this value with the BaseImageUrl to get the absolute path |
| Data:General:DangerTop | string | yes | The text displayed in red on the website at the top, generally a big issue with the coin |
| Data:General:WarningTop | string | yes | The text displayed in yellow on the website at the top, generally an issue with the coin |
| Data:General:InfoTop | string | yes | The text displayed in green on the website at the top, generally an announcement or extra info that is important |
| Data:General:Symbol | string | yes | The symbol of the coin |
| Data:General:Url | string | yes | The relative path to the coin, prefix this value with the BaseLinkUrl to get the absolute path |
| Data:General:Name | string | yes | The name of the coin |
| Data:General:Description | string | yes | The description of the coin, this is returned as html |
| Data:General:Features | string | yes | The features of the coin, this is returned as html |
| Data:General:Technology | string | yes | The technology of the coin, this is returned as html |
| Data:General:TotalCoinSupply | int | yes | The maximum number of coins |
| Data:General:Algorithm | string | yes | The algorithm of the coin |
| Data:General:ProofType | string | yes | The proof type of the coin |
| Data:General:StartDate | string | yes | The day the first block was mined, so the day the coin actually came into existance |
| Data:General:Twitter | string | yes | The twitter address of the coin |
| Data:General:TwitterWidgetId | string | yes | The cryptocompare twitter widget id for this coin |
| Data:General:Website | string | yes | The coin official website |
| Data:General:LastBlockExplorerUpdateTS | ts | yes | The last time our block explorer got data about this coin |
| Data:General:DifficultyAdjustment | string | yes | The difficulty adjustment |
| Data:General:BlockRewardReduction | string | yes | The value by which the block reward is reduced when there is a block reward reduction |
| Data:General:BlockNumber | int | yes | The current block number (delayed by 1 hour max) |
| Data:General:BlockTime | int | yes | The estimated time it takes to mine a block |
| Data:General:NetHashesPerSecond | int | yes | The current network hashes per second (delayed by 1 hour max) |
| Data:General:TotalCoinsMined | int | yes | The current total coins mined (delayed by 1 hour max) |
| Data:General:PreviousTotalCoinsMined | int | yes | The total coins mined as of the previous block, this should be the value of the current block total coins mined - the block reward in most cases. |
| Data:General:BlockReward |
int | yes | The current block reward (delayed by 1 hour max) |
| Data:Subs | Array[] | yes | An array of subscriptions used for the streamer and for figuring out what the coin pairs are |
| Data:StreamerDataRaw | Array[] | yes | See success request example |
Request examples
Get snapshot example
https://www.cryptocompare.com/api/data/coinsnapshotfullbyid/?id=1182 //for BTC
https://www.cryptocompare.com/api/data/coinsnapshotfullbyid/?id=3808 //for LTC
https://www.cryptocompare.com/api/data/coinsnapshotfullbyid/?id=7605//for ETH
SocialStats
Success examples
{
"Response": "Success",
"Message": "Social data successfully returned",
"Type": 100,
"Data": {
"General": {
"Name": "BTC",
"CoinName": "Bitcoin",
"Type": "Webpagecoinp",
"Points": 344868
},
"CryptoCompare": {
"SimilarItems": [{
"Id": 4432,
"Name": "Dogecoin",
"FullName": "Dogecoin (DOGE)",
"ImageUrl": "/media/19684/doge.png",
"Url": "/coins/doge/",
"FollowingType": 1
}, {
"Id": 3808,
"Name": "Litecoin",
"FullName": "Litecoin (LTC)",
"ImageUrl": "/media/19782/ltc.png",
"Url": "/coins/ltc/",
"FollowingType": 1
}, {
"Id": 7605,
"Name": "Ethereum ",
"FullName": "Ethereum (ETH)",
"ImageUrl": "/media/20646/eth.png",
"Url": "/coins/eth/",
"FollowingType": 1
}, {
"Id": 4592,
"Name": "ReddCoin",
"FullName": "ReddCoin (RDD)",
"ImageUrl": "/media/19887/rdd.png",
"Url": "/coins/rdd/",
"FollowingType": 1
}, {
"Id": 4430,
"Name": "DigiByte",
"FullName": "DigiByte (DGB)",
"ImageUrl": "/media/19673/dgb.png",
"Url": "/coins/dgb/",
"FollowingType": 1
}],
"CryptopianFollowers": [{
"Id": 10963,
"Name": "endeverinc",
"ImageUrl": "/Media/Avatars/10963/472d630c-0868-4cb7-95a3-d17b53571ddb.jpg",
"Url": "/profile/endeverinc/",
"Type": "Cryptopian"
}, {
"Id": 13274,
"Name": "viktdokt",
"ImageUrl": "/Media/Avatars/13274/11fac650-cbb2-4d77-87f3-5c6de2f5d4e0.jpg",
"Url": "/profile/viktdokt/",
"Type": "Cryptopian"
}, {
"Id": 15275,
"Name": "epicblake6",
"ImageUrl": "/Media/Avatars/15275/691ddc49-f689-42ae-bc1b-ea5d2b146a7c.jpg",
"Url": "/profile/epicblake6/",
"Type": "Cryptopian"
}, {
"Id": 3831,
"Name": "ZeroCool86",
"ImageUrl": "/Media/Avatars/3831/03131f55-425f-4d59-9893-a7c90339fba6.png",
"Url": "/profile/ZeroCool86/",
"Type": "Cryptopian"
}, {
"Id": 13202,
"Name": "andreika-53.ru",
"ImageUrl": "/Media/Avatars/13202/26658e5f-1721-48d7-a861-0a05a5be0b70.jpg",
"Url": "/profile/andreika-53.ru/",
"Type": "Cryptopian"
}, {
"Id": 15218,
"Name": "097023",
"ImageUrl": "/Media/Avatars/15218/7ce5368d-98fa-499f-898e-a0a20acfe375.jpg",
"Url": "/profile/097023/",
"Type": "Cryptopian"
}, {
"Id": 15256,
"Name": "katala323",
"ImageUrl": "/Media/Avatars/15256/ad283f8f-72da-41ba-a906-6ac329a05020.jpg",
"Url": "/profile/katala323/",
"Type": "Cryptopian"
}, {
"Id": 15255,
"Name": "darmaed1987",
"ImageUrl": "/Media/Avatars/15255/6c5d270b-cc00-46b3-b586-b2029861a0f0.jpg",
"Url": "/profile/darmaed1987/",
"Type": "Cryptopian"
}, {
"Id": 15215,
"Name": "Tgalligan32170",
"ImageUrl": "/Media/Avatars/15215/0f27dc46-8f22-4176-9c1e-648a26e6d6eb.jpg",
"Url": "/profile/Tgalligan32170/",
"Type": "Cryptopian"
}, {
"Id": 8725,
"Name": "lomakins62",
"ImageUrl": "/Media/Avatars/8725/57a06b1e-9b42-4b09-b307-6c55e422506b.jpg",
"Url": "/profile/lomakins62/",
"Type": "Cryptopian"
}, {
"Id": 14179,
"Name": "gorbanyov_v",
"ImageUrl": "/Media/Avatars/14179/dbc22640-83ec-4039-a766-dc1058053e39.jpg",
"Url": "/profile/gorbanyov_v/",
"Type": "Cryptopian"
}],
"Comments": "159",
"Points": 8140,
"Posts": "74",
"Followers": 188,
"PageViewsSplit": {
"Overview": 32095,
"Markets": 2180,
"Analysis": 2258,
"Charts": 2490,
"Trades": 946,
"Forum": 1829,
"Influence": 1102
},
"PageViews": 42900
},
"Twitter": {
"followers": 98788,
"following": "98",
"lists": 1891,
"favourites": "71",
"statuses": 12616,
"account_creation": "1313643968",
"name": "Bitcoin",
"link": "https://twitter.com/bitcoin",
"Points": 108255
},
"Reddit": {
"subscribers": 176594,
"active_users": 381,
"community_creation": "1284042626",
"posts_per_hour": "5.06",
"posts_per_day": "121.49",
"comments_per_hour": "44.82",
"comments_per_day": 1075.7,
"link": "https://www.reddit.com/r/bitcoin/",
"name": "Bitcoin",
"Points": 179888
},
"Facebook": {
"likes": 25816,
"is_closed": "false",
"talking_about": 93,
"name": "Bitcoin P2P Cryptocurrency",
"link": "https://www.facebook.com/bitcoins/",
"Points": 26746
},
"CodeRepository": {
"List": [{
"stars": 7918,
"language": "C++",
"forks": 5439,
"open_total_issues": "402",
"subscribers": 1013,
"size": "100332",
"url": "https://github.com/bitcoin/bitcoin",
"last_update": "1449226680",
"last_push": "1449225545",
"created_at": "1292771803",
"fork": "false",
"source": {
"Name": "",
"Url": "",
"InternalId": -1
},
"parent": {
"Name": "",
"Url": "",
"InternalId": -1
},
"open_pull_issues": "79",
"closed_pull_issues": "4820",
"closed_total_issues": "6753",
"open_issues": "323",
"closed_issues": "1933"
}],
"Points": 21835
}
}
}
Error examples
{"Response":"Error",
"Message":"Please provide the id of the coin you want to get social data for.",
"Data":{},
"Type":2}
{"Response":"Error",
"Message":"Unexpected error",
"Data":{},
"Type":99}
Get CryptoCompare website, Facebook, code repository, Twitter and Reddit data for coins. If called with the id of a cryptopian you just get data from our website that is available to the public. (maybe in v2 add the rest of the fields for the cryptopian as well?)
URL Parameters
| Parameter | Type | Mandatory | Description |
| id | int | yes | The id of the coin/exchange you want social data for |
Return data
Data:Facebook:linkurlnoFacebook account linkData:CodeRepository:List[]:Source:InternalData:UrlstringnoThe relative path (without https://www.cryptocompare.com) of the coin page this is a fork ofData:CodeRepository:List[]:Parent:InternalData:UrlstringnoThe relative path (without https://www.cryptocompare.com) of the coin page this is a fork of
| Parameter | Type | Always returned | Description |
| Response | string | yes | The type of the response (Success or Error) |
| Message | string | yes | The message for the response |
| Type | integer | yes | Integer representing the type of response. |
| Data | object | yes | Empty if there is no data to return or there is an error |
| Data:General | object | yes | The general social info |
| Data:General:Name | string | yes | The name of the exchange / symbol of the coin |
| Data:General:CoinName | string | yes | The name of the coin |
| Data:General:Type | string | yes | The type of the page: Webpagecoinp or Webpageexchangep |
| Data:General:Points | string | yes | The sum of all the individual points categories |
| Data:CryptoCompare | object | yes | The social data from our website |
| Data:CryptoCompare:SimilarItems | Array[5] | yes | Similar coins/ exchanges based on the number of total points |
| Data:CryptoCompare:SimilarItems[]:Id | int | yes | The id of the coin/exchange |
| Data:CryptoCompare:SimilarItems[]:Name | string | yes | The name of the exchange / symbol of the coin |
| Data:CryptoCompare:SimilarItems[]:FullName | string | yes | The full name of the exchange / name of the coin |
| Data:CryptoCompare:SimilarItems[]:ImageUrl | string | yes | The relative path (without https://www.cryptocompare.com) of the coin/exchange logo |
| Data:CryptoCompare:SimilarItems[]:Url | string | yes | The relative path (without https://www.cryptocompare.com) of the coin/exchange |
| Data:CryptoCompare:SimilarItems[]:FollowingType | int | yes | The type of following when someone wants to follow this coin/exchange (1 for coin, 2 for exchange) |
| Data:CryptoCompare:CryptopianFollowers | Array[11] | yes | Up to 11 followers (11 because in the front end if you are one of the 10 and you unfollow we still want to show 10) |
| Data:CryptoCompare:CryptopianFollowers[]:Id | int | yes | The id of the cryptopain that is following |
| Data:CryptoCompare:CryptopianFollowers[]:Name | string | yes | The name of the cryptopain that is following |
| Data:CryptoCompare:CryptopianFollowers[]:ImageUrl | string | yes | The avatar image relative path (without https://www.cryptocompare.com) of the cryptopain that is following |
| Data:CryptoCompare:CryptopianFollowers[]:Url | string | yes | The the profile page relative path (without https://www.cryptocompare.com) of the cryptopain that is following |
| Data:CryptoCompare:CryptopianFollowers[]:Type | string | yes | The type of the follower : Cryptopian |
| Data:CryptoCompare:Comments | int | yes | The total forum comments on the coin/exchange |
| Data:CryptoCompare:Points | int | yes | The total CryptoCompare points of the coin/exchange |
| Data:CryptoCompare:Posts | int | yes | The total forum posts on the coin/exchange |
| Data:CryptoCompare:Followers | int | yes | The total number of followers of the coin/exchange |
| Data:CryptoCompare:PageViewsSplit | obj | yes | The page views of the coin/exchange split by category |
| Data:CryptoCompare:PageViewsSplit:Overview | int | yes | The Overview page views of the coin/exchange |
| Data:CryptoCompare:PageViewsSplit:Markets | int | no | The Markets page views of the coin |
| Data:CryptoCompare:PageViewsSplit:Analysis | int | no | The Analysis page views of the coin |
| Data:CryptoCompare:PageViewsSplit:Charts | int | no | The Charts page views of the coin |
| Data:CryptoCompare:PageViewsSplit:Reviews | int | no | The Reviews page views of the exchange |
| Data:CryptoCompare:PageViewsSplit:Trades | int | yes | The Trades page views of the coin/exchange |
| Data:CryptoCompare:PageViewsSplit:Forum | int | yes | The Forum page views of the coin |
| Data:CryptoCompare:PageViewsSplit:Influence | int | yes | The Influence page views of the coin/exchange |
| Data:CryptoCompare:PageViews | int | yes | The total page views of the coin/exchange (sum of all PageViewsSplit) |
| Data:Twitter | obj | yes | The Twitter social data |
| Data:Twitter:followers | int | no | Total Twitter followers |
| Data:Twitter:lists | int | no | Total Twitter lists that the account is part of |
| Data:Twitter:favourites | int | no | Total Twitter favourites |
| Data:Twitter:statuses | int | no | Total Twitter statuses |
| Data:Twitter:account_creation | ts | no | Twitter account creation date |
| Data:Twitter:name | string | no | Twitter account name |
| Data:Twitter:link | url | no | Twitter account link |
| Data:Twitter:Points | int | yes | Twitter total points |
| Data:Reddit | obj | yes | The Reddit social data |
| Data:Reddit:subscribers | int | no | Total Reddit subscribers |
| Data:Reddit:active_users | int | no | Total Reddit active users |
| Data:Reddit:community_creation | ts | no | Reddit community creation date |
| Data:Reddit:posts_per_hour | int | no | Total Reddit posts per hour |
| Data:Reddit:posts_per_day | int | no | Total Reddit posts per day |
| Data:Reddit:comments_per_hour | int | no | Total Reddit comments per hour |
| Data:Reddit:comments_per_day | int | no | Total Reddit comments per day |
| Data:Reddit:link | url | no | Reddit account link |
| Data:Reddit:name | string | no | Reddit account name |
| Data:Reddit:Points | int | yes | Reddit total points |
| Data:Facebook | obj | yes | The Facebook social data |
| Data:Facebook:likes | int | no | Total Facebook likes |
| Data:Facebook:is_closed | bool | no | Is Facebook account closed |
| Data:Facebook:name | string | no | Facebook account name |
| Data:Facebook:talking_about | int | no | Total number of Facebook users that are talking about this page |
| Data:Facebook:Points | int | no | Facebook total points |
| Data:CodeRepository | obj | yes | The code repository social data - only for certain coins |
| Data:CodeRepository:List | Array[] | no | List of code repositories for this coin |
| Data:CodeRepository:List[]:stars | int | no | Code repository stars |
| Data:CodeRepository:List[]:language | string | no | Code repository programming language (C++,Java,GO,Python,JavaScript etc) |
| Data:CodeRepository:List[]:forks | int | no | Code repository total forks, including forks of forks |
| Data:CodeRepository:List[]:open_total_issues | int | no | Code repository open total pull requests and bugs |
| Data:CodeRepository:List[]:subscribers | int | no | Code repository total subscribers |
| Data:CodeRepository:List[]:size | int | no | Code repository size in bytes |
| Data:CodeRepository:List[]:url | url | no | Code repository url |
| Data:CodeRepository:List[]:last_update | ts | no | Code repository date of last update |
| Data:CodeRepository:List[]:last_push | ts | no | Code repository date of last push |
| Data:CodeRepository:List[]:created_at | ts | no | Code repository date of creation |
| Data:CodeRepository:List[]:fork | bool | no | Is code repository a fork (true/false) |
| Data:CodeRepository:List[]:Source | obj | no | If it is a fork, this has actual data about the coin it is a fork of - the source (parent of parent or higher - this is the same as the parent when this is the first fork). If we have the coin on crypto compare it contains data about the coin, otherwise it has the name and url of the code repo |
| Data:CodeRepository:List[]:Source:Name | bool | no | Name of the source code repo |
| Data:CodeRepository:List[]:Source:Url | url | no | Url of the source code repo |
| Data:CodeRepository:List[]:Source:InternalId | int | no | -1 if we don't have it, the actual id if we have it. |
| Data:CodeRepository:List[]:Source:InternalData | obj | no | Details about the coin page this is a fork of |
| Data:CodeRepository:List[]:Source:InternalData:Id | int | no | Id the coin page this is a fork of |
| Data:CodeRepository:List[]:Source:InternalData:Name | string | no | Name the coin page this is a fork of |
| Data:CodeRepository:List[]:Source:InternalData:Symbol | string | no | Symbol the coin page this is a fork of |
| Data:CodeRepository:List[]:Source:InternalData:ImageUrl | string | no | The logo image relative path (without https://www.cryptocompare.com) of the coin page this is a fork of |
| Data:CodeRepository:List[]:Source:InternalData:Type | string | no | The type of the page this is a fork of - Webpagecoinp |
| Data:CodeRepository:List[]:Parent | obj | no | If it is a fork, this has actual data about the coin it is a fork of - the direct parent. If we have the coin on crypto compare it contains data about the coin, otherwise it has the name and url of the code repo |
| Data:CodeRepository:List[]:Parent:Name | bool | no | Name of the parent code repo |
| Data:CodeRepository:List[]:Parent:Url | url | no | Url of the parent code repo |
| Data:CodeRepository:List[]:Parent:InternalId | int | no | -1 if we don't have it, the actual id if we have it. |
| Data:CodeRepository:List[]:Parent:InternalData | obj | no | Details about the coin page this is a fork of |
| Data:CodeRepository:List[]:Parent:InternalData:Id | int | no | Id the coin page this is a fork of |
| Data:CodeRepository:List[]:Parent:InternalData:Name | string | no | Name the coin page this is a fork of |
| Data:CodeRepository:List[]:Parent:InternalData:Symbol | string | no | Symbol the coin page this is a fork of |
| Data:CodeRepository:List[]:Parent:InternalData:ImageUrl | string | no | The logo image relative path (without https://www.cryptocompare.com) of the coin page this is a fork of |
| Data:CodeRepository:List[]:Parent:InternalData:Type | string | no | The type of the page this is a fork of - Webpagecoinp |
| Data:CodeRepository:List[]:open_pull_issues | int | no | Code repository number of open pulls |
| Data:CodeRepository:List[]:closed_pull_issues | int | no | Code repository number of closed pulls - either merged or deemed unsuitable |
| Data:CodeRepository:List[]:closed_total_issues | int | no | Code repository number of closed issues (pulls,bugs,features etc) |
| Data:CodeRepository:List[]:open_issues | int | no | Code repository number of open bugs,features etc without pulls |
| Data:CodeRepository:List[]:closed_issues | int | no | Code repository number of closed bugs,features etc without pulls |
| Data:CodeRepository:Points | int | yes | Code repository total points |
Request examples
Get social stats example
https://www.cryptocompare.com/api/data/socialstats/?id=1182
https://www.cryptocompare.com/api/data/socialstats/?id=3808
https://www.cryptocompare.com/api/data/socialstats/?id=7605
HistoMinute
Success examples
{"Response":"Success",
"Message": "Looking at cleavage is like looking at the sun. You don't stare at it. It's too risky. Ya get a sense of it and then you look away.",
"Type":100,
"Aggregated":false,
"Data":[{
"time": 1453116960.0,
"open": 0.00384,
"high": 0.00384,
"low": 0.00381,
"close": 0.00381,
"volumefrom": 4161.39031358,
"volumeto": 15.88741374
},
....
],
"FirstValueInArray": true,
"TimeTo": 1453120560,
"TimeFrom": 1453116960
}
Error examples
{"Response":"Error",
"Message":"Additional supply depots required. (Invalid Market)",
"Type":99}
Get open, high, low, close, volumefrom and volumeto from the each minute historical data. This data is only stored for 7 days, if you need more,use the hourly or daily path. It uses BTC conversion if data is not available because the coin is not trading in the specified currency
This API moved to https://min-api.cryptocompare.com/data/histominute
Documentation at https://min-api.cryptocompare.com/
| Parameter | Type | Required | Default | Info |
| fsym | string | true | From Symbol | |
| tsym | string | true | To Symbols | |
| e | string | true | CCCAGG | Name of exchange |
| extraParams | string | false | NotAvailable | Name of your application |
| sign | bool | false | false | If set to true, the server will sign the requests. |
| tryConversion | bool | false | true | If set to false, it will try to get values without using any conversion at all |
| aggregate | int | false | 1 | |
| limit | int | false | 1440 | Max 2000 |
| toTs | timestamp | false |
Examples:
https://min-api.cryptocompare.com/data/histominute?fsym=BTC&tsym=USD&limit=60&aggregate=3&e=CCCAGG,
https://min-api.cryptocompare.com/data/histominute?fsym=BTC&tsym=ETH&limit=30&aggregate=1&e=CCCAGG
HistoHour
Success examples
{
"Response":"Success",
"Message":"Looking at cleavage is like looking at the sun. You don't stare at it. It's too risky. Ya get a sense of it and then you look away.",
"Type":100,
"Aggregated":true,
"Data":[
{
"time":1483526340,
"close":1067.63,
"high":1068.05,
"low":1067.32,
"open":1067.32,
"volumefrom":179.86,
"volumeto":191492.44
},
...
],
"TimeTo":1483537200,
"TimeFrom":1483526340,
"FirstValueInArray":true
}
Error examples
{"Response":"Error",
"Message":"Additional supply depots required. (Invalid Market)",
"Type":99}
Get open, high, low, close, volumefrom and volumeto from the each hour historical data. It uses BTC conversion if data is not available because the coin is not trading in the specified currency.
This API moved to https://min-api.cryptocompare.com/data/histohour
Documentation at https://min-api.cryptocompare.com/
| Parameter | Type | Required | Default | Info |
| fsym | string | true | From Symbol | |
| tsym | string | true | To Symbols | |
| e | string | true | CCCAGG | Name of exchange |
| extraParams | string | false | NotAvailable | Name of your application |
| sign | bool | false | false | If set to true, the server will sign the requests. |
| tryConversion | bool | false | true | If set to false, it will try to get values without using any conversion at all |
| aggregate | int | false | 1 | |
| limit | int | false | 168 | Max 2000 |
| toTs | timestamp | false |
Examples:
https://min-api.cryptocompare.com/data/histohour?fsym=BTC&tsym=USD&limit=60&aggregate=3&e=CCCAGG,
https://min-api.cryptocompare.com/data/histohour?fsym=BTC&tsym=ETH&limit=30&aggregate=1&e=CCCAGG
HistoDay
Success examples
{"Response":"Success",
"Message": "Battlecruiser operational.Make it happen.Set a course.Take it slow.",
"Type":100,
"Aggregated":false,
"Data":[{
"time": 1445040000.0,
"open": 263.01,
"high": 274.94,
"low": 262.5,
"close": 270.51,
"volumefrom": 129992.56434794325,
"volumeto": 35024476.597084962
},
....
],
"FirstValueInArray": true,
"TimeTo": 1453075200,
"TimeFrom": 1445040000
}
Error examples
{"Response":"Error",
"Message":"Additional supply depots required. (Invalid Market)",
"Type":99}
Get open, high, low, close, volumefrom and volumeto daily historical data. The values are based on 00:00 GMT time. It uses BTC conversion if data is not available because the coin is not trading in the specified currency.
This API moved to https://min-api.cryptocompare.com/data/histoday
Documentation at https://min-api.cryptocompare.com/
| Parameter | Type | Required | Default | Info |
| fsym | string | true | From Symbol | |
| tsym | string | true | To Symbols | |
| e | string | true | CCCAGG | Name of exchange |
| extraParams | string | false | NotAvailable | Name of your application |
| sign | bool | false | false | If set to true, the server will sign the requests. |
| tryConversion | bool | false | true | If set to false, it will try to get values without using any conversion at all |
| aggregate | int | false | 1 | Max 30 |
| limit | int | false | 30 | Max 2000 |
| toTs | timestamp | false | ||
| allData | bool | false | false | get all data |
Examples:
https://min-api.cryptocompare.com/data/histoday?fsym=BTC&tsym=USD&limit=60&aggregate=3&e=CCCAGG,
https://min-api.cryptocompare.com/data/histoday?fsym=BTC&tsym=ETH&limit=30&aggregate=1&e=CCCAGG
MiningContracts
Returns all the mining contracts in a JSON array.
MiningEquipment
Success examples
{"Response":"Success",
"Message":"Mining equipment data successfully returned",
"Type":100,
"Data":[
{ "Id":"2422",
"ParentId":"2355",
"Url":"/mining/achilles-labs/am-6000/",
"LogoUrl":"/media/19532/am-6000.jpg",
"Name":"AM-6000",
"Recommended":"0",
"Featured":"0",
"EquipmentType":"Rig",
"Power":"6000",
"PowerConsumption":"0.63",
"Algorithm":"SHA256",
"Cost":"1940",
"Currency":"USD",
"CostPerGH":"0.32"
},
...
]}
Used to get all the mining equipment available on the website. It returns an array of mining equipment objects
URL Parameters
None
Return data
| Parameter | Type | Always returned | Description |
| Response | string | yes | The type of the response (Success or Error) |
| Message | string | yes | The message for the response |
| Type | integer | yes | Integer representing the type of response. |
| Data | Array of objects | yes | Empty if there is no mining equipment or there is an error. Otherwise an array of objects as represented bellow. |
| Data:Id | integer | no | The id of the mining equipment |
| Data:ParentId | integer | no | The id of the parent company |
| Data:Url | relative link | no | Url of the mining equipment |
| Data:LogoUrl | relative link | no | Url of the image representing the mining equipment |
| Data:Name | string | no | The name of the mining equipment |
| Data:Recommended | integer | no | 1 if the mining equipment is recommend, 0 otherwise |
| Data:Featured | integer | no | 1 if the mining equipment is featured, 0 otherwise |
| Data:EquipmentType | string | no | Equipment type - Rig, Chip, USB, Rig Bundle, Chip Bundle |
| Data:Power | string | no | The power of the mining equipment |
| Data:PowerConsumption | string | no | The power consumption of the mining equipment |
| Data:Algorithm | string | no | The algorithm that the mining equipment is optimized for |
| Data:Cost | string | no | The price of the mining equipment |
| Data:Currency | string | no | The currency that the price is in |
| Data:CostPerGH | string | no | The total cost in the currency above per giga hash. |
Request examples
Get all the mining equipment:
https://www.cryptocompare.com/api/data/miningequipment/
TopPairs
Success examples
{
"Response": "Success",
"Data": [{
"exchange": "CCCAGG",
"fromSymbol": "BTC",
"toSymbol": "JPY",
"volume24h": 240839.38981815398,
"volume24hTo": 59839358693.420456
}, {
"exchange": "CCCAGG",
"fromSymbol": "BTC",
"toSymbol": "USD",
"volume24h": 182276.55647577194,
"volume24hTo": 399544474.82616633
}, {
"exchange": "CCCAGG",
"fromSymbol": "BTC",
"toSymbol": "CNY",
"volume24h": 55163.42598284995,
"volume24hTo": 827872114.7016374
}, {
"exchange": "CCCAGG",
"fromSymbol": "BTC",
"toSymbol": "KRW",
"volume24h": 53582.28473825996,
"volume24hTo": 135905671015.36697
}, {
"exchange": "CCCAGG",
"fromSymbol": "BTC",
"toSymbol": "EUR",
"volume24h": 27681.390258209998,
"volume24hTo": 52932460.06752091
}]
}
Get top pairs by volume for a currency (always uses our aggregated data). The number of pairs you get is the minimum of the limit you set (default 5) and the total number of pairs available
| Parameter | Type | Required | Default | Info |
| fsym | string | true | From Symbol | |
| tsym | string | true | To Symbol | |
| limit | int | false | 5 | Max 2000 |
| sign | bool | false | false | If set to true, the server will sign the request |
Examples:
https://min-api.cryptocompare.com/data/top/pairs?fsym=ETH
https://min-api.cryptocompare.com/data/top/pairs?fsym=BTC&limit=20
https://min-api.cryptocompare.com/data/top/pairs?fsym=ZEC&limit=20
Web Socket
var socket = io.connect('https://streamer.cryptocompare.com/');
Get real-time market data updates by connecting to our web socket 'wss://streamer.cryptocompare.com'. We are using socket.io.
For more example code click here.
Subscribe
socket.emit('SubAdd', { subs: ['0~Poloniex~BTC~USD'] } );
Subscribe to market data by emitting 'SubAdd' including a list of items you want to get updates on.
Subscription items have the format of '{SubscriptionId}~{ExchangeName}~{FromSymbol}~{ToSymbol}'
Example:
socket.emit('SubAdd', { subs: ['0~Poloniex~BTC~USD'] } );
You can subscribe to the following:
| SubscriptionId | Name | Description |
| 0 | TRADE | Trade level data on a currency pair from a specific exchange. |
| 2 | CURRENT | Latest quote update of a currency pair from a specific exchange. |
| 5 | CURRENTAGG | Quote update aggregated over the last 24 hours of a currency pair from a specific exchange. |
Unsubscribe
socket.emit('SubRemove', { subs: ['0~Poloniex~BTC~USD'] } );
Unsubscribe by sending 'SubRemove' message with a list of items.
Trade
Subscribe to trade level data.
Example:
['0~Poloniex~BTC~USD']
The response will have the following format:
'{SubscriptionId}~{ExchangeName}~{CurrencySymbol}~{CurrencySymbol}~{Flag}~{TradeId}~{TimeStamp}~{Quantity}~{Price}~{Total}'
| Flag | Description |
| 1 | Buy |
| 2 | Sell |
| 4 | Unknown |
Current
Get the latest quote updates for a currency pair on a specific exchange.
Example:
['2~Poloniex~BTC~USD']
The first response will have the following format:
'{Type}~{ExchangeName}~{FromCurrency}~{ToCurrency}~{Flag}~{Price}~{LastUpdate}~{LastVolume}~{LastVolumeTo}~{LastTradeId}~{Volume24h}~{Volume24hTo}~{MaskInt}'
After the first response, only updates will be sent. The MaskInt parameter maps the response to the properties. Use our utility functions to map the response, you can find the code here.
| Flag | Description |
| 1 | PRICEUP |
| 2 | PRICEDOWN |
| 4 | PRICEUNCHANGED |
CurrentAgg
Subscribe to aggregate quote updates. Aggregation is done over the last 24 hours.
Example:
['5~CCCAGG~BTC~USD']
The first response format will follow:
'{SubscriptionId}~{ExchangeName}~{FromCurrency}~{ToCurrency}~{Flag}~{Price}~{LastUpdate}~{LastVolume}~{LastVolumeTo}~{LastTradeId}~{Volume24h}~{Volume24hTo}~{LastMarket}'
After the first response, only updates will be sent. The MaskInt parameter maps the response to the properties. Use our utility functions to map the response, you can find the code here.
