Giter Site home page Giter Site logo

binance-api-postman's People

Contributors

2pd avatar adderall-prozac avatar aisling11 avatar alplabin avatar ammarbrohi avatar arturogamrod avatar chairz avatar chairz-2 avatar ishuen avatar jonte-z avatar maks1m avatar maxwelljoslyn avatar qiyu1030 avatar tantialex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

binance-api-postman's Issues

Signature error in Futures

Hi!

I'm trying to test the binance Futures API but I always get:

{
"code": -1022,
"msg": "Signature for this request is not valid."
}

I have this restrictions for the API

Captura de pantalla 2021-07-29 a las 6 13 40

I have the correct API key and Secret key on my postman environment, but I'm getting the error with all requests which the signature is required.

Captura de pantalla 2021-07-29 a las 6 15 15

What I'm doing wrong?

Thanks in advance.

Sockets answers empty even when ACCOUNT_UPDATE action is occured

Hello, I'm using non-standart language and communicate with HTTP by plain headers. I'm wanted to get some futures methods info (for example positionRisk) via sockets, but gets an empty answer even my balance is changing (I have some futures open orders). I'm sending the following headers to the server:

GET /ws/L7Awe0UboTNATaoiutuz9lSZg6wRYO1A1PquzoS4SjIg8Cq2lRsabadIQcYlFWI9 HTTP/1.1\r\n
Host: stream.binance.com\r\n
Accept: */*\r\n
Connection: Upgrade\r\n
Upgrade: WebSocket\r\n
Pragma: no-cache\r\n
Sec-WebSocket-Version: 13\r\n
Sec-WebSocket-Key: 6DLUcxfnOxFAet7PJDrXYg==\r\n
\r\n
\r\n

And getting the correct answer headers, but answer body is empty.

HTTP/1.1 101 Switching Protocols
Date: Fri, 28 May 2021 14:26:44 GMT
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Accept: KFe2yYd1Hu9qNmIaaZR56apFrCQ=

I'm tried both of the endpoints to generate listen key (fapi/v1/listenKey and api/v3/userDataStream) and with testnet too with no luck.

What it can be, because, for example, pairs trade info (/stream?streams=btcusdt@kline_1m) working good?

Thanks.

"Signature for this request is not valid."

Hello, I'm developing an application for my own use. I'm new to using API's, I'm using Postman to check outputs/responses without adding them to my application yet.

When I query for Deposit and Withdrawal history I'm getting this as response.

{
    "code": -1022,
    "msg": "Signature for this request is not valid."
}

Other queries work using my API and Secret keys.

Things I've tried:
Restricted my API to work only on my IP address
Enabled all possible API restrictions
Cleared the signature on my Postman environment

Please HALP. Thanks in advance

Signature for this request is not valid

{ "code": -1022, "msg": "Signature for this request is not valid." }

i set everything as well like binance api key and secret.
i check all of it.
X-MBX-APIKEY is true.

i can get every result as well at market and accout tabs like Account Trade List but when i try under of Order tab like All Orders i got an signature error.

Error: You are not authorized to execute this request

I'm executing the following endpoint: /sapi/v1/capital/deposit/hisrec?coin=BTC&status&startTime&endTime&addressTag=&timestamp={{timestamp}}

in Postman and i get "401 Unauthorized" with the message "You are not authorized to execute this request".
I can make others queries so the parameters seems to be right.

Any help?

getting 404 error

Hello I have set all required API key and secrete in postman but still, APIs are giving 404 error
Screenshot 2020-08-12 at 4 59 51 PM
Screenshot 2020-08-12 at 5 00 22 PM

"-1022 Signature for this request is not valid." error on creation of new order

Hi,

When I try to create new order from Postman I got "-1022 Signature for this request is not valid." error. I checked the address for the error but it seems there is no problem about my post. My raw URL is below, changed my secret with XXXX

https://api.binance.com/api/v3/order?side=SELL&type=LIMIT&timeInForce=GTC&quantity=0.01&price=9000&newClientOrderId=my_order_id_1&timestamp=1613681901685&signature=XXXX&symbol=FRONTBUSD

help please.

batchOrders, Signature

I'm getting issue when trying to do "Place Multiple Orders (TRADE)", When I'm request with "batchOrders" parameter. I get the response "Signature for this request is not valid."
image

Binance API series part II

Hey,

I wanted to ask if there will be an API series part II since at the end of part one it says the next part will covering simple coding.

-2015 when use Account information in Binance perpetual future API

I get error as

{
    "code": -2015,
    "msg": "Invalid API-key, IP, or permissions for action, request ip: 101.80.21.205"
}

in collections Binance perpetual future API -> Account -> Account information
which send request as

curl --location --request GET 'https://testnet.binancefuture.com/fapi/v1/account?timestamp=1613652317700&signature=13d5684fbf8a50f52f87c72426a2e7925841912688456ce48b0d71f809cdfa6c' \
--header 'Content-Type: application/json' \
--header 'X-MBX-APIKEY: a2NQttwdUgdgfqzgXobwE4JUR9onDWK4basorZERDeZiDF2FZErlmJ3N3m7vM5q5'

but all the requests in the future API -> Market send success.
because I use the same binance-api-key and binance-api-secret for spot which I get from https://testnet.binance.vision/
so I wonder the future api have different secret key? or are there any other problems?

Use Postman Public Workspace for API docs and collections

Postman recently launced Public Workspaces, with loads of features. Binance can leverage it to keep track of the APIs and the docs, meanwhile general public can test out those collections by forking it in their personal workspace. Do take a look at it. Felt it will be useful for you guys.

Blog Post: https://blog.postman.com/introducing-postman-public-workspaces/
Sample Workspace:https://www.postman.com/postman/workspace/postman-public-workspace/overview

Signature for this request is not valid.

Hi,
I only suffer from this error when the price field is set to variable. If I enter the price manually, the buy order is placed without any problem. What may be the problem?

EDIT:
I can see the problem is in the signature when any field is set as a variable. So how to automate the processes if I have to enter all the fields manually?

New endpoint for Pay: GET /sapi/v1/pay/transactions to support user query Pay trade history

Change Log 2021-11-19
GET {{url}}/sapi/v1/pay/transactions?timestamp={{timestamp}}&signature={{signature}}

Not Found Fields: [
Pay ID ?
recipient ?
sender ?
orderId ?
note ?
]

Example Response:

{
"code": "000000",
"message": "success",
"data": [
{
"orderType": "C2C",
"transactionId": "C_P_XXXXX",
"transactionTime": 1633941540055,
"amount": "236.6",
"currency": "USDT",
"fundsDetail": [
{
"currency": "USDT",
"amount": "236.6"
}
]
}
],
"success": true
}

Open futures position with percentage ofrom avaliable ballance

Hello, sorry for opening this issue, but i'm really confused, is there any option to do this through "New Order" (Trade)
Because if you opening position by MARKET , you need to enter price or qtty of coin, but i need to enter the qtty of my USDT balance =(

Signature

What should we use as signature? The Secret Key?

I always get this error

"code": -1022,
    "msg": "Signature for this request is not valid."

Long/Short Ratio data is not complete

Seems that Long/Short Ratio API methods don't return all data what it needed, now it's returns only data from Long/Short columns, but it makes no sense, because it's always almost the same:

One

So only one accurate way is to get exactly ratio graph, which shows the correct data, so if we gets its longShortRatio from API and can simply compare it with ratio overage value which is, as for 15m timeframe for example, is (1.08 + 1.20) / 2 = 1.14

One

One

But the problem is that API methods for this don't returns min and max ratio values for get its overage, I can get it from Futures Trade Data page and hardcode it in my code, but it's depends on timeframe and columns number, so unfortunately it's impossible. It will be great to add the ratio min and max value to the api methods like topLongShortPositionRatio results to get its overage value to compare it with ratio value getting from API. Thanks in advance.

{"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."}

Noob here. Getting the error {"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."}

Running code from India:
#Importing the 2 libraries required
import time
import requests

#getting the timestamp
ts = time.time()

#remaining code generated from Postman using instructions on Binance academy post.
#The timestamp is adding dynamically ("+str(int(ts))+")
#replacing signature with somesignature in this issue only. My original code has the correct signature
url = "https://api.binance.com/api/v3/account?timestamp="+str(int(ts))+"&signature=somesignature"

payload={}

#replacing api key with somekey in this issue only. My original code has the correct api key. Same for session id.
headers = {
'Content-Type': 'application/json',
'X-MBX-APIKEY': 'somekey',
'Cookie': 'JSESSIONID=somesessionid'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Historical User Data

Hello,

I'm new to this API and I would like to know if someone knows how to get Historical User Data. I can't figure out how to get my Balance from a Week ago or a Month or a Year, because If I know the amount of BTC I had I can calculate my profit at a given time.

Thanks in advance
Harry

/sapi/v1/bnbBurn?spotBNBBurn=

This request POST /sapi/v1/bnbBurn?spotBNBBurn=.... not work

The answer comes about an invalid parameter.

I am using the following code to request a given method:

`
class BH():

methods = {'bnbBurn': {'url': 'sapi/v1/bnbBurn', 'method': 'POST', 'private': True}}

def __init__(self, API_KEY, API_SECRET):
    self.API_KEY = API_KEY
    self.API_SECRET = bytearray(API_SECRET, encoding='utf-8')
    self.shift_seconds = 0

def __getattr__(self, name):
    def wrapper(*args, **kwargs):
        kwargs.update(command=name)
        return self.call_api(**kwargs)
    return wrapper

def set_shift_seconds(self, seconds):
    self.shift_seconds = seconds
    
def call_api(self, **kwargs):

    command = kwargs.pop('command')

    base_url ='https://api1.binance.com/' 
    if self.methods[command].get('futures'):
        base_url = 'https://fapi.binance.com/' 
    api_url = base_url  + self.methods[command]['url']

    payload = kwargs
    headers = {}
    
    payload_str = urllib.parse.urlencode(payload)
    if self.methods[command]['private']:
        payload.update({'timestamp': int(time.time() + self.shift_seconds - 1) * 1000})
        payload_str = urllib.parse.urlencode(payload).encode('utf-8')
        sign = hmac.new(
            key=self.API_SECRET,
            msg=payload_str,
            digestmod=hashlib.sha256
        ).hexdigest()

        payload_str = payload_str.decode("utf-8") + "&signature="+str(sign) 
        headers = {"X-MBX-APIKEY": self.API_KEY, "Content-Type":"application/x-www-form-urlencoded"}

    if self.methods[command]['method'] == 'GET' or self.methods[command]['url'].startswith('sapi'):
        api_url += '?' + payload_str

    response = requests.request(method=self.methods[command]['method'], url=api_url, data="" if self.methods[command]['method'] == 'GET' else payload_str, headers=headers)
        
    if 'code' in response.text:
        raise Exception(response.text)

    return response.json()

bh = BH(c_api, c_secret)
result = bh.bnbBurn(spotBNBBurn = False, interestBNBBurn = False)
`

401 Unauthorized on some (but not all) test-services?!

I'm tyring to follow the (very excellent) 'Binance API Series Pt. I – Spot Trading with Postman'.

Of course I did the steps for creating a test user (1610642226219045601), but still I get a '401 Unauthorized' error with the JSON-response below for several of the services that are described in the tutorial. Among the failing services are very relevant ones like /account and /order.

{
    "code": -2015,
    "msg": "Invalid API-key, IP, or permissions for action."
}

I'm guessing it has something to do with the signature that has to be filled in for these services? Postman is so kind as to generate these, but I can imagine this should be some fixed value, since it is supposed to "prove that we’re the account holder."?!

Strategy orders

Hey, I am looking for an API scheme for strategy orders in Binance (OCO, OTOCO). Unfortunately nor API docs nor this repo does not contain such information. Is it possible to add it?

Cant access LongShort Ratio data

When sending request {{url}}/futures/data/topLongShortPositionRatio?symbol=BTCUSDT

I am getting the following error

"error": "Not Found",
"message": "No message available",
"path": "/futures/data/topLongShortPositionRatio"

Any endpoint for creating new sell/buy market order?

I couldn't find any market based orders endpoints... closest i could think is below

{{url}}/api/v3/order?symbol=BTCBUSD&side=BUY&type=MARKET&timeInForce=GTC&quantity=0.00020&price=1&timestamp={{timestamp}}&signature={{signature}}

but when i run it i get below

{
"code": -1022,
"msg": "Signature for this request is not valid."
}

so what am i missing ???

url issues

Hi I'm not sure if this is intended and I'm in the wrong here but it looks like the request urls seem to be outdated using /v1/ rather than /v3/ and I assume v1 is depreciated because I was never able to get it to work.
Also different collections of requests seem to have a d, s or f in front of api leading to things like /dapi/, /sapi/, /fapi/ none of which work, at least for me.
If this is intended for some reason then please ignore but I figured I would bring it to your attention,

Problem to import files

I'm getting Error while importing: format not recognized

Postman version: v7.23.0

Any idea?

401 for some (but not all) services

I'm tyring to follow the (very excellent) 'Binance API Series Pt. I – Spot Trading with Postman'.

Of course I did the steps for creating a test user (1610642226219045601), but still I get a '401 Unauthorized' error with the JSON-response below for several of the services that are described in the tutorial. Among the failing services are very relevant ones like /account and /order.

{
    "code": -2015,
    "msg": "Invalid API-key, IP, or permissions for action."
}

I'm guessing it has something to do with the signature that has to be filled in for these services? Postman is so kind as to generate these, but I can imagine this should be some fixed value, since it is supposed to "prove that we’re the account holder."?!

/api/v3/openOrders returning wrong data

As you can see from the attached videos the /api/v3/openOrders returns wrong data during tests with postman.

As you can see in the video I have 3 open orders (both CHZEUR) and the api returns from 0 to 3 results each time I run it.
In the second video I have 1 CHZEUR order and 1 MATICEUR order, also in this case the api returns wrong values.

CHZEUR.mp4
MATICEUR.mp4

RTO

image
Hello, i got this error when executing using postman

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.