{
  "endpoints": {
    "/api/businesses?city=&status=&q=&limit=": "list businesses (status: prospect/client/seen)",
    "/api/businesses/:id": "one business: reports, fixes, score history by date and engine, top co-mentioned competitors",
    "/api/businesses/:id/score?questions=a,b&engine=&from=&to=": "overall score (0-100) and per-engine counts for a question set",
    "/api/businesses/:id/excerpts?question=&from=": "what AI said about this business, why the ones ranked ahead were picked, and cited sources, per run (for retest comparison)",
    "/api/questions?city=&kind=": "question bank",
    "/api/questions/:id/runs": "every run of a question with the ranked list and checked ranks",
    "/api/runs?business=&question=&engine=&from=": "raw runs",
    "/api/graph?city=&min=2": "co-mention graph: nodes and weighted edges",
    "/api/resolve?name=": "find a business id by any spelling",
    "/api/stats?key=&from=": "telemetry funnel + unsubscribed businesses (needs the STATS_KEY secret)",
    "/t/u/status?b=": "has this business unsubscribed from our emails?",
    "/api/ingest_log?after=": "test-result batches written through /api/ingest (for tools/sync.py)",
    "POST /api/ingest": "append-only write of runner results (Authorization: Bearer INGEST_KEY); upload page /t/up"
  },
  "scoring": "rank 1=1, 2=0.8, 3=0.6, 4-5=0.4, 6+=0.2, mentioned w/o rank=0.5, not mentioned=0; avg x 100"
}