Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn this into an API #295

Open
pascalwhoop opened this issue Mar 7, 2020 · 10 comments
Open

Turn this into an API #295

pascalwhoop opened this issue Mar 7, 2020 · 10 comments

Comments

@pascalwhoop
Copy link

@pascalwhoop pascalwhoop commented Mar 7, 2020

Hi,
I'd like to help and turn this csv data into a REST API. I did a quick hack to show that it's easily done but I think people would use this happily and it's nicer to have data shared via an endpoint than via CSV files.
As an example, this is my endpoint which just converts the current HEAD csv data from CSSE into JSON documents via pandas

https://opencovid19.com

https://api.opencovid19.com/v1/confirmed
https://api.opencovid19.com/v1/deaths
https://api.opencovid19.com/v1/recovered
https://api.opencovid19.com/v1/populations

If the people running this would appreciate that, I'd be happy to contribute some code that can be deployed as an AppEngine or Cloud Run on GCP

@Bost
Copy link

@Bost Bost commented Mar 7, 2020

https://quixotic-elf-256313.appspot.com/api/populations

Ha! I've been working on exactly the same thing: https://github.com/Bost/corona_cases/blob/master/src/corona/countries.clj (still under construction)

Is your source code public?

@melaniam
Copy link

@melaniam melaniam commented Mar 8, 2020

Having an API would be very useful. This is something I implemented using the data provided in the API (could not call the API directly because of CORS issues): https://c3ewv.csb.app/

The code is here: https://codesandbox.io/s/covid-19-data-chart-c3ewv

@Wikunia
Copy link

@Wikunia Wikunia commented Mar 8, 2020

@pascalwhoop may I ask where you got your populations from? Any change to also have density or size of each country/state? This would be very helpful to have a better perspective on the likelihood of getting infected. Of course this would only be a rough estimate.
Besides that it's quite easy to get the latest csv files with raw.githubusercontent.com:
i.e https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv

Edit: If someone is interested in my visualizations: https://opensourc.es/blog/covid-19
I'll update them and will try to make a more interactive version soon. This is for everyone who doesn't like the bubble graphs 😉
New visualization at: https://covid19.opensourc.es

@pascalwhoop
Copy link
Author

@pascalwhoop pascalwhoop commented Mar 8, 2020

Ha, awesome! I put it in a repo, let's make it better and then potentially donate it to this repo
https://github.com/pascalwhoop/covid19-api
@Bost the code is above. It's simple but it works
@melaniam sorry about the CORS. let me add a * on CORS.
@Wikunia the populations are from https://data.worldbank.org/indicator/SP.POP.TOTL?end=2016&start=2016&view=bar

@selmansamet
Copy link

@selmansamet selmansamet commented Mar 9, 2020

Hey! I made a visualization map by using your REST API. Thanks for it!
https://github.com/selmansamet/ncov-disease

@melaniam
Copy link

@melaniam melaniam commented Mar 9, 2020

No CORS issues anymore. Updated the app with more data as well: https://c3ewv.csb.app/

@melaniam
Copy link

@melaniam melaniam commented Mar 9, 2020

@pascalwhoop how often does the data refresh? I can only see values from yesterday (March 8th).

@selmansamet
Copy link

@selmansamet selmansamet commented Mar 9, 2020

@melaniam it's same for the source file (here). There is no data for 9th.

@pascalwhoop
Copy link
Author

@pascalwhoop pascalwhoop commented Mar 10, 2020

@Wikunia @selmansamet @melaniam
We opened a small org on github where we want to make the API be community owned and improve it together. I’ll also move it to a proper domain I bought yesterday
https://github.com/open-covid19/covid19-api
The api will soon be available under
api.opencovid19.com/v1/

I’ll update the server to make all keys of the JSON documents camel cases and add more data etc. I’ll also try and make our system more resilient to upstream changes (instead of proxying the data sources I’ll extract data into our own DB).

The goal is an open, community supported rich source of data for many people based on official data sources only.

I’d love for any of you to join and maybe work on the front end with Remon (the other lad) or whatever you want to work on

@melaniam
Copy link

@melaniam melaniam commented Mar 10, 2020

@pascalwhoop I'd love to join!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants