According to coinmarketcap Binance is the world’s leading cryptocurrency exchange, with over 600 cryptocurrencies and virtual tokens, including Bitcoin (BTC), Ether (ETH), Litecoin (LTC), and others.
In this article, I will work you through how to connect both Microsoft Power BI and Excel to Binance and pull in real-time data for analysis and other future use cases.
Requirement
To follow along with this article, you should have a basic understanding of Power BI Desktop and Power Query for transformation purposes.
Connect to Binance API
Step 1: Get Binance API Documentation
First, open your browser and go to the Binance website, and press “Ctrl + F” to search for the word API. Click on the APIs menu, this will open another tab for you.
Step 2: Get Market Data
In the Market Data you are provided with different options, either to get real-time “Market Data” or “Historical Data”.
Note: For you to access the Historical Data, you will need to have a Binance Account.
Step 3: Get Base EndPoint
Select the General info and copy any of the 3 API endpoints in your notepad.
Note: The first base endpoint does not work so avoid using it.
Step 4: Get Symbol Price Ticker
Now search again for “symbol price ticker” and copy the link. Then go to your notepad where you pasted the base endpoint link and join it together.
You should get this as a full link when you join both the base endpoint and symbol price ticker.
https://api1.binance.com/api/v3/ticker/price |
Connect to Microsoft Excel
Open your Microsoft Excel and select the Data tab. In the Data tab click on Get data From Web, this will open a window for you where you can paste the URL link.
Power Query Editor
In your Power Query Editor, the data will appear in a list format, you will need to click on the “Transform” tab and convert it to a table.
A new icon will pop open, leave the delimiter as None and click on OK.
Click on the Expand icon, and select the two columns you want to see. Check both the Symbol and price columns.
Change Data Type and Column Name
First, rename the column name and property name. Change the Data type of symbol to text and price to decimal. You can also filter the symbol to USDT.
Close & Load
After you are done with the transformation process you can “Close & Load”, this will load the data back to the Excel sheet.
Connect to Microsoft Power BI
We are going to repeat the same process for Microsoft Power BI.
Get Data
In your Power BI report canvas, click on Get Dat and search for “from web”.
Filter, Close & Apply
Filter the symbol column to USDT, this will help us reduce the amount of data gotten from Binance. Close and apply this will take the data back to the Power BI desktop.
Conclusion
In this article, you learned how to connect Excel and Power BI to Binance API to get real-time price data. With this data, you can get create reports, make predictions, and analysis on this data.