https://github.com/alaeddinemessadi/covid-19-report-api
⚕️🚑 COVID-19 API Service to keep tracking cases worldwide 🌍
https://github.com/alaeddinemessadi/covid-19-report-api
api api-rest api-server corona corona-server coronavirus-analysis coronavirus-info coronavirus-real-time coronavirus-tracking covid covid-19 covid-api covid-data express expressjs javascript node nodejs
Last synced: 6 months ago
JSON representation
⚕️🚑 COVID-19 API Service to keep tracking cases worldwide 🌍
- Host: GitHub
- URL: https://github.com/alaeddinemessadi/covid-19-report-api
- Owner: AlaeddineMessadi
- License: gpl-3.0
- Created: 2020-03-20T13:15:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-20T14:16:26.000Z (over 2 years ago)
- Last Synced: 2025-05-23T11:30:18.403Z (about 1 year ago)
- Topics: api, api-rest, api-server, corona, corona-server, coronavirus-analysis, coronavirus-info, coronavirus-real-time, coronavirus-tracking, covid, covid-19, covid-api, covid-data, express, expressjs, javascript, node, nodejs
- Language: JavaScript
- Homepage: https://alaeddinemessadi.github.io/COVID-19-REPORT-API
- Size: 5.29 MB
- Stars: 17
- Watchers: 2
- Forks: 4
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# COVID-19-REPORT-API
COVID-19-REPORT-API is an API Service to keep tracking COVID-19 cases worldwide
[Preview](https://covid-19-report-api.now.sh)
## Get Started
### Prerequisites
[npm](https://www.npmjs.com/get-npm) or [yarn](https://yarnpkg.com/en/docs/install) installed
```shell
# clone the repo
$ git clone https://github.com/AlaeddineMessadi/COVID-19-REPORT-API.git
# install dependencies
$ yarn ## or npm install
# run in development mode
$ yarn dev ## npm run dev
# run tests
$ yarn test ## npm run test
```
## Run the service
#### Run in *development* mode:
Runs the application is development mode. Should not be used in production
```shell
$ yarn dev
## or with debug
$ yarn dev:debug
```
#### Run in *production* mode:
Compiles the application and starts it in production production mode.
```shell
$yarn compile
$ yarn start
```
## Documentation
```markdown
# Get me a brief report
[GET] /api/v1/cases/brief
# Get me a brief timeseries
[GET] /api/v1/cases/brief/timeseries
# Get me all latest cases in the world or in specific region or country
[GET] /api/v1/cases/latest # parameters {iso: String, province: String, onlyCountries: Boolean}
#! iso parameter can be iso2 or iso3 for example: US or USA , CN or CHN
examples:
[GET] /api/v1/cases/latest
[GET] /api/v1/cases/latest?onlyCounties=true
[GET] /api/v1/cases/latest?iso=US
[GET] /api/v1/cases/latest?iso=US&onlyCounties=true
[GET] /api/v1/cases/latest?onlyCounties=true
[GET] /api/v1/cases/latest?iso=AU&province=New+South+Wales
[GET] /api/v1/cases/latest?province=New+South+Wales
# Get me all timeseries in the world or in specific region or country
[GET] /api/v1/cases/timeseries # parameters {iso: String, province: String, onlyCountries: Boolean}
examples:
[GET] /api/v1/cases/timeseries
[GET] /api/v1/cases/timeseries?onlyCounties=false
[GET] /api/v1/cases/timeseries?iso=DE
[GET] /api/v1/cases/timeseries?iso=AU&province=New+South+Wales
[GET] /api/v1/cases/timeseries?province=New+South+Wales
[GET] /api/v1/cases/timeseries?iso=CH&onlyCounties=true
# Secret me list of contries/regions with iso2 and iso3
[GET] /api/v1/cases/countries
# Secret endpoint to update Database
[GET] /api/v1/cases/udpate?secret=secret
#! change your secret in the .env file
# Get ALL
[GET] /api/v1/cases
#! response will be huge!!
```
## Test It
Run the Mocha unit tests **TO DO: ** more tests to implement
```shell
$ yarn test
## or
$ yarn test:debug
```
## Try It
* Open you're browser to [http://localhost:3000](http://localhost:3000)
* Invoke the `/cases` endpoint
```shell
curl http://localhost:3000/api/v1/cases/brief
```
## Lint It
Fix all prettier linter errors
```shell
$ yarn lint
```
[](https://lgtm.com/projects/g/AlaeddineMessadi/COVID-19-REPORT-API/alerts/)
## Deployment
```shell
$ now
```
[](https://deploy.now.sh/?repo=https://github.com/AlaeddineMessadi/COVID-19-REPORT-API)
### Data Source
data repository for the 2019 Novel Coronavirus Visual Dashboard operated by the Johns Hopkins University Center for Systems Science and Engineering ([JHU CSSE](https://github.com/CSSEGISandData/COVID-19))
### MIT License
[](https://lbesson.mit-license.org/)
[](https://github.com/AlaeddineMessadi)