Written by ahmed shah on June 4, 2019

How To Get Historical Price Data from CoinLayer

Today we will learn how to use coinlayer’s public API to get historical pricing data of any date. The data is real time and dynamic you can change dates or can get data of as much as coins as you want.

Getting Historical Pricing Data

As you can see above I got this data from coinlayer.com which is an amazing API provider for Price Indexing, conversion, Historical data. There can be a lot of functions that can be achieved using public API of coinlayer. Some advanced functionalities might require authenticated API keys and paid memberships.

Response Example:

{

"success":true,

"terms":"https:\/\/coinlayer.com\/terms",

"privacy":"https:\/\/coinlayer.com\/privacy"

,"timestamp":1553990360,

"target":"USD",

"Historical":true,

"Date":"2019-03-30",

"rates":{"ETH":142.746323,"KMD":1.101378}

}

http://api.coinlayer.com/api/2019-03-30?access_key=007866dcbd35cf6d14951e425a61c422&symbols=ETH,KMD

As you can see this API endpoint will return me the JSON file for historical data according to the date I entered 30th March 2019. The date and the coins are my parameters, which is dynamic and can be changed for different results.

Response Example:

{

"success":true,

"terms":"https:\/\/coinlayer.com\/terms",

"privacy":"https:\/\/coinlayer.com\/privacy"

,"timestamp":1553990360,

"target":"USD",

"Historical":true,

"Date":"2019-03-30",

"rates":{"ETH":142.746323,"KMD":1.101378}

}

The data in JSON format I can furthermore edit the parameters change the date and can even add more coins, here is another example,

http://api.coinlayer.com/api/2019-04-03?access_key=007866dcbd35cf6d14951e425a61c422&symbols=ETH,KMD,BTC,DASH

Now this URL will get me the historical data of Ethereum, Komodo, Bitcoin and DASH from the date 3rd April 2019

Response Example:
{

"Success":true,

"terms":"https:\/\/coinlayer.com\/terms",

"privacy":"https:\/\/coinlayer.com\/privacy",

"Timestamp":1554335944,

"target":"USD",

"Historical":true,

"Date":"2019-04-03",

"rates":{"BTC":4966.744299,"DASH":124.93885,"ETH":161.046317,"KMD":1.206555}

}


You can add these APIs to your websites, or bots to get JSON data that is easily understandable by every programming language and you can feed the data to any software, Web application or mobile app using these JSON formats and APIs. This is really useful data and can help you in a lot of ways if you are working with cryptocurrencies etc.

Back to Top
Experience Crypto
© 2021 komodefi.com. Powered by Komodefi