api
APIs can be found all over the internet. A great consolidator of many APIs is RapidAPI. In this blog we will use a site to consolidates API stats. Learning a few lines of code and you can start extracting lots of data from the internet via APIs.
import requests
url = "https://numbersapi.p.rapidapi.com/1492/year"
querystring = {"fragment":"true","json":"true"}
headers = {
"X-RapidAPI-Key": "eb379b3b88mshac0018f5fdc3d2dp1b766fjsn91c096d37f4e",
"X-RapidAPI-Host": "numbersapi.p.rapidapi.com"
}
response = requests.request("GET", url, headers=headers, params=querystring)
dict= response.json()
print(dict)
for k,v in dict.items():
print(k,v)