Skip to Content

News

Scored headlines for Loaf’s listed real assets: property, data centres, refineries, fabs, grids, hotels. No API key required.

News serviceLoaf API
RESThttps://news.loafmarkets.com/v1/headlineshttps://api.loafmarkets.com
WebSocketwss://news.loafmarkets.com/v1/ws/headlineswss://api.loafmarkets.com/ws
AuthNoneOrder signature on order placement. Login token or Privy JWT on cancels, history, and the portfolio summary and component. See Authentication for the full list.

Use requests (or axios) plus a WebSocket client. See Showing headlines for the seed-then-listen loop.

Note. Headlines live about 7 days. After that, GET /v1/headlines/:id is 404 and a WebSocket last_seen_id replay returns cursor_expired. Re-seed from REST.

Showing headlines

Seed once, then keep a single socket open.

  1. GET /v1/headlines to fill your list.
  2. Open wss://news.loafmarkets.com/v1/ws/headlines, send subscribe, prepend each article frame.

To show a headline, read these fields from each row:

DisplayFeed field
Id, link, breaking flagid, url, breaking
Headlinetitle_rewritten
Timepublished_at
Sourcesource_name
Summaryexcerpt (fallback summary)
Sentimentsentiment_score (−1…1, always the story’s own reading; it does not decay with age)
Impactimpact_score (0–10)
Impact reasonimpact_rationale
Tickerstickers: symbols the story mentions, mostly external (NVDA, TSM)
Typefeed_type: "property" or "market"
Loaf assetsassets: the listed Loaf assets the story graded to, when available

tickers lists the symbols a story mentions, mostly external ones (NVDA, TSM). Use assets, not tickers, to identify a listed Loaf asset. assets is { ticker, tokenName, name, imageUrl }. Here tokenName is the asset’s token on GET /v1/assets, such as yongin, not the Loaf API’s tokenName. General-feed WebSocket rows, live or replayed, carry no assets. Read them from GET /v1/headlines/:id once the story is graded.

feed_type is the story’s primary type (higher of property_score / market_score; category breaks a tie). feed_types is the full list: a story that scores high on both axes has both types. GET /v1/headlines?feed_type= filters on that array, so a dual story is returned for either type, once per response.

Ask once vs listen

Same rule as the rest of the API:

  • Ask once. GET /v1/headlines and GET /v1/headlines/:id return the current page.
  • Listen. WebSocket article frames are new rows, and rows replayed from last_seen_id.

Do not poll REST in a loop. Seed, then subscribe. Pass last_seen_id so a dropped socket can catch up.

Article object

Every headline row, REST or WebSocket, is this shape:

