Developer Reference · OpenAPI 3.1

THAI.NEWS Wire API Documentation

Technical guide to discovering breaking and historical news about Thailand across monitored Thai and English news outlets — organized into multi-outlet event clusters, linked to THAI.NEWS reporting, and streamable in real time.

1. How to Discover Articles & Events About Thailand

The THAI.NEWS Wire indexes all discovered news items across monitored Thai and English outlets and groups coverage of the same event into persistent coverage clusters. Use the queries below to discover stories by recency, coverage consensus, beat, topic hub, language, or historical date range.

A. What's Happening in Thailand Today

Query /api/v1/wire/today for the current Bangkok calendar day (Asia/Bangkok), ordered by coverage count (source_count DESC). Pass sort=latest for reverse-chronological order.

curl -s "https://thai.news/api/v1/wire/today?limit=20" | \
  jq '.clusters[] | {reports: .source_count, category, headline, thai_news: .thai_news_article.url}'

B. High-Consensus Developing Stories

Filter with min_sources=3 to surface events covered by three or more monitored outlets.

curl -s "https://thai.news/api/v1/wire/clusters?hours=24&min_sources=3&limit=25"

C. Filter by Beat, Topic Hub, Language, or Keyword

Combine category, topic, lang (en or th), and keyword q to discover Thailand news in a specific domain:

# English visa and immigration event clusters over the past 72 hours
curl -s "https://thai.news/api/v1/wire/clusters?hours=72&category=visa&lang=en"

# All monitored coverage of the Thailand Digital Arrival Card (TDAC)
curl -s "https://thai.news/api/v1/wire/clusters?hours=168&topic=thailand-digital-arrival-card"

# Keyword search across event headlines and summaries
curl -s "https://thai.news/api/v1/wire/clusters?hours=168&q=Suvarnabhumi"

D. Historical Event Catalog & Date-Range Lookups

Inspect any past Bangkok calendar day via date=YYYY-MM-DD or any custom RFC 3339 range via from and to:

curl -s "https://thai.news/api/v1/wire/clusters?date=2026-11-28&min_sources=2"
curl -s "https://thai.news/api/v1/wire/clusters?from=2026-11-20T00:00:00Z&to=2026-11-29T00:00:00Z&category=economy"

E. Following Original URLs & Linked THAI.NEWS Articles

