Skip to content
Advertisement

Python~JSON error → json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I was working on my discord bot and found a api(named numapi) which i want to use, i made a prototype in my pc which was ↓↓↓↓ and it worked fine.

JavaScript

But when i copied the same thing in my discord bot then it was not working. The code and error are as follows :-

code

JavaScript

error

JavaScript

pls help me slove this

Advertisement

Answer

json.loads() assumes that the data is decoded. Probably you’re receiving a bytes string. Try response.text.decode('utf-8').

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement