Unified API Endpoints
Replace BASE_URL with your deployment URL (or http://localhost:8000 for local dev).
GET
BASE_URL/api/scores
All entities (US states + global countries). Filter: ?entity_type=us_state or ?entity_type=country. Deprecated: ?region=us|global.
GET
BASE_URL/api/scores/{entity}
Single-entity detail. Works for any US state or global country (e.g. Germany, California, south-africa).
GET
BASE_URL/api/history
7-day rolling unified history. Each snapshot has an entity_type field and entities dict with per-entity composite scores.
GET
BASE_URL/api/signals
Live/stale status for all 13 data signals. Each entry includes entity_types field.
Signal Coverage (13 signals)
| Signal | Source | Cache TTL | Scope |
| Labor Market | BLS | 24 hr | US states |
| Social Distress | Reddit | 3 hr | US states |
| Overdose Rate | CDC | 24 hr | US states |
| Disaster Activity | FEMA | 6 hr | US states |
| Drug Shortages | FDA | 24 hr | US states |
| Housing Stress | Eviction Lab | 24 hr | US states |
| Gun Violence | GVA | 24 hr | US states |
| Air Quality | EPA AirNow | 3 hr | US states |
| Media Sentiment | GDELT | 6 hr | US + Global |
| Search Anxiety | Google Trends | 7 days | US + Global |
| Unemployment (ILO) | ILO ILOSTAT | 24 hr | Global |
| Disasters (EM-DAT) | EM-DAT/ReliefWeb | 6 hr | Global |
| Conflict (ACLED) | ACLED | 6 hr | Global |
Data Confidence Levels
- high โ 4โ5 signals returned data (countries) / all signals active (US states)
- partial โ 1โ3 signals available (shown with โ badge)
- low / Insufficient Data โ no coverage-gating signals returned data; score withheld
Scoring Formula
anchored_score = clip(50 + z ร 15, min=5, max=95)
where z = (value โ global_ref) / scale
ASSI = ฮฃ (domain_weight ร domain_score) [12 domains]
Final = clip(ASSI ร (1 + BVI_modifier), 5, 95)
Local Development
uvicorn api.main:app --reload # FastAPI on :8000
python3 -m http.server 3000 --directory frontend # Open index.html