Skip to content

Conversation

@pcriadoperez
Copy link
Collaborator

@pcriadoperez pcriadoperez commented Dec 1, 2025

  • Add verbose option, can set both by passing verbose=True as by setting the logger log level:
  • client = Client(api_key, api_secret, verbose=True)
  • logging.getLogger('binance.ws').setLevel(logging.DEBUG)

Example output:

python examples/verbose_example.py

================================================================================
Python-Binance Verbose Mode Examples
================================================================================

These examples show how to enable verbose logging for debugging:
- REST API requests/responses (HTTP details)
- WebSocket messages (connection & data)

Watch the DEBUG logs above each example output.


================================================================================
Example 1: Synchronous Client (verbose=True)
================================================================================
2025-12-01 08:28:24,671 - asyncio - DEBUG - Using selector: KqueueSelector
2025-12-01 08:28:24,675 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.binance.com:443
2025-12-01 08:28:24,950 - urllib3.connectionpool - DEBUG - https://api.binance.com:443 "GET /api/v3/ping HTTP/11" 200 2
2025-12-01 08:28:24,950 - binance.base_client - DEBUG - 
Request: GET https://api.binance.com/api/v3/ping
RequestHeaders: {}
RequestBody: None
Response: 200
ResponseHeaders: {'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '2', 'Connection': 'keep-alive', 'Date': 'Mon, 01 Dec 2025 07:28:24 GMT', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', 'Server': 'nginx', 'x-mbx-uuid': 'ec3726d0-0a87-46b5-8c3a-2ad1e819ccff', 'x-mbx-used-weight': '1', 'x-mbx-used-weight-1m': '1', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-Xss-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "default-src 'self'", 'X-Content-Security-Policy': "default-src 'self'", 'X-WebKit-CSP': "default-src 'self'", 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Access-Control-Allow-Origin': '*', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 b5e354980da78aef02917b4456c540c0.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'MAD56-P2', 'X-Amz-Cf-Id': 'UTbwMmhu6_Bmu8mzfTVHRNGzskKvkEMf4IY4Ta9RkGUqYlZNDkHKiQ=='}
ResponseBody: {}
2025-12-01 08:28:25,190 - urllib3.connectionpool - DEBUG - https://api.binance.com:443 "GET /api/v3/time HTTP/11" 200 28
2025-12-01 08:28:25,190 - binance.base_client - DEBUG - 
Request: GET https://api.binance.com/api/v3/time
RequestHeaders: {}
RequestBody: None
Response: 200
ResponseHeaders: {'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '28', 'Connection': 'keep-alive', 'Date': 'Mon, 01 Dec 2025 07:28:25 GMT', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', 'Server': 'nginx', 'x-mbx-uuid': 'ef61e2d8-9be3-46c9-86db-0b462ed4ca9d', 'x-mbx-used-weight': '2', 'x-mbx-used-weight-1m': '2', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-Xss-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "default-src 'self'", 'X-Content-Security-Policy': "default-src 'self'", 'X-WebKit-CSP': "default-src 'self'", 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Access-Control-Allow-Origin': '*', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 b5e354980da78aef02917b4456c540c0.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'MAD56-P2', 'X-Amz-Cf-Id': 'PoaYqGRFF2Ag4tpb27cmY2DoV7-v0EfAlXKriv86HjLWAxXsWCSmvA=='}
ResponseBody: {"serverTime":1764574105134}
Server time: 1764574105134

2025-12-01 08:28:25,190 - asyncio - DEBUG - Using selector: KqueueSelector

================================================================================
Example 2: Async Client (verbose=True)
================================================================================
2025-12-01 08:28:25,456 - binance.base_client - DEBUG - 
Request: GET https://api.binance.com/api/v3/ping
RequestHeaders: {}
RequestBody: None
Response: 200
ResponseHeaders: {'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '2', 'Connection': 'keep-alive', 'Date': 'Mon, 01 Dec 2025 07:28:25 GMT', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', 'Server': 'nginx', 'x-mbx-uuid': '82fcadac-12e1-4af3-8010-3a2b08a74c1c', 'x-mbx-used-weight': '3', 'x-mbx-used-weight-1m': '3', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-Xss-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "default-src 'self'", 'X-Content-Security-Policy': "default-src 'self'", 'X-WebKit-CSP': "default-src 'self'", 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Access-Control-Allow-Origin': '*', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 ad26f79fc6e5f2848298844b039dde3e.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'MAD56-P2', 'X-Amz-Cf-Id': 'VkyI3wkWvovxXt2DuY8In04T_VWKQJEqREPKQlVbY3QT24uzI2-gvw=='}
ResponseBody: {}
2025-12-01 08:28:25,687 - binance.base_client - DEBUG - 
Request: GET https://api.binance.com/api/v3/time
RequestHeaders: {}
RequestBody: None
Response: 200
ResponseHeaders: {'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '28', 'Connection': 'keep-alive', 'Date': 'Mon, 01 Dec 2025 07:28:25 GMT', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', 'Server': 'nginx', 'x-mbx-uuid': '72c816d2-84bb-45f6-9afa-07a441b3bef9', 'x-mbx-used-weight': '4', 'x-mbx-used-weight-1m': '4', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-Xss-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "default-src 'self'", 'X-Content-Security-Policy': "default-src 'self'", 'X-WebKit-CSP': "default-src 'self'", 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Access-Control-Allow-Origin': '*', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 ad26f79fc6e5f2848298844b039dde3e.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'MAD56-P2', 'X-Amz-Cf-Id': 'bKUtbAsIcBdacqfSXirg4-EBOPZOceGRlwlfp-DLWlLIMuqVdjwgrA=='}
ResponseBody: {"serverTime":1764574105631}
2025-12-01 08:28:25,917 - binance.base_client - DEBUG - 
Request: GET https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT
RequestHeaders: {}
RequestBody: None
Response: 200
ResponseHeaders: {'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '45', 'Connection': 'keep-alive', 'Date': 'Mon, 01 Dec 2025 07:28:25 GMT', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', 'Server': 'nginx', 'x-mbx-uuid': 'af9c7791-8c48-4fc6-a53e-d8984ee7ccae', 'x-mbx-used-weight': '6', 'x-mbx-used-weight-1m': '6', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-Xss-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "default-src 'self'", 'X-Content-Security-Policy': "default-src 'self'", 'X-WebKit-CSP': "default-src 'self'", 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Access-Control-Allow-Origin': '*', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 ad26f79fc6e5f2848298844b039dde3e.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'MAD56-P2', 'X-Amz-Cf-Id': '_LCRbIQMdvgGBhjBn7K5bD3sK956l04-FN99I9gL6FJrGYl8UcqLZA=='}
ResponseBody: {"symbol":"BTCUSDT","price":"86265.66000000"}
BTC/USDT price: 86265.66000000

2025-12-01 08:28:25,918 - binance.ws.reconnecting_websocket - DEBUG - Closing Websocket wss://ws-api.binance.com/ws-api/v3
2025-12-01 08:28:25,918 - asyncio - DEBUG - Using selector: KqueueSelector

================================================================================
Example 3: WebSocket Streams (verbose=True)
================================================================================
Receiving 3 trade messages...

2025-12-01 08:28:26,446 - binance.ws.reconnecting_websocket - DEBUG - Establishing new WebSocket connection
2025-12-01 08:28:26,808 - websockets.client - DEBUG - = connection is CONNECTING
2025-12-01 08:28:27,449 - websockets.client - DEBUG - > GET /ws/ethusdt@trade HTTP/1.1
2025-12-01 08:28:27,450 - websockets.client - DEBUG - > Host: stream.binance.com:9443
2025-12-01 08:28:27,450 - websockets.client - DEBUG - > Upgrade: websocket
2025-12-01 08:28:27,450 - websockets.client - DEBUG - > Connection: Upgrade
2025-12-01 08:28:27,450 - websockets.client - DEBUG - > Sec-WebSocket-Key: FH61IuS8dfPofPjL4VH8Bw==
2025-12-01 08:28:27,450 - websockets.client - DEBUG - > Sec-WebSocket-Version: 13
2025-12-01 08:28:27,450 - websockets.client - DEBUG - > Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
2025-12-01 08:28:27,450 - websockets.client - DEBUG - > User-Agent: Python/3.12 websockets/14.1
2025-12-01 08:28:27,850 - websockets.client - DEBUG - < HTTP/1.1 101 Switching Protocols
2025-12-01 08:28:27,850 - websockets.client - DEBUG - < Date: Mon, 01 Dec 2025 07:28:27 GMT
2025-12-01 08:28:27,850 - websockets.client - DEBUG - < Connection: upgrade
2025-12-01 08:28:27,850 - websockets.client - DEBUG - < Upgrade: websocket
2025-12-01 08:28:27,850 - websockets.client - DEBUG - < Sec-WebSocket-Accept: 3VR6FJXnNoY9bDxWq94+ERvy0jk=
2025-12-01 08:28:27,850 - websockets.client - DEBUG - < Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; client_max_window_bits=15
2025-12-01 08:28:27,850 - websockets.client - DEBUG - = connection is OPEN
2025-12-01 08:28:28,109 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574108035,"s":"ETHUSDT","t...8034,"m":true,"M":true}' [133 bytes]
2025-12-01 08:28:28,110 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574108035, 's': 'ETHUSDT', 't': 3254109916, 'p': '2831.74000000', 'q': '0.23650000', 'T': 1764574108034, 'm': True, 'M': True}
Trade 1: Price=2831.74000000, Qty=0.23650000
2025-12-01 08:28:28,394 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574108324,"s":"ETHUSDT","t...323,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:28,395 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574108324, 's': 'ETHUSDT', 't': 3254109917, 'p': '2831.75000000', 'q': '0.00710000', 'T': 1764574108323, 'm': False, 'M': True}
Trade 2: Price=2831.75000000, Qty=0.00710000
2025-12-01 08:28:31,222 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111148,"s":"ETHUSDT","t...148,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,223 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109918, 'p': '2831.75000000', 'q': '0.99140000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,223 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109919, 'p': '2831.75000000', 'q': '0.04030000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,223 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109920, 'p': '2831.75000000', 'q': '0.00340000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,223 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109921, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,223 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109922, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,223 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109923, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109924, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109925, 'p': '2831.75000000', 'q': '0.12300000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109926, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109927, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109928, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109929, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109930, 'p': '2831.75000000', 'q': '0.00190000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109931, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109932, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109933, 'p': '2831.75000000', 'q': '0.00220000', 'T': 1764574111148, 'm': False, 'M': True}
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111148, 's': 'ETHUSDT', 't': 3254109934, 'p': '2831.75000000', 'q': '1.81580000', 'T': 1764574111148, 'm': False, 'M': True}
Trade 3: Price=2831.75000000, Qty=0.99140000
2025-12-01 08:28:31,224 - binance.ws.reconnecting_websocket - DEBUG - Closing Websocket wss://stream.binance.com:9443/ws/ethusdt@trade
2025-12-01 08:28:31,710 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111586,"s":"ETHUSDT","t...586,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,711 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574111587,"s":"ETHUSDT","t...587,"m":false,"M":true}' [134 bytes]
2025-12-01 08:28:31,711 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574111586, 's': 'ETHUSDT', 't': 3254109935, 'p': '2831.75000000', 'q': '0.00350000', 'T': 1764574111586, 'm': False, 'M': True}
2025-12-01 08:28:31,711 - binance.ws.reconnecting_websocket - DEBUG - _read_loop ethusdt@trade break for WSListenerState.EXITING
2025-12-01 08:28:31,729 - binance.ws.reconnecting_websocket - DEBUG - Finished killing read_loop
2025-12-01 08:28:31,729 - websockets.client - DEBUG - > CLOSE 1000 (OK) [2 bytes]
2025-12-01 08:28:31,729 - websockets.client - DEBUG - = connection is CLOSING
2025-12-01 08:28:31,973 - websockets.client - DEBUG - < EOF
2025-12-01 08:28:31,973 - websockets.client - DEBUG - < EOF
2025-12-01 08:28:31,973 - websockets.client - DEBUG - > EOF
2025-12-01 08:28:31,973 - websockets.client - DEBUG - = connection is CLOSED
2025-12-01 08:28:31,973 - binance.ws.reconnecting_websocket - DEBUG - Closing Websocket wss://ws-api.binance.com/ws-api/v3
2025-12-01 08:28:31,974 - asyncio - DEBUG - Using selector: KqueueSelector

================================================================================
Example 4: Combined REST + WebSocket (both verbose=True)
================================================================================
2025-12-01 08:28:32,237 - binance.base_client - DEBUG - 
Request: GET https://api.binance.com/api/v3/ping
RequestHeaders: {}
RequestBody: None
Response: 200
ResponseHeaders: {'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '2', 'Connection': 'keep-alive', 'Date': 'Mon, 01 Dec 2025 07:28:32 GMT', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', 'Server': 'nginx', 'x-mbx-uuid': '72c816d2-84bb-45f6-9afa-07a441b3bef9', 'x-mbx-used-weight': '9', 'x-mbx-used-weight-1m': '9', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-Xss-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "default-src 'self'", 'X-Content-Security-Policy': "default-src 'self'", 'X-WebKit-CSP': "default-src 'self'", 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Access-Control-Allow-Origin': '*', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 1cbf6d6ef405e8e3fa256f628b03d41a.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'MAD56-P2', 'X-Amz-Cf-Id': 'E0U556k8i5W9yiTiP0ITK9_g1VjANhqf075CNAqmnDnDvmVCVmKWjw=='}
ResponseBody: {}
2025-12-01 08:28:32,470 - binance.base_client - DEBUG - 
Request: GET https://api.binance.com/api/v3/time
RequestHeaders: {}
RequestBody: None
Response: 200
ResponseHeaders: {'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '28', 'Connection': 'keep-alive', 'Date': 'Mon, 01 Dec 2025 07:28:32 GMT', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', 'Server': 'nginx', 'x-mbx-uuid': 'fc8983f8-a1dd-48c5-902a-394d68a7a5c8', 'x-mbx-used-weight': '10', 'x-mbx-used-weight-1m': '10', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-Xss-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "default-src 'self'", 'X-Content-Security-Policy': "default-src 'self'", 'X-WebKit-CSP': "default-src 'self'", 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Access-Control-Allow-Origin': '*', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 1cbf6d6ef405e8e3fa256f628b03d41a.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'MAD56-P2', 'X-Amz-Cf-Id': 'fLtiYJuzK8aQvVq6TKza5WWUCqyJI4tB2tMRB8dY3pUR8JqRFopZ-A=='}
ResponseBody: {"serverTime":1764574112414}
2025-12-01 08:28:32,867 - binance.base_client - DEBUG - 
Request: GET https://api.binance.com/api/v3/time
RequestHeaders: {}
RequestBody: None
Response: 200
ResponseHeaders: {'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '28', 'Connection': 'keep-alive', 'Date': 'Mon, 01 Dec 2025 07:28:32 GMT', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', 'Server': 'nginx', 'x-mbx-uuid': 'cd794c80-7921-4585-b68c-337e2845014e', 'x-mbx-used-weight': '11', 'x-mbx-used-weight-1m': '11', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-Xss-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Content-Security-Policy': "default-src 'self'", 'X-Content-Security-Policy': "default-src 'self'", 'X-WebKit-CSP': "default-src 'self'", 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Access-Control-Allow-Origin': '*', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 1cbf6d6ef405e8e3fa256f628b03d41a.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'MAD56-P2', 'X-Amz-Cf-Id': 'MkAVz3COQkRicMtjQX9fazGX6PyVBLX1mSXYq_2omAa_Ci5piSwscA=='}
ResponseBody: {"serverTime":1764574112644}
2025-12-01 08:28:32,867 - binance.ws.reconnecting_websocket - DEBUG - Establishing new WebSocket connection
2025-12-01 08:28:33,276 - websockets.client - DEBUG - = connection is CONNECTING
2025-12-01 08:28:33,940 - websockets.client - DEBUG - > GET /ws/bnbusdt@trade HTTP/1.1
2025-12-01 08:28:33,940 - websockets.client - DEBUG - > Host: stream.binance.com:9443
2025-12-01 08:28:33,940 - websockets.client - DEBUG - > Upgrade: websocket
2025-12-01 08:28:33,940 - websockets.client - DEBUG - > Connection: Upgrade
2025-12-01 08:28:33,940 - websockets.client - DEBUG - > Sec-WebSocket-Key: isvPV9RD/drg+01RvgDJ3Q==
2025-12-01 08:28:33,940 - websockets.client - DEBUG - > Sec-WebSocket-Version: 13
2025-12-01 08:28:33,940 - websockets.client - DEBUG - > Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
2025-12-01 08:28:33,940 - websockets.client - DEBUG - > User-Agent: Python/3.12 websockets/14.1
2025-12-01 08:28:34,295 - websockets.client - DEBUG - < HTTP/1.1 101 Switching Protocols
2025-12-01 08:28:34,295 - websockets.client - DEBUG - < Date: Mon, 01 Dec 2025 07:28:34 GMT
2025-12-01 08:28:34,295 - websockets.client - DEBUG - < Connection: upgrade
2025-12-01 08:28:34,295 - websockets.client - DEBUG - < Upgrade: websocket
2025-12-01 08:28:34,295 - websockets.client - DEBUG - < Sec-WebSocket-Accept: Uxl20nGL0bBrsr2YUqIn7FM5ryA=
2025-12-01 08:28:34,295 - websockets.client - DEBUG - < Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; client_max_window_bits=15
2025-12-01 08:28:34,295 - websockets.client - DEBUG - = connection is OPEN
2025-12-01 08:28:34,378 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574114306,"s":"BNBUSDT","t...4306,"m":true,"M":true}' [132 bytes]
2025-12-01 08:28:34,378 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574114306, 's': 'BNBUSDT', 't': 1334741871, 'p': '829.77000000', 'q': '0.05800000', 'T': 1764574114306, 'm': True, 'M': True}
BNB/USDT trade: 829.77000000

2025-12-01 08:28:34,378 - binance.ws.reconnecting_websocket - DEBUG - Closing Websocket wss://stream.binance.com:9443/ws/bnbusdt@trade
2025-12-01 08:28:35,480 - websockets.client - DEBUG - < TEXT '{"e":"trade","E":1764574115409,"s":"BNBUSDT","t...408,"m":false,"M":true}' [133 bytes]
2025-12-01 08:28:35,480 - binance.ws.reconnecting_websocket - DEBUG - Received message: {'e': 'trade', 'E': 1764574115409, 's': 'BNBUSDT', 't': 1334741872, 'p': '829.78000000', 'q': '0.17600000', 'T': 1764574115408, 'm': False, 'M': True}
2025-12-01 08:28:35,481 - binance.ws.reconnecting_websocket - DEBUG - _read_loop bnbusdt@trade break for WSListenerState.EXITING
2025-12-01 08:28:35,490 - binance.ws.reconnecting_websocket - DEBUG - Finished killing read_loop
2025-12-01 08:28:35,491 - websockets.client - DEBUG - > CLOSE 1000 (OK) [2 bytes]
2025-12-01 08:28:35,491 - websockets.client - DEBUG - = connection is CLOSING
2025-12-01 08:28:35,923 - websockets.client - DEBUG - < EOF
2025-12-01 08:28:35,923 - websockets.client - DEBUG - < EOF
2025-12-01 08:28:35,923 - websockets.client - DEBUG - > EOF
2025-12-01 08:28:35,923 - websockets.client - DEBUG - = connection is CLOSED
2025-12-01 08:28:35,923 - binance.ws.reconnecting_websocket - DEBUG - Closing Websocket wss://ws-api.binance.com/ws-api/v3

@pcriadoperez pcriadoperez self-assigned this Dec 1, 2025
@carlosmiei
Copy link
Collaborator

@carlosmiei carlosmiei merged commit 18d88b8 into sammchardy:master Dec 15, 2025
2 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants