Pagination, filtering & formats
#Pagination
List endpoints return up to limit items (default 50, maximum 500):
{
"data": [ … ],
"meta": { "total": 199, "limit": 50, "offset": 0, "…": "…" },
"links": {
"self": "https://api.sentinara.org/v1/countries?limit=50",
"next": "https://api.sentinara.org/v1/countries?limit=50&cursor=eyJvIjo1MH0"
}
}Follow links.next until it is null. Treat the cursor as opaque.
url = "https://api.sentinara.org/v1/countries?limit=100"
rows = []
while url:
page = requests.get(url, timeout=30).json()
rows += page["data"]
url = page["links"]["next"]#Filtering and sorting
Each endpoint documents its filters in the reference. Common ones:
| Parameter | Example | Notes |
|---|---|---|
region | region=SEAR | WHO region: AMR, SEAR, WPR, EMR, AFR, EUR |
level | level=alert | normal, watch, alert, outbreak |
q | q=bra | case-insensitive search, at least 2 characters |
from, to | from=2024-01&to=2024-12 | months, inclusive, YYYY-MM |
sort | sort=-cases | prefix - for descending |
Strict parameters: an unknown or repeated parameter returns 400, so a typo such as regoin=SEAR fails loudly instead of returning unfiltered data.
#CSV
Any list endpoint returns CSV with ?format=csv or the header Accept: text/csv. Nested fields are flattened with dots (year_to_date.cases) and arrays are joined with |. Text cells that start with =, +, - or @ are prefixed with ' to prevent spreadsheet formula injection. A Link: <…>; rel="next" header points to the next page.
#Conditional requests
Every successful response has an ETag. Send it back to avoid downloading unchanged data:
curl -i https://api.sentinara.org/v1/indonesia -H 'If-None-Match: W/"2cb60518aca9db1126636b2ea40055c5"'
# HTTP/1.1 304 Not ModifiedCache-Control is public, max-age=300 without a key and private, max-age=300 with one.
#Identifiers
| Resource | Identifier | Example |
|---|---|---|
| Country | ISO 3166-1 alpha-3, or slug | IDN, indonesia |
| Province | slug or short id | jawa-barat, jabar |
| Sub-district (Semarang) | integer id | 0 |
| Month | YYYY-MM | 2026-08 |