bithumb-pro / bithumb.pro-official-api-docs

rest and websocket api doc
22 stars 26 forks source link

funding rate clarification #109

Open felixlam0629 opened 2 years ago

felixlam0629 commented 2 years ago

i am looking for funding rate from Rest API documentation by Bithmub (Reference: https://bithumbfutures.github.io/bithumb-futures-api-doc/#demo-code)

My python script: url = 'https://bithumbfutures.com/api/pro/v1/futures/funding-rates' headers = {'Accept': 'application/json'} response = requests.get(url, headers = headers) response = response.json() pprint.pprint(response)

and the error comes out: Traceback (most recent call last): File "C:\Users\USER\Desktop\program_trading\Algorithmic_Trading_data\cryptocurrency\bithumb\Funding_rates.py", line 180, in instrument_list = GetInstruments() File "C:\Users\USER\Desktop\program_trading\Algorithmic_Trading_data\cryptocurrency\bithumb\Funding_rates.py", line 31, in GetInstruments response = response.json() File "C:\Users\USER\anaconda3\lib\site-packages\requests\models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "C:\Users\USER\anaconda3\lib\site-packages\simplejson__init__.py", line 525, in loads return _default_decoder.decode(s) File "C:\Users\USER\anaconda3\lib\site-packages\simplejson\decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "C:\Users\USER\anaconda3\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

may I know how can I solve it/ get the data?