COVID-19 API - How can you return more records than the default

Hello,

I am New to Postman but trying to get some data into csv from
https://corona-virus-stats.herokuapp.com/api/v1/cases/countries-search

Currently it is only showing 10 records and there is around 200 of them and growing.

How to format the link so am able to get all the records?

Thank you

Hey @esterdid,

Welcome to the community!! :wave:

There are a number of URL params that you can use with the API - One of which is the limit param, which can be used to return more records. Without that param, it’s just returning the default limit.

Using limit on the URL would give you more data:

https://corona-virus-stats.herokuapp.com/api/v1/cases/countries-search?limit=200  

Other params that can be used in the same way are:

  • page
  • search
  • order
  • how

There is some level of error handling on the API that will display the options available if you get the order value incorrect.

{
    "errors": "Invalid order options. Order options must be one of ['total_cases', 'new_cases', 'total_recovered', 'total_deaths', 'new_deaths', 'active_cases', 'serious_critical', 'cases_per_mill_pop']",
    "status": "failed"
} 

More details about the API can be found here:

1 Like

Thanks a lot Danny. That is what I needed.

You’re welcome. :trophy:

I extended the answer to include the rest of the params, just incase anyone had a similar question for the same API.