Laeyoung / COVID-19-API

API Service for tracking the COVID-19
https://ainize.ai/laeyoung/covid-19-api
MIT License
121 stars 32 forks source link

Filter parameter for /latest #6

Closed chaosblog closed 4 years ago

chaosblog commented 4 years ago

Would it be possible to add an filter to the API when querying /latest to get only the data of a specific country? Something like /latest?iso2=US or /latest?iso3=USA to get only the US-records.

espipj commented 4 years ago

Hey @Laeyoung I think this issue, and #5 can be solved adding a parameter on the routes kind of like ?onlyCountries=true and making the sum of all the cities in those countries (China, US...) and returning the Country instead of by city, for the other countries we already have the data, so it would be easy I think. I can work on that if you want 😄

Laeyoung commented 4 years ago

Hi @chaosblog.

I just added filter by country iso feature. Plz check this https://github.com/Laeyoung/COVID-19-API#latest

Laeyoung commented 4 years ago

Hello, @espipj

Thank you for your opinion. In new release version, ?onlyCountries=true param has been added. You can test it at this link

chaosblog commented 4 years ago

@Laeyoung Thank you very much. Works like a charm.