UKHSA-Internal / coronavirus-dashboard-api-v1

MIT License
0 stars 1 forks source link

Paginated API queries can be split for a particular date/area across multiple pages #39

Open DaveJephson opened 3 years ago

DaveJephson commented 3 years ago

Some API v1 results can be split across pages. See this example:

https://api.coronavirus.data.gov.uk/v1/data?page=4&filters=areaType%3Dltla&structure=%7B%22date%22%3A%22date%22%2C%22areaName%22%3A%22areaName%22%2C%22areaType%22%3A%22areaType%22%2C%22areaCode%22%3A%22areaCode%22%2C%22cases%22%3A%22newCasesBySpecimenDate%22%2C%22deaths%22%3A%22newDeaths28DaysByDeathDate%22%2C%22pcrPercentage%22%3A%22uniqueCasePositivityBySpecimenDateRollingSum%22%7D

https://api.coronavirus.data.gov.uk/v1/data?page=5&filters=areaType%3Dltla&structure=%7B%22date%22%3A%22date%22%2C%22areaName%22%3A%22areaName%22%2C%22areaType%22%3A%22areaType%22%2C%22areaCode%22%3A%22areaCode%22%2C%22cases%22%3A%22newCasesBySpecimenDate%22%2C%22deaths%22%3A%22newDeaths28DaysByDeathDate%22%2C%22pcrPercentage%22%3A%22uniqueCasePositivityBySpecimenDateRollingSum%22%7D

The first link (page 4) has the last entry: {​​​​​​​​​"date":"2021-06-04","areaName":"Cheshire West and Chester","areaType":"ltla","areaCode":"E06000050","cases":null,"deaths":0,"pcrPercentage":2.1}​​​​​​​​​

But the first entry for the second link (page 5) is: {​​​​​​​​​"date":"2021-06-04","areaName":"Cheshire West and Chester","areaType":"ltla","areaCode":"E06000050","cases":52,"deaths":null,"pcrPercentage":null}​​​​​​​​​

So the same date and area, but the metrics are split across the pages, with nulls where they are not included.