Every cluster returns sources[] (each monitored outlet's canonical url, name, language, and tier), thai_news_article (corresponding THAI.NEWS coverage when published), and up to 3 related_articles. Fetch clean Markdown for any linked THAI.NEWS article at /api/v1/articles/{category}/{slug}.md.

2. Complete Endpoint Reference

Base URL: https://thai.news · Machine-readable schema: /api/v1/wire/openapi.json

EndpointDescriptionQuery Parameters
GET /api/v1/wire/todayToday's Bangkok-day event clusters + live countsdate (YYYY-MM-DD), category, topic, lang (en|th|all), sort (coverage|latest), limit (1–100, default 40)
GET /api/v1/wire/clustersHistorical & live event catalog with paginationdate, from, to, hours (1–8760, default 24), category, topic, lang, min_sources, q, sort, limit (1–100), offset
GET /api/v1/wire/clusters/{id}Full timeline & links for one event clusterPath param: cluster UUID or slug
GET /api/v1/wireFlat chronological wire across monitored outletsdate, from, to, hours, source (outlet id), category, topic, lang, q, limit (1–200, default 50), offset
GET /api/v1/wire/sourcesDirectory of monitored outlets & freshness watermarksNone (returns id, name, language, tier, last_synced_at, items_24h)
GET /api/v1/wire/streamReal-time Server-Sent Events (SSE) streamcategory, topic, lang
GET /api/v1/wire/openapi.jsonOpenAPI 3.1.0 specificationNone

3. Categories & Curated Thailand Topic Hubs

Canonical Categories (?category=):thailand, economy, tourism, visa, immigration, cannabis.

Curated Topic Hubs (?topic=): Wire items and event clusters are automatically tagged against the Thailand topic taxonomy:

Topic SlugTopic NameLive Wire Example
thailand-immigrationThailand Immigration & Visa Rules/api/v1/wire/clusters?topic=thailand-immigration
destination-thailand-visaDestination Thailand Visa (DTV)/api/v1/wire/clusters?topic=destination-thailand-visa
thailand-digital-arrival-cardThailand Digital Arrival Card (TDAC)/api/v1/wire/clusters?topic=thailand-digital-arrival-card
suvarnabhumi-airportSuvarnabhumi Airport & Thai Aviation/api/v1/wire/clusters?topic=suvarnabhumi-airport
norse-atlantic-airwaysNorse Atlantic Airways & Thailand Routes/api/v1/wire/clusters?topic=norse-atlantic-airways
thailand-tourism-authorityTourism Authority of Thailand (TAT)/api/v1/wire/clusters?topic=thailand-tourism-authority
thailand-cannabis-lawThailand Cannabis Law & Regulation/api/v1/wire/clusters?topic=thailand-cannabis-law
bank-of-thailandBank of Thailand & Digital Finance/api/v1/wire/clusters?topic=bank-of-thailand
phuket-tourismPhuket Tourism, Transit & Infrastructure/api/v1/wire/clusters?topic=phuket-tourism
pattaya-tourismPattaya & Eastern Seaboard/api/v1/wire/clusters?topic=pattaya-tourism

4. Real-Time Streaming (Server-Sent Events)

Connect to GET https://thai.news/api/v1/wire/stream for push delivery as new items are clustered. Supports server-side filtering via ?category=, ?topic=, and ?lang=, with automatic 20-second keep-alive comments.

  • event: sync — Sent immediately on connect with {"status":"connected","server_now":"..."}.
  • event: cluster_created — Fired when a new event cluster is created.
  • event: cluster_updated — Fired when additional coverage matches an existing event cluster.
const wire = new EventSource("https://thai.news/api/v1/wire/stream?category=economy");

wire.addEventListener("cluster_created", (ev) => {
  const data = JSON.parse(ev.data);
  console.log("[NEW EVENT]", data.headline, data.latest_item.url);
});

wire.addEventListener("cluster_updated", (ev) => {
  const data = JSON.parse(ev.data);
  console.log(`[${data.source_count} REPORTS]`, data.headline, data.latest_item.source_name);
});

5. MCP & AI Agent Integration

AI agents connected to the JSON-RPC 2.0 MCP server (POST https://thai.news/mcp) can query the wire directly alongside full THAI.NEWS article search:

  • get_wire_today — Returns today's event clusters (optional date, category, topic, lang, limit).
  • list_wire_clusters — Queries historical event clusters (optional hours, category, topic, q, min_sources, limit).
  • search_news & get_article — Full-text search and clean Markdown retrieval with citable #p-{n} passage links.

See MCP & Agent API Docs and /llms.txt for client setup.

6. Performance, Caching & Rate Limits

  • In-Memory Cache: Hot wire responses are served from RAM with pre-compressed Brotli (br) and Gzip payloads, automatically invalidated when new items are clustered.
  • Conditional Requests: Pass If-None-Match using the returned weak ETag header to receive 304 Not Modified responses when polling.
  • Cache-Control:20s on /today, /clusters, and /wire; 30s on /clusters/{id}; 60s on /sources; 3600s on /openapi.json.
  • Rate Limits & CORS: Public read-only access with Access-Control-Allow-Origin: * and a fair-use limit of 60 requests/minute per IP across JSON endpoints. Prefer /api/v1/wire/stream over frequent polling.

7. Annotated Cluster Response Schema

{
  "date": "2026-11-29",
  "timezone": "Asia/Bangkok",
  "updated_at": "2026-11-29T14:25:00Z",
  "total_clusters": 412,
  "total_items": 1126,
  "clusters": [
    {
      "id": "8f2a9c40-...",
      "slug": "thailand-ore-chemical-export-ban",
      "headline": "Thailand moves to halt ore-smelting chemical exports",
      "summary": "Concise event summary from lead reporting...",
      "category": "economy",
      "topics": ["thailand-immigration"],
      "source_count": 7,
      "first_seen_at": "2026-11-29T02:10:00Z",
      "last_seen_at": "2026-11-29T09:42:00Z",
      "thai_news_article": {
        "id": "369c9a7d-...",
        "slug": "chiang-rai-ore-chemical-export-ban",
        "title": "Chiang Rai rivers: chemical export ban on 30 Nov",
        "url": "https://thai.news/news/thailand/chiang-rai-ore-chemical-export-ban",
        "category": "thailand",
        "published_at": "2026-11-28T03:55:00Z"
      },
      "related_articles": [ /* up to 3 related THAI.NEWS articles */ ],
      "sources": [
        {
          "id": "a297ae2c-...",
          "cluster_id": "8f2a9c40-...",
          "title": "Outlet headline",
          "snippet": "Short excerpt...",
          "url": "https://example.com/original-article",
          "source_id": "outlet_id",
          "source_name": "Outlet Name",
          "language": "en",
          "tier": 1,
          "category": "economy",
          "topics": [],
          "published_at": "2026-11-29T02:10:00Z",
          "discovered_at": "2026-11-29T02:12:04Z"
        }
      ]
    }
  ]
}