This is a sponsored article and was made possible by Coinlayer. The actual contents and opinions are the sole views of the author who maintains editorial independence, even when a post is sponsored.
Whether you’re an app developer working on a project that requires displaying live cryptocurrency prices to your users or a web developer looking to do the same for your visitors, you need to hook up to a reliable API that provides lightning-quick responses and gives you enterprise-level integration.
Because of the insane amount of volatility inherent in most coins, the price of a cryptocurrency won’t usually be valid from one day to the next. You need something that gives you prices by the hour, at the very least. Coinlayer provides this kind of service for over 300 different coins against a variety of fiat currencies, and we’ll be having a look at the service and how it works from the inside.
To do this review effectively, I created a free account on the site, which offers me an API key that allows me to test some features with limited support from the company.
I also decided to get hands-on and set up an Nginx server on one of my empty boxes running Linux with barebones necessities including PHP7. What I wanted to demonstrate to myself is that this API would not need anything more than a basic web server setup without any extra bells and whistles. Upon discovering that the Coinlayer API uses JSON as its data delivery model, I figured this is all I’d need.
To create my code, I used notepadqq, a personal preference for small projects coded in Linux.
My test was focused chiefly on a web developer’s perspective, although JSON is used often in Android and iOS app development. There shouldn’t be any difference in the level of service that either type of developer receives from Coinlayer, since it is platform-agnostic.
After sifting through the API documentation, it took me a grand total of ten minutes to figure out how it works and plan the barebones integration I’d have on my local server. The API has six endpoints for the following activities:
- Listing of cryptocurrency pairs
- A live update on a particular coin’s price against another coin or fiat currency
- A historical endpoint where one could find the price of a cryptocurrency against a fiat value on a particular date
- A conversion API that allows the developer to output the value of X coins against X amount of fiat currency
- A time frame API that allows the developer to list the price fluctuations of a cryptocurrency around a certain period of time
- A “change” endpoint that shows how much a cryptocurrency’s price changed over a period of time, showing percentage and margin
My test would summon the prices against the USD of several different major cryptocurrencies, including some that haven’t quite reached the mainstream status of Bitcoin and Ethereum using the “live” endpoint, then summoning the price of Bitcoin on a date far in the past using the “historical” endpoint.
This is what my implementation looked like. (The API key, naturally, is scrambled and invalidated for the screenshot.)
This rudimentary and somewhat quickly put-together code yields a page like this one:
It’s worth noting that Coinlayer calculates pricing using a weighted average of over 25 exchanges that are said to provide the most accurate pricing data available. I noticed no delay between the JSON request and the output of data. It took practically nothing. When you loaded my test page, you would get results instantly.
Given that most major problems on websites have to do with laggy responses from APIs, the fact that Coinlayer responds quickly actually gives it a lot of points in my book.
Add to this the fact that it took me literally fifteen minutes to integrate it into my test server (which includes the time it took for me to understand how Coinlayer works and learn to code with JSON, a framework I never used in my almost twenty years of coding), and you have an impressively easy platform to use.
Some More Notes
One of the things that Coinlayer touts a lot is its encryption, which is a 256-bit SSL/TLS setup. While it may be true that the platform encrypts data, it’s also true that you’re forced into HTTP using its free option. To enable HTTPS, you have to pay at least $9.99 per month. (After all, someone has to pay for SSL certificates!)
Also, cryptocurrency prices are updated hourly even for that basic plan. To get ten-minute updates, you have to pay for a “professional” plan at $39.99. “Professional Plus” offers sixty-second updates for sites and apps that really need it.
In addition to all of this, there’s a limit to the amount of requests that you may send to the JSON server. A free user can only expect 500 requests per month. You could technically limit the amount of requests you send by having a scheduler run only 500 times a month (about every hour and a half) and store the values in a database that your scripts could just pull from whenever they want. This adds another layer to your implementation and could challenge amateur programmers.
Paying up for the most basic plan gets you 5,000 requests a month, which is more than enough for hourly checkups and some testing in-between if you display values using the method I just described.
The free plan also restricts you to the US dollar and does not allow you to use the conversion API endpoint (which you can work around if you’re clever) or the time-frame endpoint.
Other JSON APIs like CryptoCompare and CoinMarketCap allow you to display cryptocurrency prices against several fiat currencies as many times as you’d like for free if you’re willing to give up some advantages, which we will talk about right now.
Pros And Cons
Now that we’ve had a look at how Coinlayer’s machinery works, I can now speak with confidence about its advantages and disadvantages compared to similar platforms.
- It’s insanely easy to use. I came in with zero experience programming with JSON and came out churning the numbers in no time.
- The documentation is easy to read and therefore extremely easy to get set up. It took me only fifteen minutes to both learn JSON and code the implementation.
- The responsiveness is stellar. It’s so fast that I’m flirting with several app and website ideas on the fly. The speed is good enough to get me moving and inspire me to do more with what I have.
- It’s a (mostly) paid service with the possibility of a free account that’s primarily for testing purposes. This may be a disadvantage, too, but it also gives Coinlayer the advantage of being able to pay staff enough to keep the service competitive.
- The historical data API endpoint opens up a world of new possibilities for big-picture apps. It’s also nice that it’s available on the free version of the service, albeit with a severe restriction on the amount of requests.
- The price for unlimited live price data is above $0. Alternative (free) platforms with JSON APIs can show listings with live cryptocurrency prices paired against several fiat currencies. For the sake of transparency, I must mention that offering unlimited “free” API calls could also congest a server with requests from legitimate sources and DDoS bots. I suspect that one of the reasons why Coinlayer is so fast is because it’s not getting requests all willy-nilly due to these restrictions.
- The lowest-priced tier, despite offering more data and more fiat currencies (and that tasty conversion endpoint), still provides hourly price updates. I’ve seen coins dip ten percent in a matter of four minutes.
Although you could use free services to list cryptocurrency prices in real time and work around some of the things you’d otherwise get from Coinlayer using extra layers of code magic, the alternatives are not for everyone.
If you’re an app or web developer who’s looking for an API that responds faster than you can blink while giving you a crisp dataset that’s easy to implement, Coinlayer is very much up your alley. Using free JSON APIs for these kinds of things could bite you in the end, as they don’t have as much of a support network or documentation and they’re (in theory) more susceptible to attacks and network congestion.
Using a reliable and highly-responsive API is ideal for corporate environments and startups that take themselves seriously.