Cabinhub News API v1.0.0

Docs / Get Stats

Get Stats

Corpus totals.

GET/v1/stats
Auth
client bearer + quota
Cache-Control
no-store
Source of truth
clients/openapi.json and docs/API.md §12

Corpus totals. Every count is a SQL aggregate over stored rows; nothing is estimated.

Description: docs/API.md §12

Parameters

None. This route takes no path or query parameters.

Example request

curl
Shell
curl -sS \
  'https://vg.tempproject.online/v1/stats' \
  -H "Authorization: Bearer $NEWS_KEY"
Python, standard library only
Python
import json
import os
import urllib.request

URL = "https://vg.tempproject.online/v1/stats"
KEY = os.environ["NEWS_KEY"]


def call() -> dict:
    req = urllib.request.Request(URL, headers={
        "Authorization": f"Bearer {KEY}",
    })
    with urllib.request.urlopen(req, timeout=15) as res:
        print(res.status, res.headers.get("ETag"))
        return json.loads(res.read().decode("utf-8"))


if __name__ == "__main__":
    body = call()
    print(json.dumps(body, indent=2, ensure_ascii=False)[:2000])
TypeScript, Node 18+, no dependencies
TypeScript
const res = await fetch(
  "https://vg.tempproject.online/v1/stats",
  {
    method: "GET",
    headers: {
      authorization: `Bearer ${process.env.NEWS_KEY}`,
    },
  },
);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(res.headers.get("etag"), await res.json());

The requests are generated from the path template and the parameters in clients/openapi.json, so a new parameter appears here without an edit to this site.

Example response

Response body
JSON
{
  "generated_at": "2026-11-04T21:29:18.587034Z",
  "items": {
    "total": 5,
    "visible": 4,
    "by_compliance_status": {"clean": 4, "withheld": 1},
    "by_locale": {"en": {"total": 3, "clean": 2, "withheld": 1}, "zh-Hans": {"total": 2, "clean": 2, "withheld": 0}},
    "by_category": {"central_banks": {"total": 2, "clean": 2, "withheld": 0}, "energy": {"total": 1, "clean": 1, "withheld": 0}, "macro": {"total": 1, "clean": 1, "withheld": 0}, "markets": {"total": 1, "clean": 0, "withheld": 1}},
    "published_last_24h": 0,
    "oldest_published_at": "2026-11-03T15:00:00.000000Z",
    "newest_published_at": "2026-11-03T18:00:00.000000Z"
  },
  "withheld": {"total": 1, "last_24h": 1},
  "database": {"file": "news.db", "in_memory": false, "page_bytes": 163840, "file_bytes": 106496, "wal_bytes": 115392},
  "sources": {"configured": 52, "last_item_published_at": {"Federal Reserve — Monetary Policy": {"items": 4, "last_item_published_at": "2026-11-03T18:00:00.000000Z"}}},
  "limitations": ["per-source fetch success is not persisted by the pipeline; see GET /v1/sources/health"]
}

Response example in docs/API.md §12 (GET /v1/stats)

Failures

This operation can answer 200, 304, 400, 401, 429. The full envelope for each status, with its body, is on Errors.