Docs / FXStreet compatibility
FXStreet compatibility
Drop-in compatibility with FXStreet's news API: their paths, enums, paging, cultures and field names over our published, compliance-gated items. Every divergence is recorded here rather than glossed over.
Migration workbook
News content
Send GET /v4/culture/all to your staging host, then replay a saved post request. Compare the Values envelope, GUIDs and PascalCase fields on the root v4 mount.
Economic calendar
Replay /{culture}/api/v1/eventDates/{from}/{to} with the same dates. Compare the array shape and check that your renderer accepts null consensus fields.
Story images
Resolve each returned Image.Url_* value on the new host. Check the size, content type and a story with a null image.
Token exchange
Point your staging client at POST /v2/token, using the CabinHub credentials issued to your account. Confirm that a fresh token opens your regular news request.
Push connection
Exercise a classic SignalR 2.x negotiation and connect on /signalr. Verify the transport your client uses and the events it consumes.
Webhook receiver
List registrations with GET /v4/Webhooks using your own key. On a staging registration, POST /v4/Webhooks/{id}/test queues a marked event. Acknowledge with HTTP 200 or 204, then inspect GET /v4/Webhooks/{id}/deliveries. Calendar webhook management is a separate interface.
Rollback. Keep the original hosts and credential configuration. Run both clients against a saved request in staging. Restore the original configuration if a required field or event differs.
A presentation layer, not a second API
Same base host plus /fxs, then FXStreet's path verbatim. Same bearer key, same quota, same compliance gate: only compliance_status = 'clean' rows are reachable, by list, by tag, by page and by id.
Recorded divergences
Every place this surface differs from FXStreet, parsed from the taxonomy the document keeps. Nothing here is summarised away: the full text is in the section below.
| # | Divergence | Detail |
|---|---|---|
| 1 | The list envelope beyond Values is not documented | FXStreet's widget reads only |
| 2 | Push hub and news webhook registration | FXStreet pushes post_created / |
| 3 | CLOSED for the pull feed, open for v3 | /{format}/news.aspx?c=&i= is served — |
| 4 | Paging is bounded | take ≤ 200 (the store's MAX_LIST_LIMIT) and |
| 5 | CLOSED — auth is now FXStreet's own shape as well as ours | POST /v2/token |
| 6 | Tags are our taxonomy, not FXStreet's | Theirs are per-instrument GUIDs from their |
| 7 | filter vs filterfull | FXStreet documents three filter depths; we treat |
| 8 | CLOSED on the root mount, still opt-in on /fxs | /v4/... serves GUIDs in |
| 9 | The byline is fixed and not FXStreet's | FXStreet's Author names their editorial staff; |
| 10 | The calendar family is served, with the truth rules intact | /{culture}/api/v1/... |
| 11 | One trailing-slash redirect still differs from upstream: /v2/token/ | It answers a |
| 12 | /v3, webSockets and the calendar /webhooks management paths are not served | All |
Parsed from docs/FXSTREET_COMPAT.md §4 on every build; 12 recorded today.
What is confirmed and what is inferred
| Evidence status | Rows in §1 |
|---|---|
| OTHER | 32 |
Counted from the table in docs/FXSTREET_COMPAT.md §1.
Paths, enums and the field mapping
Source: docs/FXSTREET_COMPAT.md §2 and §3.
Paths (S1, all under https://subscriptions.fxstreet.com):
GET /v4/culture/all
GET /v4/{culture}/post/{id}
GET /v4/{culture}/post/{id}/{bodyType}
GET /v4/{culture}/post/{filterType}/{productFeature} ?page&take&bodyType
GET /v4/{culture}/post/{filterType}/{productFeature}/{tagIds} ?page&take&bodyType
GET /v4/{culture}/post/{filterType}/{productFeature}/{page}/{take}
GET /v4/{culture}/post/{filterType}/{productFeature}/{page}/{take}/{bodyType}
GET /v4/{culture}/post/{filterType}/{productFeature}/{tagIds}/{page}/{take}
GET /v4/{culture}/post/{filterType}/{productFeature}/{tagIds}/{page}/{take}/{bodyType}
GET /v4/{culture}/tag
GET /v4/{culture}/tag/filter/{tagIds}
GET|POST /v4/Webhooks, GET|PUT|DELETE /v4/Webhooks/{id}
POST /v4/{culture}/Webhooks/{productFeature}Enums (S1): filtermini (free), filter (default), filterfull (full body) · BasicHtml, PlainText, FullHtml, Empty, JustifiedText · GeneralFeed, CryptoNewsFeed.
NewsFeed is a fourth accepted name, measured on the live wire 2026-11-12 (anonymous, with the first-party Origin/Referer the API gates on): filter/NewsFeed/0/2 and filter/GeneralFeed/0/2 return byte-identical bodies (same two ids), so it is an alias of the one general feed, not a separate one; filter/AnalysisFeed answers 400, so the list is closed. Both mounts resolve NewsFeed -> GeneralFeed (FEATURE_ALIASES), which is why the body, the ETag and the cache tag are literally GeneralFeed's. docs/fxs/web-trace.md records the same measurement with the page and member-set findings.
Item (PostFullResponse, S1, plus the widget-confirmed names in S8/S9):
{
"Id": "guid", // OpenAPI: id (uuid)
"Title": "…", // title
"Summary": "…", // summary
"HTML": "<p>…</p>", // HTML (body per bodyType; null for Empty/filtermini)
"Url": "/news/…", // url
"FullUrl": "https://…", // fullUrl (widget + SignalR model)
"PublicationDate": "2026-11-05T08:00:00Z", // publicationDate
"VersionDate": "2026-11-05T08:05:00Z", // versionDate — the widget sorts/pushes on it
"Author": {"Id": "guid", "Name": "…"},
"Company": {"Id": "guid", "Name": "…"},
"Image": {"Url_XtraLarge": null, "Url_Large": null, "Url_Medium": null, "Url_Small": null,
"Url_XtraSmall": null, "Url_Nano": null, "Caption": null, "Copyright": null,
"Title": null},
"Tags": [{"Id": "guid", "Name": "EUR/USD"}]
}List envelope: {"Values": [ …items… ]} (S8). Tags: {"Tags": [{"Id","Name"}…]} (S8/S9). Cultures: an array of {"Name": "en-US"} (S5/S12 snippet).
Two mounts of one implementation, plus the surfaces that only have one spelling. The code is backend/app/api/fxs_compat.py::build_router, called twice — once with prefix="/fxs" (profile COMPAT, the legacy mount, byte-compared by clients/openapi.json) and once with prefix="" (profile STRICT, backend/app/api/fxs_root.py). A migrating client uses the root mount, because the strict profile is the one that carries FXStreet's own defaults without being asked.
| Mount | Default id form | Envelope | 401 body |
|---|---|---|---|
/v4/... (root, fxs_root.py) | GUID, 8-4-4-4-12 | exactly {"Values": […]} | empty, WWW-Authenticate: Bearer |
/fxs/v4/... (fxs_compat.router) | 32-hex, ?ids=guid for the GUID | Values + Page/Take/Count/HasMore | {"detail": …} |
The /fxs prefix, then FXStreet's path verbatim. A client that today calls https://subscriptions.fxstreet.com/v4/en-US/post/filterfull/GeneralFeed?page=1&take=20 calls either https://vg.tempproject.online/v4/en-US/post/filterfull/GeneralFeed?page=1&take=20 (root mount, no other edit) or https://vg.tempproject.online/fxs/v4/en-US/post/filterfull/GeneralFeed?page=1&take=20 (legacy mount). The table below is written against /fxs; delete the two characters /fxs and every row is the root mount's path as well.
| Method | Path (ours) | FXStreet counterpart | Notes |
|---|---|---|---|
| GET | /fxs/v4/culture/all | same | {"Values":[{"Name":"en-US"},{"Name":"zh-CN"}]} from the compliance policy's locale list (the root mount wraps them; the bare-array reading is recorded in §5 of docs/fxs/fxs-root.md) |
| GET | /fxs/v4/{culture}/post/{id} | same | one post; 404 for unknown or withheld |
| GET | /fxs/v4/{culture}/post/{id}/{bodyType} | same | Empty → HTML: null |
| GET | /fxs/v4/{culture}/post/{filterType}/{productFeature} | same | page/take/bodyType query, same defaults as FXStreet where known (page=1); take defaults to 20 |
| GET | /fxs/v4/{culture}/post/{filterType}/{productFeature}/{tagIds} | same | tag = one of our categories (by GUID or name); unknown tags are ignored |
| GET | /fxs/v4/{culture}/post/{filterType}/{productFeature}/{page}/{take} | same | |
| GET | /fxs/v4/{culture}/post/{filterType}/{productFeature}/{page}/{take}/{bodyType} | same | |
| GET | /fxs/v4/{culture}/post/{filterType}/{productFeature}/{tagIds}/{page}/{take} | same | |
| GET | /fxs/v4/{culture}/post/{filterType}/{productFeature}/{tagIds}/{page}/{take}/{bodyType} | same | |
| GET | /fxs/v4/{culture}/tag | same | our taxonomy as tags: the categories from /v1/meta |
| GET | /fxs/v4/{culture}/tag/filter/{tagIds} | same | the requested tags that exist here |
The other FXStreet surfaces, each served at FXStreet's own path on our host. None of them needs the /fxs prefix, and each has its own document under docs/fxs/:
| Method | Path (ours) | FXStreet's host | Document |
|---|---|---|---|
| GET, POST | /v4/... (the eleven paths above, without /fxs) | subscriptions.fxstreet.com | docs/fxs/fxs-root.md |
| POST | /v2/token | authorization.fxstreet.com | docs/fxs/fxs-token.md |
| GET | /v2/token/info (ours, new path) | — | docs/fxs/fxs-token.md |
| GET | /.well-known/oauth-authorization-server (ours, RFC 8414) | — | docs/fxs/fxs-token.md |
| GET | /{json,xml,rss}/news.aspx?c=&i= (/json/, /xml/, /rss/ answer their 404) | subscriptions.fxstreet.com | docs/fxs/fxs-legacy.md |
| GET | /{culture}/api/v1/eventDates/{from}/{to}, /events, /events/{id}, /categories | calendar-api.fxstreet.com | docs/fxs/fxs-calendar.md |
| GET, POST, PUT, OPTIONS | /signalr and /signalr/* (negotiate, connect, start, send, poll, abort, ping, hubs) | httppush.fxstreet.com | docs/fxs/fxs-push.md |
| GET | /v1/stream?locale= (ours, plain server-sent events) | — | docs/fxs/fxs-push.md |
| GET, HEAD | /fxs/v1/images/{slot}/{key} (the six Image.Url_* slots) | their CDN | docs/fxs/fxs-images.md |
docs/fxs/MIGRATION.md is the guide a migrating developer reads; it names every path in the tables above and is checked against them on every build (backend/tests/test_fxs_migration_guide.py).
Additive, ours-only (never required by an FXStreet client):
?category=on a post list — the precise category filter (FXStreet has only tags).?since=/?until=(RFC3339, bareYYYY-MM-DDcovers the whole day; both bounds inclusive) — FXStreet's v4 has no date range; this closes the "date range" gap without inventing a new path. They work on every list shape (short form,{page}/{take},{tagIds},{tagIds}/{page}/ {take}); a value that is not a timestamp is a400naming the bound, andsince > untilis a400rather than a silently empty page.?casing=pascal|camel— see §5.?ids=plain|guid— see "Item ids" below.- Envelope members
Page,Take,Count,HasMorebesideValues(opt-in on the root mount). - Item members
FullUrl,CreationDate,ModificationDate,Language,Culture,FeedId,ContentTypeId,Category,Importance,AiGenerated,AiLabel,Source, and the paging headersX-Page,X-Take,X-Count,X-Has-More,X-Total-Count. - Every surface takes the same switch:
X-Cabinhub-Extended: 1or?extended=1;?extended=0forces the compact form back on either mount.
News webhook registration is served at POST /v4/Webhooks and POST /fxs/v4/Webhooks. The calendar management interface is separate.
Field-by-field mapping (ours → FXStreet)
| FXStreet | Ours | Rule |
|---|---|---|
Id | id | 32-hex string on /fxs/v4 by default; a GUID (8-4-4-4-12) on the root /v4 mount, and on /fxs/v4 with ?ids=guid — see "Item ids" |
Title | title | unchanged |
Summary | summary | unchanged |
HTML | body, rendered per bodyType | Empty→null; PlainText→verbatim; BasicHtml/FullHtml→escaped <p> paragraphs (single newline→<br/>); JustifiedText→same with style="text-align:justify"; filtermini→null |
Url | derived | /#/item/{id} on the legacy /fxs/v4 mount (published, byte-compared). The STRICT /v4 mount serves the wire's ABSOLUTE form on OUR host: {NEWS_PUBLIC_BASE_URL}/share/{id} — the crawlable per-story page (app/api/seo.py::story_url), never fxstreet.com |
FullUrl | derived | {NEWS_PUBLIC_BASE_URL}/#/item/{id} (default https://vg.tempproject.online) |
PublicationDate | published_at | verbatim RFC3339 UTC |
VersionDate | updated_at (else published_at) | verbatim; the widget sorts on it, and it is our revision stamp |
CreationDate / ModificationDate | published_at / updated_at | FXStreet's SignalR names; additive |
Author.Id / .Name | author | deterministic GUID + the item's own byline, which is models.AUTHOR_BY_LOCALE: "By Ember" (en) / "Ember 撰稿" (zh-Hans). A legacy row with no stored byline is served the same value by store.attach_disclosure |
Company.Id / .Name | source.name | inferred mapping: FXStreet's Company is the broker/company; our closest stable organisation is the news source (e.g. "Federal Reserve") |
Image.* (six sizes, caption, copyright, title) | assets.title_image_url when a generated image exists | six DIFFERENT pictures at FXStreet's measured widths (docs/fxs/fxs-images.md); all six null when we have no image; {NEWS_PUBLIC_BASE_URL}/fxs/v1/images/{slot}/{key} |
Tags[] | category + entities.instruments | GUID = UUIDv5 of the name, so ids are stable across restarts and identical for an en/zh twin; names are the category (markets, fx, …) and the instruments (USD, EUR/USD) |
Language | derived | {"Id": UUIDv5(culture), "Name": culture} |
Culture | derived | the canonical culture for the served locale |
FeedId | constant | UUIDv5 of generalfeed |
ContentTypeId | constant 0 | FXStreet's type discriminator; we have one type |
AiGenerated, AiLabel | ai_generated, ai_label | ours, additive; the machine-readable half of the AI disclosure — true and "AI-generated content" ("人工智能生成内容" for zh*). Filled for legacy rows by store.attach_disclosure, never omitted |
Category, Importance, Source | ours | additive |
Culture mapping. en → en-US, zh-Hans → zh-CN, zh-Hant → zh-CHT (we have no zh-Hant rows today, so zh-CHT answers an empty page rather than an error). Accepted inbound spellings: any FXStreet culture that maps to a locale we serve, plus our own locale tags (en, zh-Hans) verbatim. An unknown culture is a 404 naming the cultures we do serve (FXStreet has 20; we serve the two the compliance policy publishes — a third locale is a policy change, not a compat change).
On the STRICT /v4 mount it is 403 with a 0-byte body, which is what the wire answers (re-measured 2026-11-12 on post-api.fxstreet.com: /v4/xx-ZZ/post/filter/GeneralFeed/0/2 and /v4/xx-ZZ/tag → 403, size_download 0, no content-type). The named 404 above stays the legacy /fxs/v4 contract, which docs/API.md publishes and tests/test_live_contract_check.py byte-compares.
Auth, metering, limits, compliance — all inherited:
require_client: DB bearer key →billingidentity, per-key rate limiter (NEWS_RATE_LIMIT_PER_MINUTE), monthly billable-item quota →429; unconfigured deployment → dev mode, the same as/v1; wrong/missing bearer →401+WWW-Authenticate: Bearer(FXStreet answers an empty body; ours carries{"detail": …}— a superset that every client ignores).- Metering: one request plus the delivered items, recorded as
/fxs/v4/postsand/fxs/v4/post, through the sameUsageMeterand flush timer. - Compliance: list reads are
store.list_items(compliance_status = 'clean'), detail reads arestore.get_item(withheld rows invisible), and every serialised post is re-checked forcompliance.status == "clean"before it is written — a withheld story is unreachable by id, by tag, by page and by culture. - Caching: every GET answers a conditional request. Responses are
private(neverpublic: the body is served to one credential) withVary: Accept-Encoding, Authorization, and carry a strong, body-derivedETag:max-age=30on lists,60on a single post,3600onculture/alland thetagroutes.If-None-Matchwith the current tag is a header-only304with the sameETag/Cache-Control/Varyand no body; the body is byte-identical to the200whenever the tag matches. The tag is nevermax(updated_at)or a row count, so an in-place edit with unchanged timestamps is still a new tag and a200. A304meters the same delivered items its200would (the meter counts unique item ids per month). A client that never sends validators behaves exactly as it does against FXStreet.
Item ids
Our ids are hashlib.sha256(source + url + published_at + locale).hexdigest()[:32]: 32 lowercase hex characters, not a GUID. FXStreet's Id is a GUID, and a client that validates the syntax (Guid.Parse, uuid.UUID, a [Guid] model binding) refuses ours before it ever asks us for anything.
?ids=guid on any list route or on /post/{id} serves the same 32 hex formatted 8-4-4-4-12 (lowercase). It is a presentation of the identical value: no new field is stored, nothing is rewritten, and stripping the hyphens recovers the stored id exactly. The root /v4 mount (FXStreet's own paths, docs/fxs/fxs-root.md) makes the GUID the DEFAULT, because that is the shape a client written against FXStreet binds; the legacy /fxs/v4 mount keeps the stored 32 hex so an existing client of ours sees no change. ?ids=plain asks for the stored form on either mount.
/fxs/v4/{culture}/post/{id} accepts both forms: the path id is looked up as sent, and if that finds nothing and the id is a syntactically valid GUID whose hyphens-stripped form is 32 hex, the stripped form is tried too. A client may therefore mix forms — list with ?ids=guid, then build the detail URL from the plain id, or the reverse.
Url and FullUrl always carry the stored id, because they point at our own newsroom route (/#/item/{id}), which takes the stored form; only Id changes under ?ids=guid. A withheld item is 404 under either form.
The PascalCase / camelCase ambiguity
Two confirmed sources disagree on spelling:
- the live API's real payload, as read by FXStreet's own widget:
Id,Title,VersionDate,Url_XtraSmall(S8, S9 — mustache renders{{Id}}from the response object, so the JSON key is literallyId); - the OpenAPI document, which spells the same properties
id,title,versionDate,url_XtraSmall(S1).
The widget wins for "what a client written against the live API sees", so the default here is PascalCase. A client generated from the OpenAPI document instead can ask for that spelling with ?casing=camel, which renames the same values to the OpenAPI names (including the nested author/company/image/tags keys). The rename table is in fxs_compat.py (_CAMEL_TOP, _CAMEL_NESTED); flipping the default is one constant, not a rewrite.
How to verify this surface
Offline, on a compute box (nothing runs on the Mac; tools/vps_test.sh ships the tree and runs it there):
CBN_BOXES="tx-nj1 tx-nj2 tx-nj3 tx-nj4 tx-nj5" \
bash tools/vps_test.sh auto -m "not network" -q -p no:cacheprovider \
tests/test_fxs_compat.py tests/test_fxs_root.py tests/test_caddy_routes.py \
tests/test_fxs_migration_guide.pyLive, read-only, without a credential — the guide's own probe, which the suite exercises in both directions before it is trusted:
./tools/fxs_migration_probe.sh https://vg.tempproject.onlineThe guide itself (docs/fxs/MIGRATION.md and its Chinese twin) is covered by backend/tests/test_fxs_migration_guide.py: every path it names must be routed to the app by deploy/vg-news.caddy AND mounted by create_production_app(), both guides must name the same path set, and the probe must PASS a stub that answers correctly and FAIL one that does not.
The suite pins the documented property set against a served response (FXSTREET_POST_KEYS/FXSTREET_IMAGE_KEYS in backend/tests/test_fxs_compat.py), the Values/Tags envelopes, page/take behaviour including past-the-end and the window guard, culture selection (including zh-CHT empty and unknown 404), category via tag path, query and CryptoNewsFeed, 401 with WWW-Authenticate: Bearer under a configured key table, the same routes staying open in dev mode, and that a withheld item is reachable by neither list nor id.
Added 2026-11-05, all in the same file:
- the widget/template path walk and the template render against the saved FXStreet artefacts;
- the OpenAPI property set parsed from the saved swagger, asserted on
?casing=camel; - the widget's own endpoint template, run with every
FilterEndpointMapvalue and both product features; since/untilon all five list shapes (bareYYYY-MM-DD, RFC3339, a bad value →400, an empty value = no bound,since > until→400);?ids=guidon list and detail, both id forms in the path, an upper-case GUID not matching, a badidsvalue →400, and a withheld item404by either form;- the byline and AI disclosure on every served post in both cultures, including a legacy row inserted with no
author/ai_generated/ai_labelin its payload.
The reference is a real capture, not a transcription. FXStreet's own artefacts are saved under backend/tests/fixtures/fxstreet/ (source URL and fetch date in PROVENANCE.json, whose hashes are checked against the saved bytes on every run):
| File | Source | Used for |
|---|---|---|
news.js | staticcontent.fxsstatic.com/widgets/news/js/news.js | the endpoint template and FilterEndpointMap; every data.*, news.*/post.* and tag.* path the widget reads |
news_items.html | .../widgets/news/mustache/news_items.html | the template variables, and a render of the real template against our response |
swagger_v4.json | subscriptions.fxstreet.com/swagger/v4/swagger.json | PostFullResponse/AuthorResponse/CompanyResponse/ImageResponse/TagResponse property names, parsed (never hand-copied) and asserted against ?casing=camel |
The tests derive the property list from those files at run time. The template is rendered by a small mustache-subset renderer inside the test (no template engine is installed in the test venv): it implements sections, inverted sections, dotted names, escaped and raw variables, and mustache's parent-context lookup. A null is legal only where the template itself guards the value ({{#Image.Url_XtraSmall}}…{{/Image.Url_XtraSmall}}); every other read must be present and non-empty, and the rendered HTML may not contain an empty data-item-id, href or src.
What no fixture can settle is which FXStreet version and id casing the VG app actually sends: the artefacts prove what their widget and schema say, not what VG's code calls. ?casing= and ?ids= cover both plausible answers; the default is the widget's spelling, because the widget is the only party observed reading a live response. A real VG capture (one response and the URL that produced it) would settle it in one step; until then this surface answers both.