type FeedType = 'property' | 'market'; type Category = | 'market_news' | 'property_update' | 'policy' | 'economic' | 'geopolitical' | 'sale_transaction' | 'energy' | 'infrastructure' | 'other'; interface Article { id: string; source_id: string; source_name: string; url: string; title_original: string; title_rewritten: string; excerpt?: string; summary?: string; published_at: string; // ISO-8601 suburbs: { name: string; region?: 'central' | 'eastern' | 'north' | 'western' }[]; foreign_locations: string[]; /** Symbols the story mentions, mostly external market symbols. Use `assets` for Loaf assets. */ tickers: string[]; category: Category; sentiment: 'positive' | 'negative' | 'neutral'; /** Net direction (−1…1): asset leg mixed with market leg. */ sentiment_score?: number; /** Asset-specific direction, before the market is mixed in. */ property_sentiment: number; /** Direction for the asset’s market / class. */ market_sentiment: number; impact_score: number; // 0–10, derived from the two axes property_score: number; // 0–10 market_score: number; // 0–10 asset_types: string[]; impact_rationale: string; tags: string[]; breaking: boolean; feed_type: FeedType; feed_types: FeedType[]; last_updated_at?: string; update_count: number; also_reported_by: string[]; /** Present only when per-asset grading is available and this story graded to listed assets. */ assets?: { ticker: string; tokenName: string; name: string; imageUrl: string | null }[]; }

property_score is how much the story reprices a tagged asset; market_score is how much it moves the class. A leaky roof is high property / low market. An RBA cut is the reverse. sentiment_score can disagree with property_sentiment on one asset, for example good news for the asset in a sold-off market.

Duplicate coverage of the same story collapses onto the first entry (update_count, also_reported_by, last_updated_at). published_at on that entry is when the story broke.

Endpoints

MethodPathDescription
GET/v1/headlinesPaginated feed
GET/v1/headlines/:idSingle article
GET/v1/assetsListed assets the news service tracks (when available)
GET/v1/assets/:token/headlinesThat asset’s news (when available)
GET/v1/articles/:id/assetsWhich assets one story graded to (when available)
GET/v1/sentimentImpact-weighted sentiment for a scope + window
GET/v1/pricesLive instrument quotes (when available)

Error body:

{ "error": { "code": "INVALID_QUERY", "message": "...", "details": [] } }

Warning. When per-asset grading or the price feed is unavailable, GET /v1/assets, /v1/assets/:token/headlines, /v1/articles/:id/assets, and /v1/prices return 503 with ASSET_GRADING_DISABLED or PRICE_FEED_DISABLED. An empty feed is a 200 with no rows.

List responses are cached briefly. Price responses are not cached.


List headlines

GET /v1/headlines

Each page holds the highest-impact recent stories, listed newest first. Older stories are weighted down when a page is chosen. The impact_score on each row does not decay with age. A publisher cap keeps one outlet from filling the page.

Request

TypeScript

import axios from 'axios'; const response = await axios.get('https://news.loafmarkets.com/v1/headlines', { params: { limit: 20, min_impact: 5, feed_type: 'property' }, }); const { headlines, next_cursor } = response.data;

Python

import requests r = requests.get( "https://news.loafmarkets.com/v1/headlines", params={"limit": 20, "min_impact": 5, "feed_type": "property"}, ) r.raise_for_status() payload = r.json() headlines, next_cursor = payload["headlines"], payload["next_cursor"]

curl

curl -s 'https://news.loafmarkets.com/v1/headlines?limit=20&min_impact=5&feed_type=property'

Parameters

ParameterTypeRequiredDescription
feed_typeproperty | marketNoMatches feed_types, so a dual story is returned for either value.
categoryCategoryNoOne of the nine category values.
min_impactint 0–10NoDrop rows below this impact_score.
sinceISO-8601NoOnly articles published at or after this timestamp.
suburbstringNoSingle suburb name.
suburbsCSV stringNoSeveral suburbs, comma-separated.
regioncentral | eastern | north | westernNoSydney region.
limitint 1–200NoPage size. Default 50.
cursorstringNoOpaque cursor from the previous next_cursor.

Response

interface HeadlinesResponse { headlines: Article[]; next_cursor: string | null; server_time: string; }

Walk pages with next_cursor until it is null. Each page is chosen from a larger block of recent stories. next_cursor moves past the whole block, so stories a page leaves out do not appear on a later page. Walking every page does not return every headline. To catch up from a headline you hold, use the WebSocket last_seen_id replay.

Example row:

{ "id": "a-8f3c21", "title_rewritten": "China halts gallium exports", "source_name": "DigiTimes", "url": "https://example.com/gallium", "published_at": "2026-08-25T04:12:00.000Z", "excerpt": "Export controls tighten on a key semiconductor input.", "category": "geopolitical", "sentiment": "negative", "sentiment_score": -0.62, "property_sentiment": -0.7, "market_sentiment": -0.4, "impact_score": 8, "property_score": 4, "market_score": 8, "feed_type": "market", "feed_types": ["market"], "tickers": ["NVDA"], "breaking": true, "assets": [ { "ticker": "YONG", "tokenName": "yongin", "name": "Yongin", "imageUrl": "https://…/banner.webp" } ] }

assets is omitted when per-asset grading is unavailable, or when the story graded to no listed asset.


Get one article

GET /v1/headlines/:id

Same Article as a list row, including assets when available. 404 NOT_FOUND if the id expired, was removed from the feed, or never existed.

TypeScript

const { data } = await axios.get('https://news.loafmarkets.com/v1/headlines/a-8f3c21');

curl

curl -s 'https://news.loafmarkets.com/v1/headlines/a-8f3c21'

Per-asset headlines

When per-asset grading is unavailable, GET /v1/assets, GET /v1/assets/:token/headlines, and GET /v1/articles/:id/assets return 503 ASSET_GRADING_DISABLED.

Each article is scored per listed asset. The same story can be negative for a fab and noise for a hotel. Each row in an asset feed carries the grade for that article and that asset in its asset block.

GET /v1/assets returns the listed assets the news service tracks. profiled is false for an asset the news service does not grade. Check it when an asset feed is empty.

Field
token
ticker
name
type
country
profiled
synced_at

GET /v1/assets/:token/headlines returns that asset’s news. :token accepts the ticker or the asset’s token from GET /v1/assets (for example YONG or yongin).

Request

TypeScript

const { data } = await axios.get( 'https://news.loafmarkets.com/v1/assets/opera/headlines', { params: { min_property_score: 7, limit: 20 } }, );

Python

r = requests.get( "https://news.loafmarkets.com/v1/assets/opera/headlines", params={"min_property_score": 7, "limit": 20}, ) r.raise_for_status() for row in r.json()["headlines"]: print(row["asset"]["headline_for_asset"], row["asset"]["property_score"])

curl

curl -s 'https://news.loafmarkets.com/v1/assets/opera/headlines?min_property_score=7&limit=20'

Parameters

ParameterTypeRequiredDescription
min_property_scoreint 0–10NoFloor on this asset’s property_score. Default 6. A value below 6 returns the same rows as 6.
sinceISO-8601NoInclusive lower bound on published_at.
beforeISO-8601NoExclusive upper bound.
limitint 1–200NoDefault 50.
cursorstringNoFrom the previous next_cursor.

404 NOT_FOUND if :token is not a listed asset.

Extra asset block on each row

interface AssetHeadlineRow extends Article { asset: { ticker: string; token: string; property_score: number; property_sentiment: number; // this asset’s direction sentiment_score: number; // netted against the article’s market leg relation: 'same_asset' | 'operator' | 'commodity' | 'demand' | 'same_city' | 'same_country' | 'sector'; why: string; headline_for_asset: string; breaking_for_asset: boolean; }; }

relation is the strongest link between the story and the asset that the article text supports. The values run from strongest (same_asset) to weakest (sector).

GET /v1/articles/:id/assets returns the same grades for one story, highest property_score first. List rows already carry assets when the story graded to a listed asset, so you do not need one request per row.


WebSocket

wss://news.loafmarkets.com/v1/ws/headlines

One connection. Send JSON client messages; handle server frames by type. Heartbeat every 30s. The server also sends protocol pings, which standard WebSocket clients answer automatically. If your client stops answering them, the server closes the socket with 1011.

Subscribe to headlines

{ "type": "subscribe", "filters": { "min_impact": 5 }, "last_seen_id": "a-8f3c21" }

filters (all optional):

FieldMeaning
suburbsstring[]
regioncentral | eastern | north | western
categoriesstring[] of category values
min_impactint 0–10
tokenLoaf asset ticker, for example YONG. Articles graded to that asset, delivered after grading. Omit this for the general feed. With token, only min_property_score applies. suburbs, region, categories, and min_impact are ignored.
min_property_scoreint 0–10, used with token. Leaving it out, or a value below 6, gives the same frames as 6.

Filtering on feed_type is REST-only. On the socket, use categories, min_impact, or token.

When per-asset grading is unavailable, a subscribe with token is still acknowledged with subscribed, but no live article frames arrive for it. Before you subscribe with token, check that GET /v1/assets/:token/headlines returns 200 for the same ticker. The socket token matches the ticker only, not the tokenName.

last_seen_id triggers a replay of what you missed. Replay frames are ordinary article messages (dedupe on id), then replay_complete.

TypeScript

const ws = new WebSocket('wss://news.loafmarkets.com/v1/ws/headlines'); let lastSeenId: string | undefined; ws.onopen = () => { ws.send(JSON.stringify({ type: 'subscribe', filters: { min_impact: 5 }, last_seen_id: lastSeenId, })); }; ws.onmessage = (event) => { const msg = JSON.parse(String(event.data)); if (msg.type === 'article') { lastSeenId = msg.article.id; // handle msg.article } else if (msg.type === 'replay_complete' && (msg.truncated || msg.reason === 'cursor_expired')) { // replay gap: GET /v1/headlines again } }; ws.onclose = () => setTimeout(() => { /* reconnect with lastSeenId */ }, 3000);

Python

import json from websocket import WebSocketApp # pip install websocket-client NEWS_WS = "wss://news.loafmarkets.com/v1/ws/headlines" last_seen_id = headlines[0]["id"] if headlines else None seen = {h["id"] for h in headlines} def on_open(ws): ws.send(json.dumps({ "type": "subscribe", "filters": {"min_impact": 5}, "last_seen_id": last_seen_id, })) def on_message(ws, raw): msg = json.loads(raw) if msg.get("type") == "article": article = msg["article"] if article["id"] in seen: return seen.add(article["id"]) print(article["title_rewritten"], article.get("sentiment_score"), article.get("impact_score")) elif msg.get("type") == "replay_complete" and ( msg.get("truncated") or msg.get("reason") == "cursor_expired" ): pass # re-seed GET /v1/headlines ws = WebSocketApp(NEWS_WS, on_open=on_open, on_message=on_message) ws.run_forever()

Server frames

typeWhen
heartbeatEvery 30s while subscribed (server_time)
subscribedAfter a valid subscribe
article{ article: Article }, live or replayed. On the general feed it carries no assets. Per-asset subscribers also get assets and the asset block, without token.
story_updatedLater coverage collapsed onto a row. story_id (that row’s id), reported_by_count (outlets that ran the story), last_updated_at
article_updatedA row changed in place. article (the new row, without assets or asset), changed (names of some of the fields that changed). sentiment, feed_type, feed_types, breaking, and tags can change without being named. Copy every field of article onto your row
article_removedA row left the feed. Drop it. id, reason (free text), optional merged_into (the id of the row that absorbed it)
article_restoredA removed row is back in the feed. id. GET /v1/headlines/:id returns it again
replay_completeEnd of backfill. count, optional truncated, optional reason: cursor_expired | error
error{ code, message }
sentiment_subscribed / sentiment_updateAfter subscribe_sentiment
prices_subscribed / price_updateAfter subscribe_prices

story_updated, article_updated, article_removed, and article_restored go to every headline subscriber, whatever its filters. They can name rows you do not hold. A last_seen_id replay also sends article_removed frames, before replay_complete.

If replay_complete.truncated is true, the replay stopped before the newest headlines. Re-seed from REST. reason: "cursor_expired" means last_seen_id aged out of the 7-day window.

Optional: sentiment and prices on the same socket

{ "type": "subscribe_sentiment", "scopes": [{ "type": "global" }] }
{ "type": "subscribe_prices", "instrument_ids": ["BRENT", "US10Y", "TSLA"] }

instrument_ids are price-feed ids (BRENT, US10Y). They are separate from article.tickers and from Loaf tickers. If the price feed is unavailable, the server replies error / PRICE_FEED_DISABLED and does not ack. After prices_subscribed, the server sends a snapshot price_update for the requested instruments that already have a price (the feed only pushes on change). If none of them has a price yet, no snapshot is sent. Ids the feed does not know get an error frame with code UNKNOWN_INSTRUMENTS, whose message lists them. The known ids are still subscribed.

REST equivalents: GET /v1/sentiment?scope=global&window=24h (window: 1h | 6h | 24h | 7d; suburb/region need name) and GET /v1/prices?ids=BRENT,US10Y. Prices return 503 PRICE_FEED_DISABLED when the price feed is unavailable, or PRICES_UNAVAILABLE when it has no prices yet.

A headlines client uses the REST feed plus subscribe. Sentiment and prices are separate subscriptions.

Last updated on