Prediction & Fact-Checking API
Endpoints for fast IndoBERT inference and credit-gated deep analysis with live SSE streaming.
POST /api/v1/predict (Fast Check — Free Tier)
Runs direct inference using our fine-tuned IndoBERT classifier model. Evaluates sensationalist and linguistic markers of Indonesian hoaxes in under 100 milliseconds.
Instant syntactic and stylistic classification. Free of charge (0 credits).
Headers
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer <access_token> or Bearer <api_key> |
| Content-Type | string | Required | application/json |
Body Parameters
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| text | string | Required | Indonesian text claim to verify (10 to 5,000 characters). |
Response Example (200 OK)
{"label": "FAKTA","confidence": 0.9642}
POST /api/v1/predict/deep (Deep Analysis — SSE Streaming)
Credit-gated 3-stage fact-checking pipeline with live Server-Sent Events (SSE) progress streaming. Crawls verified Indonesian registries and mainstream news to generate evidence-grounded verdicts with source citations.
Consumes 1 credit (auto-refunded if downstream services fail). Returns text/event-stream.
Headers
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer <access_token> or Bearer <api_key> |
| Content-Type | string | Required | application/json |
Body Parameters
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| text | string | Required | Indonesian claim text or news paragraph (10 to 5,000 characters). |
Response Example (200 OK)
event: stage_updatedata: {"check_id":"550e8400-e29b-41d4-a716-446655440000","stage":"claim_extraction","status":"done"}event: stage_updatedata: {"check_id":"550e8400-e29b-41d4-a716-446655440000","stage":"evidence_retrieval","status":"done"}event: stage_updatedata: {"check_id":"550e8400-e29b-41d4-a716-446655440000","stage":"verdict_generation","status":"done"}event: resultdata: {"check_id": "550e8400-e29b-41d4-a716-446655440000","normalized_claim": "Pendaftaran subsidi motor listrik 2026 dibuka melalui tautan bit.ly tanpa syarat KTP.","label": "hoaks","confidence": 0.95,"reasoning": "Kementerian Perindustrian menegaskan pendaftaran subsidi motor listrik hanya diproses melalui sistem resmi SISAPIRa dan mewajibkan verifikasi NIK KTP. Tautan bit.ly yang beredar adalah modus penipuan phishing.","cited_sources": ["https://turnbackhoax.id/2026/08/subsidi-motor-palsu","https://kominfo.go.id/berita/bansos-palsu"]}
GET /api/v1/predict/deep/:id/status (Polling Fallback)
Enables client applications to poll for status or retrieve final results if an SSE stream drops mid-flight (e.g. mobile connection handover).
Queries the progress state of an existing check ID. Scoped strictly to the check owner.
Headers
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer <access_token> or Bearer <api_key> |
Response Example (200 OK)
{"id": "550e8400-e29b-41d4-a716-446655440000","status": "completed","current_stage": "verdict_generation","result": {"normalized_claim": "Pendaftaran subsidi motor listrik 2026 dibuka melalui tautan bit.ly tanpa syarat KTP.","label": "hoaks","confidence": 0.95,"reasoning": "Kementerian Perindustrian menegaskan pendaftaran subsidi motor listrik hanya diproses melalui sistem resmi...","cited_sources": ["https://turnbackhoax.id/2026/08/subsidi-motor-palsu"]}}
