backtrackbaba / covid-api

API's to interact with COVID19 dataset by John Hopkins University
https://covidapi.info/
MIT License
77 stars 19 forks source link

Consistent URL end point for current and time series end point #4

Closed RamanujamVaradhan closed 4 years ago

RamanujamVaradhan commented 4 years ago

I am looking for a consistent way to get current and time series data globally and country wise for my website.

https://covidapi.info/api/v1/global provides latest data globally but replacing global with the country code gives historic data for that country , instead of latest data.

Kindly advise if it's possible to get latest data for a country directly instead of extracting it from historic/ timesheet data.

backtrackbaba commented 4 years ago

Hi @RamanujamVaradhan , Ideally when you hit the country endpoint you should've got an array through which you could've simply selected the last element which would've been the latest. However, I have missed it in v1 and have given a map/dictionary instead.

To tackle this, I've enables an endpoint which gives you the last record date which can be accessed by hitting /api/v1/latest-date

Using this date, you could then use the country endpoint by hitting /api/v1/country/IND

We'll be enabling v2 of the API with better consistency and more endpoint to query better.

In the meantime, I wanted to know, are you using our endpoints? Is there any feedback or suggestions that you would like to pass on?

RamanujamVaradhan commented 4 years ago

I am looking to use it for my website www.covidprojections.com

When is the v2 expected to be released ?

On Wed, Mar 25, 2020, 12:30 AM Saiprasad Balasubramanian < notifications@github.com> wrote:

Hi @RamanujamVaradhan https://github.com/RamanujamVaradhan , Ideally when you hit the country endpoint you should've got an array through which you could've simply selected the last element which would've been the latest. However, I have missed it in v1 and have given a map/dictionary instead.

To tackle this, I've enables an endpoint which gives you the last record date which can be accessed by hitting /api/v1/latest-date https://covidapi.info/api/v1/latest-date

Using this date, you could then use the country endpoint by hitting /api/v1/country/IND https://covidapi.info/api/v1/country/IND

We'll be enabling v2 of the API with better consistency and more endpoint to query better.

In the meantime, I wanted to know, are you using our endpoints? Is there any feedback or suggestions that you would like to pass on?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/backtrackbaba/covid-api/issues/4#issuecomment-603684820, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANTNLKEIUB7ZBU325OJBEKLRJGXJNANCNFSM4LTGJO3A .

backtrackbaba commented 4 years ago

Give me 5 mins, I'm getting you an endpoint which will give you the latest stats for any country. I'll ping you here as soon as I deploy

RamanujamVaradhan commented 4 years ago

Really appreciate your prompt response.

On Wed, Mar 25, 2020, 6:35 AM Saiprasad Balasubramanian < notifications@github.com> wrote:

Give me 5 mins, I'm getting you an endpoint which will give you the latest stats for any country. I'll ping you here as soon as I deploy

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/backtrackbaba/covid-api/issues/4#issuecomment-603842643, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANTNLKF5Z3U4WY2ZO6MSYM3RJICBRANCNFSM4LTGJO3A .

backtrackbaba commented 4 years ago

It's deployed, checkout this endpoint /api/v1/country/IND/latest

backtrackbaba commented 4 years ago

Let me know if works for you and if any other endpoint would make your life easier!

Hack on!

RamanujamVaradhan commented 4 years ago

This would be really useful.

I will get the time series for the past few days using the other end points you have both for global and country wise data. I will work on this today and get back to you. Again I am really thrilled and thankful for your prompt response.

On Wed, Mar 25, 2020, 6:39 AM Saiprasad Balasubramanian < notifications@github.com> wrote:

Let me know if works for you and if any other endpoint would make your life easier!

Hack on!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/backtrackbaba/covid-api/issues/4#issuecomment-603844905, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANTNLKC2QX5OERRFBAHBVALRJICR3ANCNFSM4LTGJO3A .

backtrackbaba commented 4 years ago

Anytime! I'll be adding the list of projects using this data in the README. Do you mind if I add yours?

RamanujamVaradhan commented 4 years ago

Sure . You can add it once I modify it with your API I will let you know it's ready

On Wed, Mar 25, 2020, 6:43 AM Saiprasad Balasubramanian < notifications@github.com> wrote:

Anytime! I'll be adding the list of projects using this data in the README. Do you mind if I add yours?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/backtrackbaba/covid-api/issues/4#issuecomment-603846902, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANTNLKFQP7JQNPQPBLZZRV3RJIDA5ANCNFSM4LTGJO3A .

RamanujamVaradhan commented 4 years ago

I am sorry , I totally missed this. I just realized that covidapi.info/api/v1/global/timeseries returns timeseries for all countries and not global count as a whole. i am looking for an end point that would return time series data globally.

something similar to Country specific time-series data.

backtrackbaba commented 4 years ago

No problem, glad it worked out for you

RamanujamVaradhan commented 4 years ago

covidapi.info/api/v1/global/timeseries returns timeseries for all countries and not global count as a whole. i am looking for an end point that would return time series data globally.

backtrackbaba commented 4 years ago

It's already available in this endpoint /api/v1/global/timeseries/<from_date>/<to-date> where the date is in yyyy-mm-dd format

Out here, to get all the data points, you could simply start with the from_date as 2020-01-22 as that's the date of first record and the to_date as the date from the /api/v1/latest-date endpoint.

Checkout this out to get data from 22nd Jan to 24th March 2020

RamanujamVaradhan commented 4 years ago

Hi, /api/v1/global/timeseries// gives me timeseries data for all countries. I am looking for data for all countries combined . just like iam getting for https://covidapi.info/api/v1/global

for example, for IND i can get time series data through https://covidapi.info/api/v1/country/IND/timeseries/2020-03-20/2020-03-25

for the entire world there is no such API

Iam expecting a response like this

something like

{"count":5,"result":[{"confirmed":global confirmed count on 20th,"date":"2020-03-20","deaths":global death count on 20th,"recovered":0},{"confirmed":global confirmed count on 21st,"date":"2020-03-21","deaths":global death count on 20th,"recovered":0},{"confirmed":global confirmed count on 22nd,"date":"2020-03-22","deaths":global death count on 22,"recovered":0},{"confirmed":global confirmed count on 23rd,"date":"2020-03-23","deaths":global death count on 23,"recovered":0},{"confirmed":global confirmed count on 24th,"date":"2020-03-24","deaths":global death count on 24,"recovered":0}]}

not for individual countries

backtrackbaba commented 4 years ago

Got your point, give me some time I'll have it up

backtrackbaba commented 4 years ago

@RamanujamVaradhan Added the endpoint, checkout /api/v1/global/count

Let me know if this works out

RamanujamVaradhan commented 4 years ago

Thanks a lot. Again, really appreciate such a speedy response.

On Wed, Mar 25, 2020 at 10:51 AM Saiprasad Balasubramanian < notifications@github.com> wrote:

@RamanujamVaradhan https://github.com/RamanujamVaradhan Added the endpoint, checkout /api/v1/global/count https://covidapi.info/api/v1/global/count

Let me know if this works out

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/backtrackbaba/covid-api/issues/4#issuecomment-603989330, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANTNLKDXFCBZPDCSYLZOLSLRJI777ANCNFSM4LTGJO3A .

-- Simply, CVR http://www.flickriver.com/photos/seeveeaar/popular-interesting/ http://500px.com/Seeveeaar

backtrackbaba commented 4 years ago

Anytime! Let me know if it worked fine, I'll close this issue.

Please feel free to open another issue in case of any problem

RamanujamVaradhan commented 4 years ago

Thanks for all the help. I have completed the development with your API. You can now add the website to the readme page.