Docs / Get Topic
Get Topic
Get Topic
- Auth
- none
- Cache-Control
public, max-age=30, stale-while-revalidate=150, stale-if-error=300; no-store on 404- Validators
ETag, Last-Modified- Source of truth
clients/openapi.jsonanddocs/API.md§12
One subject page: the fixed intro, the stories, why each is here, and the filters.
The filters are answered HERE, in one body, so the page can be linked, shared and reloaded in the state the reader left it in — `#/topic/fed?window=7d&category=macro is a URL, not a client-side guess. counts reports the size of every filter combination before the page is truncated, so a chip is a fact and not decoration. pagination` reports the page, page size, page count and both neighbours, so a reader (or a client) can walk the whole archive instead of the first page of it.
Description: clients/openapi.json
Parameters
| Name | In | Required | Type | Example | Notes |
|---|---|---|---|---|---|
slug | path | yes | string | federal-reserve | |
locale | query | no | string | en | One locale; omit for every locale |
limit | query | no | string | 2 | Defaults to 24, capped at 60 |
window | query | no | string | all | 30d | 7d | 24h | |
category | query | no | string | central_banks | Keep only stories from this beat |
sort | query | no | string | newest (default) | oldest | |
page | query | no | string | 1 | 1-based archive page; page 1 is page 1 |
Example request
curl -sS \
'https://vg.tempproject.online/v1/site/topics/federal-reserve?limit=2&page=1'import json
import os
import urllib.request
URL = "https://vg.tempproject.online/v1/site/topics/federal-reserve?limit=2&page=1"
def call() -> dict:
req = urllib.request.Request(URL, headers={})
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])const res = await fetch(
"https://vg.tempproject.online/v1/site/topics/federal-reserve?limit=2&page=1",
{
method: "GET",
headers: {},
},
);
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
cache-control: public, max-age=30, stale-while-revalidate=150, stale-if-error=300; no-store on 404
# validators: ETag, Last-Modified
content-type: application/octet-streamNo JSON body on this route; the headers are the ones docs/API.md §2 documents for it
Failures
This operation can answer 200, 304, 400, 404, 422, 429, 503. The full envelope for each status, with its body, is on Errors.