I'm trying to import the URL of the Json API but I get the error message:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-18-5f40dac6d9a4> in <module>
1 # get data from the API
2 url = 'https://admin.appnext.com/offerApi.aspx?pimg=1&city=1&ua=1&id=5da11d20-0a32-4852-8233-39b711a360a9'
----> 3 r = http.request('GET', url)
4 r.status
NameError: name 'http' is not defined
The code I'm using is the follow:
# data retrieval
import urllib3
from urllib3 import request
# json data
import json
# pandas dataframes
import pandas as pd
No issues to import
# get data from the API
url = 'https://admin.appnext.com/offerApi.aspx?pimg=1&city=1&ua=1&id=5da11d20-0a32-4852-8233-39b711a360a9'
r = http.request('GET', url)
r.status
Does anybody know what could be the issue?
Thanks in advance