axisbits / covid-api

API based on publicly available data by Johns Hopkins CSSE
20 stars 0 forks source link

Sorting and pagination #14

Open wmoralesdev opened 3 years ago

wmoralesdev commented 3 years ago

I think it would be nice to paginate and allow sorting where possible, as some countries handle a lot of provinces/regions and sometimes the request takes more time than it should, providing somewhat a bad user experience.

Awesome work!

impredicative commented 3 years ago

We certainly don't want the current API to break, so if this were to be implemented, it would have to either be an independent endpoint or an option.

wmoralesdev commented 3 years ago

Indeed, it should be a new endpoint, or a query added option.

elitemaks commented 3 years ago

Hi guys, so you mean pagination for regions within a country, right? We will do this soon.

wmoralesdev commented 3 years ago

Indeed, for region and countries. It also would be nice if a EP would return total report by country and not just globally. Thanks!

elitemaks commented 3 years ago

@impredicative @wmoralesdev it took some time, but we finally updated the API. Please check the Changelog and documentation here https://covid-api.com/api/ Let us know if you have any feedback.

impredicative commented 3 years ago

@elitemaks For technical reasons I can't yet use this total endpoint for country data if the region data isn't included in the output. For example, for https://covid-api.com/api/reports/total?iso=USA , the returned region data could be the same as in https://covid-api.com/api/reports?iso=USA . Is this possible to add? Please ignore region.cities for this request.