Skip to content

isjeffcom/coronavirusDataGlobal

Repository files navigation

COVID-19 Global History Data API

covid-19 global update

Coronavirus Global History Data Collector and API

This is sub-project for better understanding, analysis and visualize COVID-19 data in the UK.
Main Project: https://github.com/isjeffcom/coronvirusFigureUK

API List

HTTP GET: http:https://global.covid19uk.live

Parameter

/realtime: Get Real Time Data (provided by https://covid19api.com/) /current: Get Saved Global Data (1 Day Delay)
/data?date=<YYYY-MM-DD>: Search data by date
/data?country=<COUNTRY>: Search data in country level
/data?date=<YYYY-MM-DD>&country=<COUNTRY>: Search data by date and country
/data?place=<PROVINCE>: Search data in province level
/data?date=<YYYY-MM-DD>&place=<PROVINCE>: Search data by date and province

Standard date format: YYYY-MM-DD

Countries and Provinces list

The full countries and provinces list in in /list, however, as the data is keep updating, run those 2 JS scripts eg. node country.js can generate a new list.

Be aware
Mainland China === China Mainland
Hong Kong === PRC Hong Kong
Macau === PRC Macau
Taiwan === ROC Taiwan (China)

United Kingdom

use UK for early UK data use United Kingdom for later UK data

Important

The data collection code in init.py -> main() needs to fit the CSV data format published by JH CSSE. As they have changed data format for 3 times, and maybe more for the future. The script needs to constantly monitor and change if any changed.

API USAGE NOTICE

There are not much access barriers for this public API. The only thing I ask for is:

PLEASE do not attack or harm the server as this is not build for profit, it's for people to obtain and understand information
PLEASE be careful when you testing this API in your product as it could be potentially create damage
PLEASE make sure you have cached data on your side if you are building a product to customer as this API is not guaranteed 24/7 stable.

Getting Started

Data

  1. Install Python(2 or 3), git and MySQL to your environment
  2. Install PyMySQL by pip install PyMySQL
  3. Rename conf_tmp.json to conf.json and config your database
  4. Excute python init.py

That's it, you have global covid-19 data in your database history table and cached in /data folder as JSON format

API

  1. Install NodeJs
  2. Excute npm i && npm run dev to start up API server

The server will running at: http:https://localhost:8003

Update

excute python update.py

You can set up a timer for this by corn or node-schedule, maybe any, once a day

Dataset

Thanks for Johns Hopkins CSSE provide this dataset. They are doing a great job.
https://github.com/CSSEGISandData/COVID-19

Notice

You can use NodeJs to excute python update by a function I placed in index.js call forceUpdate().

Partnered Projects

UK API: https://github.com/isjeffcom/coronvirusFigureUK
Global API: https://github.com/isjeffcom/coronavirusDataGlobal
ML Prediction: https://github.com/lamharrison/coronavirus-machine-learning

Contact

If you are using this API, please join this discussion board. Keep updated for any significant changes!!
https://spectrum.chat/covid-19-uk-update

WeChat Group:

https://isjeff.com [email protected]

About

Coronavirus Global Data Collector and API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published