CoronaStatsAPI is a Python Rest API To Get The Latest Corona Statistics In Every Country
This is a screenshot from POSTMAN(it's an app to make web requests) it returns a json of the COVID19 Stats in US.
You can download CoronaStatsAPI source code by cloning the Git Repo and simply installing its requirements:
~ ❯❯❯ git clone https://github.com/joeVenner/CoronaStatsAPI.git
~ ❯❯❯ cd CoronaStatsAPI/
~/CoronaStatsAPI ❯❯❯ pip install -r requirements.txt
~/CoronaStatsAPI ❯❯❯flask CoronaStatsAPI.py
Make a Post or Get request to the link https://covidstatistics.herokuapp.com/usa
You can change the 'usa' by any other country name like : india,uk,spain,france...
Python
import requests
response = requests.get('https://covidstatistics.herokuapp.com/usa')
data = response.json()
print(data)
Output:
{'ActiveCases': '824,466',
'Continent': 'North America',
'Country': 'USA',
'Deaths/1m': '175',
'NewCases': '+11,909',
'NewDeaths': '+1,065',
'SeriousCritical': '14,145',
'Tests/1m': '17,471',
'TotCases/1m': '3,088',
'TotalCases': '1,022,265',
'TotalDeaths': '57,862 ',
'TotalRecovered': '139,937',
'TotalTests': '5,782,860'})
Author: Joe.