Topic Verdict — API Docs

Deterministic news verdict for any topic: a 0-100 score, grade A-F, and top headlines from live GDELT news coverage (free, no key). No LLM. One call = one topic. The score comes from news coverage only — it is not a poll, not financial advice, and not an authoritative sentiment measure.

Endpoints

EndpointPriceDescription
GET /v1/verdict?topic=$0.02 USDCScore 0-100, grade A-F, volume/tone/momentum/breadth, trend, top 5 headlines with links
GET /v1/example?topic=BitcoinfreeStatic sample of the verdict response shape (no payment, no upstream call)
GET /pay$0.02 USDCPay-from-browser page: connect your wallet extension and pay to see a live score (same-origin, no CORS)
GET /gateway-balance?address=freeSaldo Gateway USDC (yang sudah di-deposit) untuk satu alamat — yang dipakai settle, bukan saldo wallet biasa
GET /healthfreeHealth check
GET /.well-known/x402freex402 payment manifest for crawlers (/v1/verdict, both payment rails)
GET /openapi.jsonfreeOpenAPI 3.1 specification
GET /docsfreeThis page
GET /skill.mdfreeAgent skill — instructions for AI agents (endpoints, presets, payment flow, scoring)
GET /llms.txtfreellms.txt link index for crawlers and agents
GET /pricing.mdfreePricing table — paid endpoints, atomic amounts, rails, settlement

Parameters

topic: free text, max 200 characters (alias q). Named presets: prabowo (Prabowo Subianto), jokowi (Joko Widodo), dpr (DPR RI), rupiah, ihsg, bitcoin, ethereum, solana. Invalid parameters return 400 before any payment is requested, so you never pay for a bad request.

Payment (x402, $0.02 USDC per paid call)

Paid endpoints return 402 Payment Required when called unpaid, with a PAYMENT-REQUIRED header containing a base64 x402 v2 envelope. The envelope offers two payment rails on Base (eip155:8453) in USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) to 0xcbc0337a3955d270cf3b49733a9c03d0af06dc29 — pick either accept: (1) Circle Gateway (batched settlement, facilitator https://gateway-api.circle.com, accept extra.name is GatewayWalletBatched); (2) standard x402 exact (facilitator https://x402.org/facilitator, accept extra.name is USD Coin with version 2, the token's own EIP-712 domain). Then repeat the request with the payment-signature header set to the base64 payment payload; a successful call returns 200 plus a PAYMENT-RESPONSE header with the settlement receipt. A manifest of the paid routes is published at /.well-known/x402 for crawlers.

Halaman /pay menampilkan saldo Gateway (USDC yang sudah di-deposit) dan menyediakan kartu deposit bila saldo kurang — yang dipakai settle adalah saldo Gateway, bukan saldo USDC di wallet biasa.

curl "https://topic-verdict.omnifracturedrifter.workers.dev/v1/verdict?topic=Prabowo%20Subianto"
# -> 402, PAYMENT-REQUIRED header holds the x402 envelope (accepts[])

Scoring (deterministic, no LLM)

Score 0-100 = volume 30 (log scale of article count in the last 24h — a SAMPLE of at most 250 headlines from one GDELT artlist call, so the volume component tops out around 18) + tone 25 (keyword sentiment of headlines, mapped to -10..+10 then to 0-25; neutral when no keywords match) + momentum 25 (articles in the last 6h vs the 18h before that, log2 ratio around neutral) + breadth 20 (distinct news domains/sources, 2 points each up to 10). Grades: A ≥ 80, B ≥ 65, C ≥ 50, D ≥ 35, F < 35. Results are cached 15 minutes per topic; a stale copy (up to 24h) is served if both upstreams fail.

Fallback (Google News RSS)

If GDELT is unreachable or rate-limited, the verdict is still computed — from Google News RSS for the same query — and returned as 200 with source: "google-news-rss", partial: true, and degraded containing "source:rss-fallback" plus the GDELT failure reason. RSS verdicts use the same scoring formula and are also written to cache, so warming keeps filling the cache while GDELT is down. Indonesian presets (prabowo, jokowi, dpr, rupiah, ihsg) use the id-ID feed; crypto presets (bitcoin, ethereum, solana) use en-US; free topics use id-ID when the query contains common Indonesian words, otherwise en-US. Only when GDELT and RSS both fail does the worker serve a stale copy, or answer 503 (rate-limit) / 502 (upstream error).

Limits

GDELT allows roughly one request per 5 seconds per egress IP; the worker now makes at most one GDELT call per verdict (plus one retry after 5s), so a cache miss rarely hits that limit — and when it does, the RSS fallback answers instead of an error. Google News RSS is fetched once per verdict and doubles as the cross-check when GDELT succeeds.

Contact

Questions or issues: lord4irdrop@gmail.com. OpenAPI spec: /openapi.json.