I am writing basic python script for getting api response of wikipedia api using below code. i am new to python, can anyone point out my mistake please.
import requests
from flask import Flask
URL = 'https://en.wikipedia.org/w/api.php'
r = requests.get(URL).json()
print(r)
Traceback (most recent call last): File "C:/Users/Haider Ghufran/PycharmProjects/scrap_api/web_api.py", line 7, in r = requests.get(URL).json() File "C:\ProgramData\Anaconda3\envs\scrap_api\lib\site-packages\requests\models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "C:\ProgramData\Anaconda3\envs\scrap_api\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\ProgramData\Anaconda3\envs\scrap_api\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\ProgramData\Anaconda3\envs\scrap_api\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)