Developer / Referensi
Natural-language query (LIVE — resolver v0)
POST /v1/query
Isi referensi
Turn a plain-language prompt into a chart-ready answer with cited sources, across all series + the intent datasets (music charts, film admissions, civic tables, entity lists).
**v0 (resolver-backed):** served by the deterministic resolution engine that powers the homepage search bar — no hallucination surface. The full LLM orchestrator (Anthropic SDK tool-use + Haiku/Sonnet routing + SSE streaming per DECISIONS ER-F3) is the documented upgrade path and will wrap this resolver; the contract below is forward-compatible. `engine` in the response says which path served the request (`resolver_v0`).
Body: `{ prompt, format?: chart|narrative|both, lang?: id|en }`. `format` trims the envelope — `narrative` omits `chart_spec`, `chart` omits `answer`. A prompt with no confident catalog match returns `200` with `matched: false` (and is logged to the coverage backlog), NOT an error.
Deskripsi endpoint berasal dari spesifikasi dan masih berbahasa Inggris.
Parameter
| Parameter | Lokasi | Tipe | Aturan |
|---|---|---|---|
| Tidak ada parameter. | |||
Hak redistribusi mengikuti lisensi seri. Data tampilan saja tidak tersedia sebagai baris mentah.
Respons
| Kode | Keterangan |
|---|---|
| 200 | Resolved answer (or matched=false when no coverage) |
| 400 | Missing/invalid prompt or malformed JSON |
| 401 | Missing or invalid API key |
| 429 | Rate limit exceeded |
Dibangkitkan dari openapi.yaml, spesifikasi yang sama dengan /v1/openapi.yaml.
Permintaan / contoh
curl -X POST "https://api.sumber.io/v1/query" \
-H "x-api-key: $SUMBER_KEY" \
-H "content-type: application/json" \
-d '{"query": "inflasi Indonesia"}'