GSA / GSA/data.gov

Catalog-API: `/api/location/{id}` returns empty `{}` on 404 instead of consistent error body

Open
#5,904 0 comments 0 reactions 0 assignees View on GitHub
API bug Catalog
Dominant language
Python
Stars
1.1k
Forks
200
Avg merge
4h 56m
Merged PRs (30d)
5

Description

### Description
The /api/location/{location_id} endpoint returns an empty JSON object {} on 404, inconsistent with all other endpoints in the API which return {"error": "Not Found"}.

### Steps to Reproduce
GET https://catalog.data.gov/api/location/99999999 GET https://catalog.data.gov/api/location/notanid

### Expected Behavior
HTTP 404 with {"error": "Not Found"} -- consistent with the rest of the API.

### Actual Behavior
HTTP 404 with {} -- empty object, no error field, no message.

### Notes
Confirmed April 27, 2026 on two different invalid inputs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.