GET /api/v1/compare
Compare one resource across multiple cities
Compares ONE resource across multiple cities (comma-separated) in a single response. Each city carries its own source_status (ok/disabled/no_data/error/not_found); a missing or dead city source does not cause an overall 5xx but is reported honestly per city. resource is checked against a fixed list (unknown -> 400). The result is paginated (page/limit/offset/sort).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
cities | query | yes | string | Comma-separated city slugs (limited to MAX_CITIES). |
resource | query | yes | string | Resource to compare (from the fixed list); unknown -> 400 invalid_request. |
page | query | no | integer | |
limit | query | no | integer | |
offset | query | no | integer | |
sort | query | no | string | |
order | query | no | string | |
If-None-Match | header | no | string | Conditional GET; If-None-Match == ETag -> 304 Not Modified with no body. |
Code samples
curl "https://infranode.dev/api/v1/compare?cities=berlin%2Ckoeln%2Chamburg&resource=weather"const res = await fetch("https://infranode.dev/api/v1/compare?cities=berlin%2Ckoeln%2Chamburg&resource=weather");
const data = await res.json();
console.log(data);import httpx
res = httpx.get("https://infranode.dev/api/v1/compare?cities=berlin%2Ckoeln%2Chamburg&resource=weather")
res.raise_for_status()
print(res.json())