hello@datascout.com.au +61 2 9836 0068 +1 (971) 412-3678
COVID-19 (2019 Novel Corona) Virus API
To get to the original dashboard visit: https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6

COVID-19 (2019 Novel Corona) Virus API

Our team wanted to map out what was happening with the epidemic formally known as 2019-nCoV and now officially known as COVID-19 – the Novel Corona Virus coming out of Wuhan China.  We were wondering if there was a map of the outbreak and a timeline.  We did find quite a few maps but it was only recently we found one with a timeline factor.  If you are looking for one we found one on Wikipedia which looks great! 👇

So rather than build another map, we thought we’d try and be useful and build an API for others to use for the COVID-19 virus (2019-nCoV).  In our search we found the Johns Hopkins University Dashboard which looks like this (picture is a screenshot and not live):

2019-nCoV dashboard from 20200209
To get to the original dashboard visit: https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6

At the bottom there was a link to a Google Sheet which had all the counts that feeds the map!  The Google spreadsheet had one tab for each day and listed out the confirmed cases, recovered and deaths along with a lat / long.  Perfect!  The sheet has been updated to a different link so here is the one from today 9th February 2020: https://docs.google.com/spreadsheets/u/1/d/1wQVypefm946ch4XDp37uZ-wartW4V7ILdg-qYiDXUHM/htmlview?usp=sharing&sle=true   

There was a link to another one in the Google Sheet at some point which we’ve used to test our latest API Maker product – SheetLoad.  This one is structured with 3 tabs.  You can find the spreadsheet (as of today) here: https://docs.google.com/spreadsheets/u/1/d/1UF2pSkFTURko2OvfHWWlFpDFAr1UxCBA4JLwlSP6KFo/htmlview?usp=sharing&sle=true

Here’s what the spreadsheet looks like:

Rather than build a standalone API, we built an API Maker that would take the data from a Google Sheet (spreadsheet) and output it as an API.  This tool is called SheetLoad 💩🚚 (emoji’s are optional).

SheetLoad takes in the tabs and all the data in the sheets and outputs in a JSON format.

To give it a whirl, use the API we have created using SheetLoad from the Johns Hopkins University COVID-19 (2019-nCoV) sheet by this URL:

https://sheetload.datascout.com.au/v1/?preset=2019-ncov

To make it prettier I’d suggest you use a browser extension to output nicer looking JSON.  It should look something like this: 

Screenshot of the SheetLoad API for the 2019-nCoV
To make it pretty like this I used a browser extension called JSON Formatter (https://github.com/callumlocke/json-formatter)

If you want to try the COVID-19 (2019-nCov) API in action for yourself (or via one of your developers) you can use this curl command:

curl --header 'Content-Type: application/json' --data '{"spreadsheetID":"1yZv9w9zRKwrGTaR-YzmAqMefw4wMlaXocejdxZaTs6w"}' https://sheetload.datascout.com.au/v1/

And if you are restricted and happen to be using a Windows command version of curl (mine was https://curl.haxx.se/download.html) use this:

curl --header "Content-Type: application/json" --data "{\"spreadsheetID\":\"1yZv9w9zRKwrGTaR-YzmAqMefw4wMlaXocejdxZaTs6w\"}" https://sheetload.datascout.com.au/v1/

Yep – you can see here where exactly to put in your SpreadsheetID in order to get your Google Sheet out as an API!  Queue the drums and horns – 🥁🎉.  Remember to make your Google Sheet viewable by anyone with a link or publicly available to make your API work.

We’d love to hear from you if you have found using SheetLoad useful either as the 2019-nCoV API or as an initial trial of our API Maker SheetLoad.  Updates soon when we build a few more front-end configuration features to SheetLoad.

Leave a Reply

Close Menu