Guide: Verify Text Claims
Step-by-step developer tutorial for integrating automated news and claim verification into your application.
Step 1: Selecting the Optimal Analysis Tier
• **Use Fast Check (`/api/v1/predict`)** when you require instant response times (<100ms) for high-frequency chat moderation, comment screening, or free user tiers. • **Use Deep Analysis (`/api/v1/predict/deep`)** when verifying complex news stories, official government announcements, or high-stakes claims where verified citations and detailed explanations are needed.
Step 2: Implementing Fast Check (Node.js Example)
Dispatch a straightforward JSON request to the fast inference endpoint:
import axios from 'axios';interface FastCheckResult {label: 'FAKTA' | 'HOAKS';confidence: number;}export async function checkClaimFast(text: string, apiKey: string): Promise<FastCheckResult> {const { data } = await axios.post<FastCheckResult>('https://api.verilens.id/api/v1/predict',{ text },{headers: {'Authorization': `Bearer ${apiKey}`,'Content-Type': 'application/json'}});return data;}
Step 3: Rendering Confidence & Indicators
We recommend presenting a badge or alert color-coded according to the verdict and confidence percentage: • **FAKTA** (Green): Confidence ≥ 0.70 • **HOAKS** (Red): Confidence ≥ 0.70 • **Flag for Review** (Yellow): Confidence < 0.70
