topics

Record one page view of /atlas/<slug> — split human vs bot, deduped per viewer.

The frontend fires this via navigator.sendBeacon on mount; crawlers that execute the beacon hit it too. Unlike the click stream (where bots are noise), for Atlas a bot scrape is a POSITIVE SEO signal, so we COUNT it — into bot_views — rather than dropping it. Human views go to views. "Most explored" ranks on TOTAL (views + bot_views); the frontend shows all three (👁 total · 👤 humans · 🤖 bots).

Server-side intake (view-counter credibility overhaul): this same endpoint also accepts a TRUSTED-PROXY relay from the frontend's own server (see _is_trusted_view_proxy) carrying the real client's UA/device/IP as headers — this is what makes Googlebot's HTML fetch (which never runs our client JS beacon) and the device_id cookie (which never survives a cross-origin sendBeacon) both actually reach the counter.

A view counts ONCE per (pillar, viewer, 30-min bucket) via a DB-backed unique row (AtlasViewEvent) — process-independent, no Redis required. Still capped per (effective) client ip as an outer fence.

Always returns 204 (CORS-open) because the sender ignores the response body, but ALSO sets X-View-Outcome (counted|seen|ignored) so the frontend can render an honest "did this actually count" state instead of a fake optimistic +1. No PII stored — just a hash and the counters.

post/api/v1/topics/{slug}/view/

Request

  • Base URL: https://api.leviathannews.xyz (the document declares no server; this is the origin it was published from)
  • URL: https://api.leviathannews.xyz/api/v1/topics/{slug}/view/
  • Auth: none required

Path parameters

slugstring required

Response

No response body

Changes

No recorded changes to this operation across all 1 revision of this API.