How to download cryptocurrency bar data from CryptoDatum.io
Using Postman or Curl to download Bitcoin, Ethereum and all the data from CryptoDatum.io in json or csv format
CryptoDatum.io was recently launched to provide cryptocurrency price bar data for a range of cryptoassets both in json or csv (classic excel table) format. CryptoDatum.io offers not only time candlestick data but also state-of-the-art alternative bars such as tick bars, volume bars, dollar bars or imbalance bars. In this post I want to show how to use a HTTP client such as Postman (standalone program) or curl (command-line program) to query the data from CryptoDatum.io.
1. Register to CryptoDatum and get your API key
Before you can start querying data from CryptoDatum.io you have to obtain your own API key. An API key is a string that identifies you as a user and grants you access to the database. In order to get it, you must register in CryptoDatum.io and retrieve your key from the “User tab” as shown below.
2. Download and install Postman
Follow the instructions at https://www.getpostman.com/downloads/ to download and install postman for your operative system. Finally, launch Postman. Beware that you don’t need to register if you don’t want ;)
3. Introduce the HTTP request
The first time you launch it, it will ask you what do you want to do. Select create new “request”. If a dialog pops up asking you to save the request, just cancel it as we don’t want to save it for now.
Then we can introduce our query in the grey box with the “Enter request URL” title. We can see how we can structure the queries and their parameters following the CryptoDatum.io API docs.
For instance, our query is going to be:
if you want the data in csv format, the query must be:
4. Add your API key as an Authorization header
Go to the headers tab and in the field Key write “Authorization”. Finally, in the field value copy-paste your API key.
5. Submit the query and download the results
Click the button “Send”. The query will be submitted and you’ll be able to visualize the results in the window below. If you decide to query the data in csv format, you can download a file with the data by clicking the download button. Beware that you can only retrieve up to 500 candles per query, so if you want to retrieve more candles you’ll probably want a way to automate the query and download using your favorite programming language like Python or using curl (see point 6).
6. Alternatively, download the data with one-liner using curl from command-line
Here’s an example of how would we submit a query with curl. Remember to replace API_KEY by your API key obtained in step 1.
Let me know in the comments is there’s anything that is not clear and I will answer you.
Thanks for reading! You will find this and more information about how to download Bitcoin, Ethereum, Ripple and more cryptocurrency pairs data in csv or json format at https://cryptodatum.io.