Cabinhub News API v1.0.0

Docs / Culture All

Culture All

Culture All

GET/fxs/v4/culture/all
Auth
client bearer
Cache-Control
private, max-age=3600, stale-while-revalidate=300, stale-if-error=3600, Vary: Accept-Encoding, Authorization
Validators
ETag
Source of truth
clients/openapi.json and docs/API.md §12

The cultures we serve, in FXStreet's `[{"Name": "en-US"}, ...]` shape.

Description: clients/openapi.json

Parameters

None. This route takes no path or query parameters.

Example request

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

URL = "https://vg.tempproject.online/fxs/v4/culture/all"
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/fxs/v4/culture/all",
  {
    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
[
  {
    "Name": "en-US"
  },
  {
    "Name": "zh-CN"
  }
]

Cultures we serve, from tools/fxs_contract.json → served_cultures (the same list docs/FXSTREET_COMPAT.md §3 documents)

Failures

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