GET /api/v1/health/ping
Public liveness check. No API key. Returns { "ok": true, "service": "openmap-backend" }.
REST API for OpenMap data layers — crime, census, health, economics, environment, politics, and social data.
Base URL: https://api.getopenmap.com/api/v1/{category} (local: http://localhost:8080/api/v1/{category})
Authentication: Send header x-api-key: <API_DEV_KEY> on all data routes except GET /api/v1/health/ping.
Env keys: Copy backend/.env.example → backend/.env and replace placeholder values. Frontend needs matching VITE_API_DEV_KEY in frontend/.env.
Public liveness check. No API key. Returns { "ok": true, "service": "openmap-backend" }.
Shows DB connection and which env vars are configured (boolean only). Requires x-api-key.
Requires CENSUS_API_KEY — Census API signup
State population estimates from U.S. Census Bureau PEP API.
| Parameter | Required | Description |
|---|---|---|
year | No | Data vintage year (default 2023) |
Response: { source, year, count, states: [{ name, population, stateFips, stateCode }] }
Economic data uses BEA_API_KEY for state GDP and ECONOMY_KEY for county income from the Census ACS API. ECONOMY_KEY must be a valid Census API key.
State GDP (millions USD) from Bureau of Economic Analysis Regional accounts.
| Parameter | Required | Description |
|---|---|---|
year | No | Four-digit year (default 2022) |
Response: { source, year, count, states: [{ geoFips, geoName, gdpMillions, unit }] }
County median household income from Census ACS 2024. Requires ECONOMY_KEY to contain a valid Census API key.
HEALTHDATA_API_KEY is optional (CDC Socrata app token for higher rate limits).
Adult uninsured rate by state from CDC PLACES (access2_crudeprev).
Response: { source, indicator, count, states: [{ state, stateName, uninsuredPercent }] }
No external API key — data from GovTrack public API.
Current U.S. senators with map coordinates for pin placement.
Response: { source, fetchedAt, count, senators: [{ id, name, state, party, lat, lng, photoUrl, ... }] }
Current U.S. House representatives (50 states, voting districts).
Response: { source, fetchedAt, count, representatives: [{ id, name, state, district, party, lat, lng, ... }] }
No external API key — reference data served from the backend.
Age of consent by state with map coordinates.
Response: { source, count, states: [{ state, ageOfConsent, latitude, longitude }] }
Requires FBI_CRIME_KEY
FBI SHR murder totals by state. Optional year query param.
FBI arrest totals by state. Optional year, offenseCode.
Open NamUs missing persons cases with last-contact coordinates. No external key; falls back to a bundled snapshot.
| Endpoint | Key required |
|---|---|
GET /airQuality | AQICN_API_TOKEN |
GET /ghgEmissions | None (EPA public data) |
GET /wasteTreatmentDisposalSites | None |
GET /coalmines | EIA_API_KEY |
GET /oilSpills | None (NOAA CSV) |
GET /stormEvents | None (NOAA NCEI Storm Events) |
GET /tornadoes | None (NOAA NCEI Storm Events paths) |
GET /debrisFlows | None (NOAA NCEI Storm Events points) |
GET /nationalRiskIndex | None (FEMA National Risk Index) |
GET /earthquakes | None (USGS Earthquake Hazards) |
GET /landslides | None (USGS Landslide Inventories) |
GET /volcanoes | None (USGS Volcano Hazards) |
GET /tsunamis | None (NOAA NCEI Tsunami Database) |
GET /wildfires | None (NIFC WFIGS) |
GET /drought | None (U.S. Drought Monitor) |
GET /dataCenters | None (local CSV) |
FBI personnel data by state. Requires FBI_CRIME_KEY. Optional year.
Mapping Police Violence case-level data (XLSX → JSON). No key.
Department-level aggregation. No key.
State-level aggregation. No key.
Police sexual violence misconduct database. No key.
Response: { source, count, cases: [{ name, title, state, formOfViolence, arrestOrSentence, link }] }
| Route | Description |
|---|---|
POST /api/v1/auth/register | Register user; needs RESEND_API_KEY for email |
GET /api/v1/auth/verify?token=... | Verify email |
POST /api/auth/login | Login with email/password |
| Variable | Required for |
|---|---|
API_DEV_KEY | All protected data routes |
MONGODB_URI | Auth / user accounts |
CENSUS_API_KEY | Census routes |
BEA_API_KEY | State GDP data |
ECONOMY_KEY | County income (Census ACS API key) |
FBI_CRIME_KEY | Crime + law enforcement FBI routes |
EIA_API_KEY | Coal mines |
AQICN_API_TOKEN | Air quality |
HEALTHDATA_API_KEY | Optional CDC rate-limit token |
RESEND_API_KEY | Registration emails |
Errors return JSON with an error string. Missing API keys return HTTP 503 with instructions to update backend/.env.
{ "error": "Census API key is still a placeholder. Replace CENSUS_API_KEY in backend/.env with your real API key." }