LUCIT-Systems-and-Development / unicorn-binance-rest-api

A Python SDK by LUCIT to use the Binance REST API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, us, tr) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-rest-api.docs.lucit.tech
Other
61 stars 17 forks source link

"1000SHIB/USDT" and "BTCDOM/USDT" reported as "Invalid symbol" #12

Closed ThNhT21 closed 3 years ago

ThNhT21 commented 3 years ago

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])

Select one:

Environment

What kind of internet connection do you have?

high-speed Include here a description of your internet access like cable, lte and up and download rate. cable, 5GBites/sec

Average system load (CPU)

30% with 3GHz Include here the ammount of cpu cores and the average system load. 6 cores, 30% avg system load

Hardware specification

cloud Include here a description of the server hardware. don't know

Operating System? (include version)

Options

Which endpoint do you connect?


Include here the endpint you are connecting to, like binance.com, binance.com-isolated_margin or binance.org-testnet
binance.com-futures

#### Python Version Requirement
- [ x] I am using Python 3.7 or above

#### Exact Python Version?
Python 3.8.10

#### Pip Version?
pip 21.1.3 

#### Dependencies
Run `pip list > pip_list.txt` and upload the file.

#### UNICORN Binance WebSocket API Version?
Successfully installed unicorn-binance-websocket-api-1.34.1 websockets-10.0

#### Description of your issue
the crypto currencies "1000SHIB/USDT" and "BTCDOM/USDT" are not providing data when used in REST API requests, and reported as "Invalid symbol"

CODE:
------------------------------
from unicorn_binance_rest_api.unicorn_binance_rest_api_manager import BinanceRestApiManager
import logging
import os
import pandas as pd
import numpy as np
# https://docs.python.org/3/library/logging.html#logging-levels
logging.basicConfig(level=logging.DEBUG,
                    #filename=os.path.basename(__file__) + '.log',
                    filename=os.getcwd()  + '.log',
                    format="{asctime} [{levelname:8}] {process} {thread} {module}: {message}",
                    style="{")
api_key = thomas_api_key
api_secret = thomas_api_secret
ubra = BinanceRestApiManager(api_key, api_secret, exchange="binance.com-futures")
print(ubra.get_symbol_ticker(symbol="1000SHIBUSDT"))

ERROR MESSAGE:
------------------------------
---------------------------------------------------------------------------
BinanceAPIException                       Traceback (most recent call last)
<ipython-input-23-7971c70e1a05> in <module>
----> 1 print(ubra.get_symbol_ticker(symbol="1000SHIBUSDT"))

~\Anaconda3\lib\site-packages\unicorn_binance_rest_api\unicorn_binance_rest_api_manager.py in get_symbol_ticker(self, **params)
   1385 
   1386         """
-> 1387         return self._get('ticker/price', data=params, version=self.PRIVATE_API_VERSION)
   1388 
   1389     def get_orderbook_ticker(self, **params):

~\Anaconda3\lib\site-packages\unicorn_binance_rest_api\unicorn_binance_rest_api_manager.py in _get(self, path, signed, version, **kwargs)
    507 
    508     def _get(self, path, signed=False, version=PUBLIC_API_VERSION, **kwargs):
--> 509         return self._request_api('get', path, signed, version, **kwargs)
    510 
    511     def _post(self, path, signed=False, version=PUBLIC_API_VERSION, **kwargs):

~\Anaconda3\lib\site-packages\unicorn_binance_rest_api\unicorn_binance_rest_api_manager.py in _request_api(self, method, path, signed, version, **kwargs)
    460         uri = self._create_api_uri(path, signed, version)
    461 
--> 462         return self._request(method, uri, signed, **kwargs)
    463 
    464     def _request_margin_api(self, method, path, signed=False, version=MARGIN_API_VERSION, **kwargs):

~\Anaconda3\lib\site-packages\unicorn_binance_rest_api\unicorn_binance_rest_api_manager.py in _request(self, method, uri, signed, force_params, **kwargs)
    455 
    456         self.response = getattr(self.session, method)(uri, **kwargs)
--> 457         return self._handle_response()
    458 
    459     def _request_api(self, method, path, signed=False, version=PUBLIC_API_VERSION, **kwargs):

~\Anaconda3\lib\site-packages\unicorn_binance_rest_api\unicorn_binance_rest_api_manager.py in _handle_response(self)
    500         """
    501         if not (200 <= self.response.status_code < 300):
--> 502             raise BinanceAPIException(self.response)
    503         try:
    504             return self.response.json()

BinanceAPIException: APIError(code=-1121): Invalid symbol.
oliver-zehentleitner commented 3 years ago

Try futures_symbol_ticker() instead.

oliver-zehentleitner commented 3 years ago

Just reopen if needed!