Skip to content

Instantly share code, notes, and snippets.

@Xetera
Last active October 2, 2021 16:09
Show Gist options
  • Save Xetera/cdd3b9457510cb8d3a5b85a8fc30891c to your computer and use it in GitHub Desktop.
Save Xetera/cdd3b9457510cb8d3a5b85a8fc30891c to your computer and use it in GitHub Desktop.
Coronavirus Statistics API

Free Coronavirus Stats API

Website

https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6

The website currently makes 3 separate API calls to retreive Death, Confirmed and Recovered cases, however ArcGIS supports multiple queries in one request so the API call has been optimized to retreive all 3 at once.

API Endpoint

https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases/FeatureServer/1/query?f=json&outStatistics=%5B%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22Confirmed%22%2C%22outStatisticFieldName%22%3A%22confirmed%22%7D%2C%20%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22Deaths%22%2C%22outStatisticFieldName%22%3A%22deaths%22%7D%2C%20%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22Recovered%22%2C%22outStatisticFieldName%22%3A%22recovered%22%7D%5D

The endpoint currently only retreives the latest global stats for infection and mortality rates but you could play around with the network console to see how to get more detailed stats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment