-1

I am trying curl to binance api.

I am basing on:

I have already created bunch of successful curls for example for placing limit-order in isolated futures.

Now I am just trying to change parameters/url to create new query.

Let's for example get my assets (https://binance-docs.github.io/apidocs/spot/en/#query-margin-asset-market_data).

Since it is 'MARKET_DATA' I need only API-key, no signature:

curl -X GET -H "X-MBX-APIKEY: MyLongPrivateKey" https://sapi.binance.com/sapi/v2/margin/allAssets

and I get:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr/>Powered by Tengine<hr><center>tengine</center>
</body>
</html>

When I do same curl with -L it redirect me to homepage...

Can any1 explain me how do I translate that #!$&*!&$%@ docs into real curl?

Tried various combinations, all failed..

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

-1

The correct endpoint from the document is: GET /sapi/v1/margin/allAssets, and all /sapi/* endpoints are available under base URL https://api.binance.com.

So this should work:

curl -X GET -H "X-MBX-APIKEY: MyLongPrivateKey" https://api.binance.com/sapi/v1/margin/allAssets

Binance
  • 69
  • 6