Ethereum: Binance API P2P I can´t see the SELL information using Python


Ethereum: Binance API P2P Purchase Search

As a platform for cryptocurrency trading, Binance has made its application subscription publicly available as a platform. When it comes to retrieving purchasing information with Python, users often face problems. In this article, we will look at why you may not see sales information and provide steps to defect and solve the problem.


Why can't I get to the Binance API P2P information?

There are several restrictions on the Binance application subscription to retrieve certain types of information from the platform. Particularly:

  • The "Orders" terminal will return the list of all orders, including purchases, but does not explicitly sell information.

  • To apply for sales information, you need to use a different end point that provides a more detailed picture of events.


Search for P2P Purchase Information with Python



With Python, the P2P purchasing information in the Binance file is used by the requests' library. We first try to connect to the application interface and then pick up the desired information.

Python

Bring your requests

Bring JSON




Ethereum: Binance API P2P I can´t see the SELL information using Python

Set your Binance application subscription

API_KEY = 'Your_API_KEY'

Api_secret = 'Your_api_secret'


Set the P2P terminal URL

url = f'https: //api.binance.com/api/v3/websocket/getatorbook? Symbol = {binaryrycape} & limit = 10 & Timenorce = goods'


Set the ticket to indicate, we're connected to the P2P terminal

Connect_p2p = True

Def get_p2p_orders (symbol, border):


Try to connect to the P2P terminal

If not connect_p2p:

Print ('Connecting to P2P end point ...')

try:

Answer = Requests.Get (URL)


Member JSON response

Data = JSON.LOADS (Response.Text)


Delete selling information about orders

Sell_orders = []

The order of the data ['book'] ['Orders']:

If 'bond' == 'buy':

Sell_orders.Append ({

'Symbol': symbol,

'Quantity': floating (order ['quantity']),

'Time': int (order ['time']) // 1000

convert to seconds

})

Return the seller

Except for requests.exception.requestException under the name E:

Print (f'error connecting to P2P end point: {e} ')

Return []


Test the action with your binary symbol

Symbol = 'Your_Babarryscape_Symbol'

Sell_orders = get_p2p_orders (symbol, 10)


Print the results

For an order on Sell_orders:

Print (order)

`


Troubleshooting Tips


  • Check API documentation : Make sure you are using the right end point and parameters for your binary symbol.

2


  • Use the felling mechanism : Print error correction messages to identify problems with API or request.

4

By following these steps and failure tips, you should be able to search for P2P purchases successfully from Binance with Python. If you continue to face problems, please provide additional information on installation and your surroundings.

Leave a Reply

Your email address will not be published.