I would like to import Binance.com account data via API. This is the API URL, which asks for API-key, when opened in browser: https://fapi.binance.com/fapi/v2/balance
This is the code that I try using in Excel's Power Query:
let
apiUrl = "https://fapi.binance.com/fapi/v2/balance",
options = [Headers =[#"X-MBX-APIKEY"="MpfS23B8GjxXq9MEvKUR819QsMsYB3xuhByglOGaV7WUgldD7wVFQOYAhmQYbXDD"]],
result = Web.Contents(apiUrl , options),
#"Expanded Column1" = Web.Page(result)
in
#"Expanded Column1"
APIKEY is bogus in this example.
I am getting the following error when using this code:
DataSource.Error: The remote server return an HTTP status code '400' when trying to access 'https://fapi.binance.com/fapi/v2/balance'.
Details:
DataSourceKind=Web
DataSourcePath=https://fapi.binance.com/fapi/v2/balance
Url=https://fapi.binance.com/fapi/v2/balance
Binance provides both API-Key and secret. I have them, but I don't seem to find how to use them. Maybe API-key should be some sort of encrypted with secret key for it to work? I don't know how to do that either :(
I have tried this with the following API URLs, it doesn't work, the error is the same:
Binance docs seem to be too complicated for this Power Query task.
Any idea what needs to be done to get that working so I could finally get my Binance account data imported into Excel?