Data endpoints that redirect to an HTML page and answer 200
Checked 2026-09-08 · Moved and dead endpoints
Two public data endpoints answer a data request with a redirect to an HTML page, so a client that follows redirects sees HTTP 200 and a JSON parse error instead of the real problem. api.census.gov 302s to /data/missing_key.html when no key is supplied, and the old coronavirus.data.gov.uk API 301s to the UKHSA dashboard home page, discarding the query string. Send the request with redirects off and read the status.
What we saw
A keyless Census data request is a 302 to an HTML page, not a JSON error. Source: https://api.census.gov/data/2019/acs/acs5?get=NAME&for=state:* (status line and Location header, 2026-09-08).
302 -> https://api.census.gov/data/missing_key.html
Following that redirect gives 200 and 8531 bytes of HTML titled Missing Key. Source: https://api.census.gov/data/missing_key.html (status, content-type, title, 2026-09-08).
200 text/html 8531 ;
Missing Key
A bad key redirects to a different HTML page, so the two failures are distinguishable from the Location header alone. Source: https://api.census.gov/data/2019/acs/acs5?get=NAME&for=state:*&key=BADKEY (Location header and page title, 2026-09-08).
302 -> https://api.census.gov/data/invalid_key.html ; Invalid Key
Census metadata endpoints do not need a key, so a keyless probe of /variables.json is not a test of whether your key works. Source: https://api.census.gov/data/2019/acs/acs5/variables.json (status, 2026-09-08).
200 with no redirect
The retired UK coronavirus API 301s to the dashboard root and drops the whole query string. Source: https://coronavirus.data.gov.uk/api/v1/data?filters=areaType=overview&structure=%7B%22date%22:%22date%22%7D (status line, Location header, final URL, 2026-09-08).
301 -> https://ukhsa-dashboard.data.gov.uk/ ; final 200 text/html; charset=utf-8 2153245 https://ukhsa-dashboard.data.gov.uk/
The command
for u in 'https://api.census.gov/data/2019/acs/acs5?get=NAME&for=state:*' 'https://api.census.gov/data/2021/pep/population?get=NAME,POP_2021&for=state:*' 'https://api.census.gov/data.json' 'https://api.census.gov/data/2019/acs/acs5/variables.json'; do printf '%s\n ' "$u"; curl -sS -o /dev/null -w '%{http_code} -> %{redirect_url}\n' "$u"; done
https://api.census.gov/data/2019/acs/acs5?get=NAME&for=state:*
302 -> https://api.census.gov/data/missing_key.html
https://api.census.gov/data/2021/pep/population?get=NAME,POP_2021&for=state:*
302 -> https://api.census.gov/data/missing_key.html
https://api.census.gov/data.json
200 ->
https://api.census.gov/data/2019/acs/acs5/variables.json
200 ->
Checked 2026-09-08.
curl -sSL -o /tmp/c2.txt -w '%{http_code} %{content_type} %{size_download}\n' 'https://api.census.gov/data/2019/acs/acs5?get=NAME&for=state:*'; grep -o '[^<]*' /tmp/c2.txt
200 text/html 8531
Missing Key
Checked 2026-09-08.
curl -sSL 'https://api.census.gov/data/2019/acs/acs5?get=NAME&for=state:*&key=BADKEY' | grep -o '[^<]*'
Invalid Key
Checked 2026-09-08.
curl -sS -o /dev/null -w '%{http_code} -> %{redirect_url}\n' 'https://coronavirus.data.gov.uk/api/v1/data?filters=areaType=overview&structure=%7B%22date%22:%22date%22%7D'
301 -> https://ukhsa-dashboard.data.gov.uk/
Checked 2026-09-08.
curl -sSL -o /tmp/uk.txt -w 'final %{http_code} %{content_type} %{size_download} %{url_effective}\n' 'https://coronavirus.data.gov.uk/api/v1/data?filters=areaType=overview&structure=%7B%22date%22:%22date%22%7D'; head -c 120 /tmp/uk.txt
final 200 text/html; charset=utf-8 2153245 https://ukhsa-dashboard.data.gov.uk/