Developers
Public API
Endpoints
| Method | Path | Returns | Status |
|---|---|---|---|
| GET | /api/export/hospital/{slug}.json | One hospital with every reported measure, rank and provenance | |
| GET | /api/export/hospital/{slug}.csv | The same, one row per measure | |
| GET | /api/export/agency/{slug}.json | One federal agency: budget authority, obligations, outlays | |
| GET | /api/export/agency/{slug}.csv | The same, flattened | |
| GET | /api/v1/hospitals?state=MN | Filtered collections with pagination | |
| GET | /api/v1/geo/{geoid}/spending | Federal obligations time series for a geography | |
| GET | /api/v1/search?q= | Full-text search across every entity type |
Using it
No key, no rate limit, for single records
Per-record endpoints are cached at the edge and cost nothing to serve, so there is nothing to protect them from. Collection endpoints will need a key when they exist, because an unbounded query is a different thing from a cached document.
CORS
Every export sends Access-Control-Allow-Origin: *, so these work from a browser, a notebook, or a spreadsheet without a proxy.
Provenance travels with the data
Each response carries the agency, dataset URL, licence and effective date. A figure that leaves this site without its source is the problem this site exists to solve, so it is not possible to export one that has.
Caching
Responses are cached for seven days with a thirty-day stale-while-revalidate window, matching the underlying release cadence. Requesting more often than the agency publishes returns the same bytes.
Example
$ curl -s https://publicdatahub.org/api/export/hospital/mayo-clinic-hospital-rochester.json \
| jq '{name, measures: [.measures[] | {label, value, national_rank}], provenance}'