Docs / Quickstart
Quickstart
Prove the path, authenticate, and pull your first items in five minutes. Every command below was run against the application; the responses shown are the ones it answered.
Five minutes, four calls
GET /v1/health- no key, prove the network path.- Ask us for a key bound to your account and monthly quota.
GET /v1/meta- proves the key, and gives you the locales and categories.GET /v1/feed/en- your first items, with anETagto poll with.
If step 1 answers 200 and step 4 returns items, you have a working integration. The rest of this page is the walkthrough from docs/INTEGRATION.md, in order.
The first call, with its real answer
With a key in NEWS_KEY, this is the whole loop: prove the path without a key, prove the key, then read one feed and its ETag. Three commands, one screen, no dependency.
# 1. reachability - no key, expect 200 and "status":"ok"
curl -sS https://vg.tempproject.online/v1/health
# 2. your key works, and here are the locales and categories
export NEWS_KEY='cbn_...'
curl -sS https://vg.tempproject.online/v1/meta -H "Authorization: Bearer $NEWS_KEY"
# 3. the first page of items, and the ETag to revalidate with
curl -sS -D /tmp/h.txt -o /tmp/feed.json https://vg.tempproject.online/v1/feed/en \
-H "Authorization: Bearer $NEWS_KEY"
grep -i '^etag:' /tmp/h.txt
# 4. the same poll again: 304, no body, no billable items
curl -sS -o /dev/null -w '%{http_code}\n' https://vg.tempproject.online/v1/feed/en \
-H "Authorization: Bearer $NEWS_KEY" -H "If-None-Match: $(grep -i '^etag:' /tmp/h.txt | cut -d' ' -f2-)"Step 1 is captured below. Steps 2-4 are the documented contract in docs/API.md §3, §4 and §7 - run them against your own key.
curl -sS https://vg.tempproject.online/v1/health{"status":"ok","version":"1.0.0","items":7,"last_run_at":"2026-11-04T21:35:54.830168Z","last_published_at":"2026-11-04T22:03:50.658376Z","reason":null}Source: docs/API.md §12.
Check reachability
Source: docs/INTEGRATION.md §1.
curl -s https://vg.tempproject.online/v1/healthExpected: 200 and
{"status":"ok","version":"1.0.0","items":7,"last_run_at":"2026-11-04T21:35:54.830168Z","last_published_at":"2026-11-04T22:03:50.658376Z","reason":null}/v1/health needs no key. Read status and reason, not just the HTTP code: a degraded pipeline still answers 200 so that uptime probes do not flap.
| Result | Meaning | Next step |
|---|---|---|
| DNS / TLS error | Network or DNS on your side | Check your egress; the domain resolves publicly |
200 with "status":"degraded" | Our pipeline is not publishing; the process is alive | Contact us; do not retry in a tight loop |
503 with "status":"degraded" | Our storage is unavailable | Contact us; do not retry in a tight loop |
Redirect (301/302/307/308) | You are not on the canonical URL | Use https://vg.tempproject.online exactly |
404 on another path | Wrong path | Re-check docs/API.md §2 |
Use GET. HEAD is 405 on every route.
Get a key
Source: docs/INTEGRATION.md §2.
One command issues the key and writes the customer's onboarding note:
cd /root/data/disk/vg-news
NEWS_DB_PATH=/root/data/disk/vg-news/var/news.db \
venv/bin/python backend/scripts/onboard_customer.py create --customer "vg" --plan starterIt prints the key once on stdout. The note (base URL, quota, placeholder key, this guide and the support contact) lands in var/onboarding/vg.md; it never contains the real key. --plan starter implies the documented 45,000-item monthly quota; any other plan needs an explicit --quota N (0 = unlimited). The low-level equivalent, if you only want a key, is scripts/keys.py create --customer "vg" --plan starter --quota 45000.
The key is stored only as a SHA-256 hash; a lost key cannot be recovered, only replaced with
python3 scripts/keys.py list # fingerprints, to identify a key
python3 scripts/keys.py revoke --key cbn_... # revoke a leaked keyDeliver the key over a channel you already trust. Do not put it in a repo, a URL, a screenshot or a log line.
If you lose the key — the recovery path
There is no password on this product, and nothing to reset. Sign-in is a six-digit code mailed to the address provisioned on the account; that one-time code is the recovery mechanism. A customer who has lost every key can therefore still act:
- Open the console at
/consoleand sign in with your email address. You are sent a code; enter it. No key is needed to sign in — the console is a cookie session, not a key session. - The console lists every key on the account by its 16-hex prefix, with its plan, quota and status (
Active,Expired,Revoked). That prefix is the same handle the operator reads offkeys.py list, so you can name the key you lost without ever having kept it. - Ask us to issue a replacement and revoke the lost one, quoting that prefix. This is the one step a customer cannot do alone — issuing and revoking are operator routes on purpose, so a stolen console cookie cannot mint itself a new credential.
- Sign in again and confirm the replacement appears as
Activeand the old one asRevoked.
Three properties of that path are worth knowing, because they are what it relies on:
- Issuing a replacement does not revoke the old key. If you merely lost track of a key that is still in use somewhere, nothing breaks when a spare is issued; only an explicit revoke kills it, and a revoked key is refused
401on the very next request. - Signing in on a second device does not sign out the first. Each sign-in is its own session row; signing out revokes only the row that asked.
- Asking for a code reveals nothing. An address we do not serve answers exactly the same
202 {"status":"sent"}, so the console cannot be used to discover who is a customer. Codes are limited to one per minute and five per hour per address (see, "Send limits"); thedocs/ACCOUNT_API.mdRetry-Afterheader says how long the wait is.
There is deliberately no "change password", "forgot password" or "reset password" route: with no password, each would be a second, weaker way into the same account. If your address changes, ask us to re-provision it (POST /v1/admin/accounts) — the address is the account's key, and re-pointing it is an audited operator action.
Authenticate
Source: docs/INTEGRATION.md §3.
Every route except /v1/health requires:
Authorization: Bearer <key>export NEWS_KEY='cbn_...'
curl -s https://vg.tempproject.online/v1/meta -H "Authorization: Bearer $NEWS_KEY"Expected: 200 and
{
"schema_version": 1,
"api_version": "1.0.0",
"locales": ["en", "zh-Hans"],
"categories": ["markets","macro","commodities","fx","crypto","central_banks","corporate","energy"],
"policy_version": "2026-11-12.1",
"default_locale": "en",
"limits": {"max_page_size": 200}
}Read locales, categories, limits.max_page_size and policy_version from this response. Do not hard-code them; policy can add a locale without a code change on your side. /v1/meta is cacheable for 3600 s and carries an ETag, so poll it rarely and conditionally.
Auth failure modes:
| Status | Body | Meaning |
|---|---|---|
401 | {"detail":"invalid or missing bearer token"} | Missing or wrong key |
401 | {"detail":"this api key has been revoked"} | Key revoked; request a replacement |
429 | object with error: quota_exceeded | Monthly billable-item quota exhausted; see §8 |
503 | {"detail":"..."} | Server misconfiguration, not your key |
Pull the feed
Source: docs/INTEGRATION.md §4.
curl -s "https://vg.tempproject.online/v1/feed/en" -H "Authorization: Bearer $NEWS_KEY"Response envelope:
{
"locale": "en",
"generated_at": "2026-11-04T21:35:54.830168Z",
"disclaimer": "This content is provided for information purposes only. ...",
"items": [
{
"id": "11111111-1111-5111-9111-111111111111",
"schema_version": 1,
"locale": "en",
"title": "Fed holds policy rate as core inflation cools to 2.4%",
"summary": "Officials left the target range unchanged ...",
"body": "The Federal Reserve kept its target range ...",
"bullets": ["Bullet one", "Bullet two"],
"category": "central_banks",
"importance": 0.94,
"published_at": "2026-11-03T18:00:00Z",
"updated_at": "2026-11-03T18:07:00Z",
"source": {"name": "Federal Reserve — Monetary Policy", "url": "https://...", "canonical_url": "https://...", "retrieved_at": "..."},
"claims": [{"text": "...", "source_span": "...", "confidence": 0.92}],
"entities": {"instruments": ["USD"], "countries": ["US"], "organizations": ["Federal Reserve"]},
"market_data": {"symbol": "DXY", "price": 104.12, "change_pct": -0.21, "as_of": "..."},
"compliance": {"status": "clean", "risk_score": 0.0, "reason_codes": ["CLEAN"], "policy_version": "2026-11-12.1"},
"assets": {"title_image_prompt": "...", "title_image_aspect": "16:9", "title_image_url": "/v1/images/img-...", "title_image_ai_generated": true}
}
]
}Field-by-field rendering:
| Field | Type | Render how | |
|---|---|---|---|
id | string | Stable key for your list; use for de-duplication and as a DOM key | |
title | string | Headline | |
summary | string | Standfirst / card body | |
body | string | Article body; markdown-lite. Escape, or sanitise if you render markdown | |
bullets | string[] | Key-point list; may be empty | |
category | string | One of the categories listed by /v1/meta | |
importance | float 0..1 | Sort weight, not a percentage | |
published_at / updated_at | RFC3339 UTC | Display in the reader's timezone | |
source.name / source.url | string | Attribution and the "read the original" link | |
claims | object[] | Optional provenance block; source_span is an exact substring of the source | |
entities | object | Optional tags (instruments, countries, organisations) | |
market_data | object | Show only when symbol is non-null; price: 0.0 means "none attached" | |
compliance.status | clean \ | withheld | withheld must never render — see §5 |
author | string | Fixed byline: By Ember (EN) / Ember 撰稿 (ZH). Render it — it is part of the AI disclosure | |
ai_generated | true | Machine-readable AI flag. Always true for items from this pipeline | |
ai_label | string | The explicit notice to show next to the copy: AI-generated content / 人工智能生成内容 | |
translations | object | {locale: item_id} for the same story. See "Language switch" below | |
assets.title_image_prompt | string | Prompt text for your image generator, if you generate one | |
assets.title_image_url | string, optional | Root-relative path; join with the base URL | |
assets.title_image_ai_generated | true, optional | Present exactly with the URL. The image is model-generated: render a small caption label (China AI-labelling Measures). The bytes also carry IPTC DigitalSourceType metadata |
Disclosure is not optional. author, ai_generated and ai_label are system fields the server writes on every served item; no model generates them and the style gate cannot remove them. China's Measures for Labelling AI-Generated Synthetic Content (in force 2025-09-01) require a clearly perceivable notice on AI-generated text, so a renderer that shows the copy without the byline and ai_label is non-compliant. Show author and ai_label adjacent to the article body, not only in a footer.
Language switch on an open article. translations maps a locale tag to that same story's item id in that locale. The item's own locale is always a key (mapping to its own id); another locale appears only when a clean item exists there, so following one never lands on a 404. Resolve translations[newLocale] and navigate to that id — do not go back to the feed, and do not construct an id. If the target locale is absent, the story has no item in that language yet: stay on the current one and say so.
// The SDKs ship this as twin(item, locale) / item.twin(locale).
const twinId = item.translations?.["zh-Hans"] ?? null;
if (twinId) location.assign(`/article/${twinId}?lang=zh-Hans`);disclaimer (envelope) must be rendered verbatim alongside the items, in the locale of the items. It is not part of each item on feed and list responses.
Where to go next
- Pagination - the cursor walk in curl, Python and TypeScript.
- Caching and ETags - the conditional-poll loop that costs no items.
- Errors - every status the API answers, with its body.
- Webhooks - if you would rather be pushed to than poll.