Skip to content

🇯🇵 Web API to get 🦠COVID-19(coronavirus) information of each prefecture in Japan

License

Notifications You must be signed in to change notification settings

DiscombobulatedDrag/covid19-japan-web-api

 
 

Repository files navigation

logo

COVID-19 Japan Web API

UpdateData LICENSE Tweet

Language

English🇺🇸 | Japanese🇯🇵

🦠 Web API to get COVID-19(coronavirus) information of each prefecture in Japan.

I created this API to help disseminate about the Japanese COVID-19 information. I am updating this API from time to time, so if you have an API you want to add, please let me know!

Table of Contents

Features

  • 🔁 Update data every 2 hours
  • 🚀 Provide REST API
  • 🇯🇵 Get info of each prefecture in Japan
  • ☕️ Simple data and simple to use
  • 📈 Predict for the next 30 days

Project using this API

If your project is not listed here, let us know!

Usage

We have published the Swagger API (https://covid19-japan-web-api.now.sh/apidocs).

You can see the documentation of this API and/or import it as a Postman collection using this link.


Prefectures

※ 2020/06/18 We have updated the response structure. Please make sure of the response.

Endpoint: https://covid19-japan-web-api.now.sh/api/v1/prefectures

Response
[
  {
    "id": 1,
    "name_ja": "北海道",
    "name_en": "Hokkaido",
    "lat": 43.46722222,
    "lng": 142.8277778,
    "population": 5248552,
    "last_updated": {
      "cases_date": 20200617,
      "deaths_date": 20200617,
      "pcr_date": 20200617,
      "hospitalize_date": 20200617,
      "severe_date": 20200617,
      "discharge_date": 20200617,
      "symptom_confirming_date": 20200617
    },
    "cases": 1176,
    "deaths": 91,
    "pcr": 17875,
    "hospitalize": 126,
    "severe": 10,
    "discharge": 959,
    "symptom_confirming": 0
  },
...

Total

※ 2020/06/18 We have updated the response structure. Please make sure of the response.

This API includes Quarantine staff data, FLIGHT data and SHIPMENT data.

Endpoint: https://covid19-japan-web-api.now.sh/api/v1/total

Response
{
  "date": 20200523,
  "pcr": 272095,
  "hospitalize": 2450,
  "positive": 17248,
  "severe": 178,
  "discharge": 13895,
  "death": 821,
  "symptom_confirming": 40
}

Total History

※ 2020/05/24 We have updated the response structure. Please make sure of the response.

This API includes Quarantine staff data, FLIGHT data and SHIPMENT data.

Endpoint: https://covid19-japan-web-api.now.sh/api/v1/total?history=true

Response
...
  {
    "date": 20200521,
    "pcr": 265190,
    "hospitalize": 2917,
    "positive": 17136,
    "severe": 199,
    "discharge": 13323,
    "death": 790,
    "symptomConfirming": 64
  },
  {
    "date": 20200522,
    "pcr": 269120,
    "hospitalize": 2652,
    "positive": 17225,
    "severe": 180,
    "discharge": 13656,
    "death": 809,
    "symptomConfirming": 66
  },
  {
    "date": 20200523,
    "pcr": 272095,
    "hospitalize": 2450,
    "positive": 17248,
    "severe": 178,
    "discharge": 13895,
    "death": 821,
    "symptomConfirming": 40
  }
]

Total Prediction

Predict for the next 30 days about the positive total and the death total.

This API includes Quarantine staff data, FLIGHT data and SHIPMENT data.

Endpoint: https://covid19-japan-web-api.now.sh/api/v1/total?predict=true

Response
[
  {
    "date": 20200413,
    "positive": 6960.103502394343,
    "death": 102.8839324261669
  },
  {
    "date": 20200414,
    "positive": 7652.287257933034,
    "death": 107.84568822992809
  },
  {
    "date": 20200415,
    "positive": 8413.308833378682,
    "death": 113.04673329952118
  },
  {
    "date": 20200416,
    "positive": 9250.01416438296,
    "death": 118.49860777416443
  },
  {
    "date": 20200417,
    "positive": 10169.930016336322,
    "death": 124.21340833627379
  },
  {
    "date": 20200418,
    "positive": 11181.33169302858,
    "death": 130.2038150517223
  },
  {
    "date": 20200419,
    "positive": 12293.317478949984,
    "death": 136.4831195045177
  },
  {
    "date": 20200420,
    "positive": 13515.89048489476,
    "death": 143.06525428832322
  },
...

Positives

Endpoint: https://covid19-japan-web-api.now.sh/api/v1/positives?prefecture=東京都

Query parameter

  • required: prefecture=(jp_name) : Filter by prefecture using jp_name
Response
[
  {
    "code": "",
    "announcement_date": "2020-01-24",
    "src": "https://www.metro.tokyo.lg.jp/tosei/hodohappyo/press/2020/01/24/20.html",
    "prefecture": "東京都",
    "residence_prefecture": "国外(武漢市)",
    "age": "40代",
    "gender": "男性",
    "attribute": "",
    "prefecture_number": "東京都1",
    "travel_or_contact": "渡航歴",
    "detail": "中国(武漢)",
    "id": "ID130001",
    "diagnosis_date": "",
    "onset": "2020/01/14",
    "symptom": "1",
    "death_or_discharge_date": "",
    "comment": "",
    "outcome": "1",
    "outcome_src": "https://i.imgur.com/P185t7C.jpg"
  },
  {
    "code": "",
    "announcement_date": "2020-01-25",
    "src": "https://www.metro.tokyo.lg.jp/tosei/hodohappyo/press/2020/01/27/24.html",
    "prefecture": "東京都",
    "residence_prefecture": "国外(武漢市)",
    "age": "30代",
    "gender": "女性",
    "attribute": "",
    "prefecture_number": "東京都2",
    "travel_or_contact": "渡航歴",
    "detail": "中国(武漢)",
    "id": "ID130002",
    "diagnosis_date": "",
    "onset": "2020/01/21",
    "symptom": "1",
    "death_or_discharge_date": "",
    "comment": "",
    "outcome": "1",
    "outcome_src": "https://i.imgur.com/P185t7C.jpg"
  },
...

Positives Statistics

This is a statistic of the positives API and does not include data that is not publicly available.

Endpoint: https://covid19-japan-web-api.now.sh/api/v1/statistics

Response
[
  {
    "name_ja": "北海道",
    "name_en": "Hokkaido",
    "total_count": 239,
    "male": {
      "count": 137,
      "generations_count": {
        "00s": 6,
        "10s": 1,
        "20s": 5,
        "30s": 8,
        "40s": 19,
        "50s": 35,
        "60s": 27,
        "70s": 19,
        "80s": 14,
        "90s": 2,
        "100s": 0,
        "unknown": 1
      }
    },
    "female": {
      "count": 100,
      "generations_count": {
        "00s": 1,
        "10s": 1,
        "20s": 14,
        "30s": 10,
        "40s": 12,
        "50s": 17,
        "60s": 15,
        "70s": 16,
        "80s": 8,
        "90s": 4,
        "100s": 0,
        "unknown": 2
      }
    },
    "unkown_gender": {
      "count": 2,
      "generations_count": {
        "00s": 0,
        "10s": 0,
        "20s": 0,
        "30s": 0,
        "40s": 0,
        "50s": 0,
        "60s": 0,
        "70s": 0,
        "80s": 0,
        "90s": 0,
        "100s": 0,
        "unknown": 2
      }
    }
  },
...

Contribution Guide

  • Please use flake8 as Lint
  • Please don't add /data directory to your commit
  • Please PullRequest to master because gitflow is not currently used

Contributers

Made with contributors-img.

Data Sources

This data was collected by volunteers and may be incorrect. Please refer to the reports of public organizations correctly.

LICENSE

MIT LICENSE

About

🇯🇵 Web API to get 🦠COVID-19(coronavirus) information of each prefecture in Japan

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%