Coinlore
CryptocurrencyHow to Use Coinlore Cryptocurrency Data API
If you are a programmer looking for an easy way to retrieve and use real-time cryptocurrency market data, look no further than the Coinlore Cryptocurrency Data API. This API provides a full range of data on thousands of cryptocurrencies, including market caps, prices, trading volumes, and more.
To get started using this API in your JavaScript code, you will first need to obtain an API key from Coinlore. Once you have your API key, you can use any of the following sample code snippets to request and process data from the Coinlore API.
Example API Requests
Basic Request
This code example simply requests the top 100 cryptocurrencies by market cap:
fetch(`https://api.coinlore.com/api/tickers/?start=0&limit=100`)
.then(response => response.json())
.then(data => console.log(data))
Request with Filters
This code example requests the top cryptocurrencies that are denominated in US dollars and have a market cap greater than $1 billion:
fetch(`https://api.coinlore.com/api/tickers/?start=0&limit=100&tsym=USD&mcgt=1000000000`)
.then(response => response.json())
.then(data => console.log(data))
Historical Price Request
This code example requests historical price data for the Bitcoin cryptocurrency over the last 24 hours:
const tsym = 'USD'
const fsym = 'BTC'
fetch(`https://api.coinlore.com/api/coin/history/${fsym}/?id=${fsym}&tsym=${tsym}&limit=24`)
.then(response => response.json())
.then(data => console.log(data))
Conclusion
The Coinlore Cryptocurrency Data API is a powerful tool for retrieving real-time market data for thousands of cryptocurrencies. With just a few lines of JavaScript code, you can access a wide range of data on cryptocurrencies, including market caps, prices, trading volumes, and more. Try out the above sample code snippets to get started using this API in your own JavaScript code.