9fin 1.2 News: choosing what arrives
APIs used in this notebook
| API | Version | Endpoints |
|---|---|---|
| News & Content v2 | 0.3.41 | GET /v2/news/headlines |
| Developer portal (OpenAPI) | n/a | GET /api/v3/apis, /versions, /versions/{id} |
/v2/news/headlines is how you turn 12,000 articles a year into the handful your desk cares about. The filters do that selecting, and the tags are the part that needs explaining.
Two families of tag
Every article carries one or more content tags, and they come in two kinds.
Proprietary tags start with 9fin- and describe our own journalism: what desk wrote it and what kind of piece it is. There are 50 of them, read from our published API spec further down rather than hardcoded.
Document type tags sit on third party content and describe what the document is rather than
what it says: Results, Regulatory Filing, Ratings, Press Release. There are 14.
The split matters because the volumes are nothing alike. In a representative month we published 1,050 articles of our own against 20,815 third party documents, so source_type is as important a filter as the tags themselves.
Tags also sit inside verticals, which is the coarser grouping: Core Credit, Distressed, ABF, Private Credit, Structured Credit, ESG, Investment Grade. A tag tells you its vertical, so choosing a vertical means taking its tags.
%run "9fin 0.1 Authentication - getting a token.ipynb"
import collections, json, requests
import pandas as pd
pd.set_option("display.max_colwidth", 120)
What you can filter on
Read the filters from the source. Our developer portal serves each API's OpenAPI document over a JSON API, so the filters, their accepted values and their limits are all available programmatically. None of it counts against your API budget, because the portal is not the API.
PORTAL = "https://console.9fin.com/api/v3"
def news_spec():
"""The OpenAPI document 9fin publishes for the News API."""
api = next(a for a in requests.get(f"{PORTAL}/apis", timeout=60).json()["data"]
if "News & Content" in a["name"])
versions = requests.get(f"{PORTAL}/apis/{api['id']}/versions", timeout=60).json()["data"]
latest = max(versions, key=lambda v: v["version"])
detail = requests.get(f"{PORTAL}/apis/{api['id']}/versions/{latest['id']}", timeout=60).json()
return json.loads(detail["spec"]["content"])
spec = news_spec()
FILTERS = {p["name"]: p for p in spec["paths"]["/v2/news/headlines"]["get"]["parameters"]}
spec["info"]["title"], spec["info"]["version"], len(FILTERS)
Sample output, captured October 2026. Static snapshot, not live data.
('9fin News & Content API - v2', '0.3.41', 10)
def spec_options(parameter):
"""The values the spec allows for a parameter, or None where it is not a closed list."""
schema = FILTERS[parameter]["schema"]
for alternative in schema.get("anyOf", [schema]):
listed = alternative.get("items", alternative)
if "enum" in listed:
return listed["enum"]
Every filter the endpoint takes, and how many values each one accepts:
pd.DataFrame([{"filter": name,
"values": len(allowed) if (allowed := spec_options(name)) else "open",
"takes": (p.get("description") or "").split(". ")[0][:62]}
for name, p in FILTERS.items()])
Sample output, captured October 2026. Static snapshot, not live data.
| filter | values | takes |
|---|---|---|
| cursor | open | Opaque pagination cursor from a previous response's `next_curs |
| limit | open | Maximum number of headlines to return per page |
| content_tags__in | 64 | Comma-separated list of content tags to OR-filter on (maximum |
| source_type | 3 | Filter by one of the following 9fin, third-party, all |
| nf_ids__in | open | Comma-separated list of 9fin entity IDs to OR-filter on (maxim |
| entity_country_code | 249 | Filter by the country code of the main entity, as a two-letter |
| industries__in | 44 | Comma-separated list of industries to OR-filter on (maximum 5) |
| region | 7 | Filter by the coverage region (case-insensitive). |
| since | open | Only return headlines published at or after this instant |
| until | open | Only return headlines published at or before this instant |
Five of them are closed lists.
The endpoint is strict about mistakes, in a useful way. Both the parameter name and its value are validated. A name that is not a parameter (tags, industry, vertical, or anything else plausible but wrong) returns a 422 naming the key it did not recognise. A real name carrying an unrecognised value fails the same way, naming the value. So a guessed filter fails immediately instead of quietly returning everything.
A first call, with no filters at all:
api_get("/v2/news/headlines", limit=1)["items"][0]
That is a headline: the metadata and the entities, but no body. Fetching the body is one call per article, which notebook 1.1 covers.
The rules of the tag filter
Four rules, each demonstrated below by the rejection it produces. The endpoint validates both the parameter name and its values, so a filter either works or tells you why.
Rejections come from two layers and arrive in two shapes: our own domain checks use message, the schema level ones use detail. One helper reads whichever is present.
def why(error):
"""The reason a 9fin call was rejected, whichever shape the error used."""
body = error.response.json()
if "message" in body:
return body["message"]
first = body["detail"][0]
return f'{first["loc"][-1]}: {first["msg"]}'
api_get("/v2/news/headlines", content_tags__in="9fin-Primary,9fin-Distressed", limit=3)["items"][0]["title"]
Sample output, captured October 2026. Static snapshot, not live data.
'Hengs Technology closes TWD 1.05bn loan (9fin)'
Tag names are matched exactly, and a typo is rejected rather than ignored:
try:
api_get("/v2/news/headlines", content_tags__in="9fin-primary", limit=1)
except Exception as error:
print(why(error))
Sample output, captured October 2026. Static snapshot, not live data.
invalid content_tags: ['9fin-primary']
And five is the ceiling:
try:
api_get("/v2/news/headlines", limit=1,
content_tags__in="9fin-Primary,9fin-Distressed,9fin-CLO,9fin-ABS,9fin-ESG,9fin-Editorial")
except Exception as error:
print(why(error))
Sample output, captured October 2026. Static snapshot, not live data.
content_tags__in: List should have at most 5 items after validation, not 6
A parameter name the endpoint does not have is rejected the same way, naming the key. So the filter surface is safe to explore: a guess fails loudly rather than returning an unfiltered feed that looks filtered.
try:
api_get("/v2/news/headlines", industry="Banks", limit=1)
except Exception as error:
print(why(error))
Sample output, captured October 2026. Static snapshot, not live data.
industry: Extra inputs are not permitted
The tag vocabulary, from the spec
The complete list of content tags is an enum on the content_tags__in parameter, so the spec
loaded at the top already has it. Nothing pasted in to go stale, and no sampling, which only ever shows the tags used in the window you looked at.
TAGS = spec_options("content_tags__in")
PROPRIETARY = [t for t in TAGS if t.startswith("9fin-")]
len(TAGS), len(PROPRIETARY), len(TAGS) - len(PROPRIETARY)
Sample output, captured October 2026. Static snapshot, not live data.
(64, 50, 14)
That is the whole vocabulary. A format launched next quarter appears here the first time we document it.
What the spec cannot tell you is which of those tags carry any volume. For that, walk a month of our own output and count.
def walk_headlines(**filters):
"""Every headline matching a filter, following the cursor."""
out, cursor = [], None
while True:
page = api_get("/v2/news/headlines", **filters, limit=200,
**({"cursor": cursor} if cursor else {}))
out += page["items"]
cursor = page.get("next_cursor")
if not cursor:
return out
month = walk_headlines(source_type="9fin", since="2026-08-01", until="2026-09-01")
len(month)
Sample output, captured October 2026. Static snapshot, not live data.
1051
Now put the two together: every documented proprietary tag, and what it actually carried.
counts = collections.Counter(t["tag_name"] for a in month for t in a["content_tags"])
vertical = {t["tag_name"]: t["vertical_name"] for a in month for t in a["content_tags"]}
pd.DataFrame([{"tag": t, "vertical": vertical.get(t, "—"), "articles": counts.get(t, 0)}
for t in sorted(PROPRIETARY, key=lambda t: -counts.get(t, 0))])
The shape is a long tail. Three tags (Distressed, Primary, Secondary) carried 941 of the 1,846 tag applications that month, about half. The recurring columns appear a few times each, eight formats ran exactly once, and a further eight sit at zero: the quarterly and occasional formats that did not run in August at all. A filter built on the head of the list reaches most of the market; the tail is where the specialist formats live.
The names group themselves. Market coverage reads off directly: Primary, Secondary,
Distressed, Private Credit, Investment Grade, CLO, ABS. The QuickTake tags mark short
structured notes on a single situation, and the two Legal ones are the most reliable route to
articles tied to a specific instrument: 9fin-Bond Legal QuickTake for bond offering memoranda,
9fin-Loan Legal QuickTake for loan credit agreements. Notebook 2.2 leans on exactly that.
The zero rows come from joining the two sources. Counting the data alone would not show that those tags exist; reading the spec alone would not show which of them matter.
Verticals
Each tag reports under a vertical, so you can work a level up and ask which desks produced the volume.
verticals = collections.Counter(t["vertical_name"] for a in month for t in a["content_tags"])
dict(verticals.most_common())
Sample output, captured October 2026. Static snapshot, not live data.
{'Core Credit': 853,
'Distressed': 407,
'ABF': 152,
'Private Credit': 132,
'Investment Grade': 103,
'No Verticals': 90,
'Structured Credit': 68,
'ESG': 23,
'All Verticals': 20}
Tags travel together
Most articles carry several tags, and the pairs that recur tell you how the desks overlap. A primary market piece also tagged editorial is a different read from one also tagged distressed.
import itertools
pairs = collections.Counter(pair for a in month
for pair in itertools.combinations(sorted({t["tag_name"] for t in a["content_tags"]}), 2))
pairs.most_common(6)
Sample output, captured October 2026. Static snapshot, not live data.
[(('9fin-Distressed', '9fin-Secondary'), 133),
(('9fin-Editorial', '9fin-Secondary'), 81),
(('9fin-Editorial', '9fin-Primary'), 74),
(('9fin-Distressed', '9fin-Editorial'), 65),
(('9fin-ABS', '9fin-Asset Based Finance'), 56),
(('9fin-Investment Grade', '9fin-Primary'), 48)]
Other ways to cut the same universe
Region and industry both arrive on every headline, and both are filters on the endpoint. Industry is the more useful of the two: its vocabulary is fixed, and we publish it in the same place as the tags, so spec_options reads it unchanged.
INDUSTRIES = spec_options("industries__in")
len(INDUSTRIES), INDUSTRIES[:6]
Sample output, captured October 2026. Static snapshot, not live data.
(44,
['Aerospace / Defense',
'Alcoholic Beverage',
'Apparel',
'Automotive Manufacturer',
'Automotive Supplier',
'Banks'])
Which of them carried the month's volume:
collections.Counter(a["industry"]["name"] for a in month
if (a["industry"] or {}).get("name")).most_common(6)
Sample output, captured October 2026. Static snapshot, not live data.
[('Diversified Financials', 67),
('Banks', 52),
('Manufacturing', 40),
('Communications Infrastructure', 35),
('Health Care Equipment & Services', 31),
('Energy, Oil & Gas', 31)]
And filtering on it server side, up to five at a time. The value must be one of the documented names; anything else is a 422 that names the offending value.
banks = api_get("/v2/news/headlines", industries__in="Banks, Software & Services", limit=25)
collections.Counter(a["industry"]["name"] for a in banks["items"])
Sample output, captured October 2026. Static snapshot, not live data.
Counter({'Banks': 22, 'Software & Services': 3})
Building a desk feed
Put it together: the tags a desk cares about, a region, and our own content only.
feed = api_get("/v2/news/headlines", source_type="9fin", region="Europe", limit=5,
content_tags__in="9fin-Distressed,9fin-Liability Management (LME)")
pd.DataFrame([{"published": i["published_at"][:10], "title": i["title"][:70],
"tags": ", ".join(t["tag_name"] for t in i["content_tags"])} for i in feed["items"]])
Sample output, captured October 2026. Static snapshot, not live data.
| published | title | tags |
|---|---|---|
| 2026-10-28 | UK autumn budget holds debt markets steady, but keeps leveraged borrow | 9fin-ESG, 9fin-Editorial, 9fin-Primary, 9fin-Secondary, 9fin-Distressed |
| 2026-10-28 | Weil Gotshal to dissolve, in stunning downfall of corporate law firm ( | 9fin-Distressed |
| 2026-10-28 | O-I Glass cuts guidance as Europe falters — Q3 26 earnings review (9fi | 9fin-Secondary, 9fin-Distressed |
| 2026-10-28 | Mutually assured construction — Unpacking Anthropic and SpaceX’s high- | 9fin-Investment Grade, 9fin-Editorial, 9fin-Distressed |
| 2026-10-28 | Marelli seeks approval of OPmobility deal clearing Favre CEO appointme | 9fin-Distressed |
Choosing filters
| To get | Use |
|---|---|
| a kind of coverage | content_tags__in, up to 5, OR'd |
| a whole desk | the tags belonging to one vertical |
| a sector | industries__in, up to 5, OR'd |
| named companies | nf_ids__in, up to 10 entity ids |
| our own journalism only | source_type="9fin" |
| a geography | region or entity_country_code |
| a period | since and until |
| the accepted values for any of them | spec_options("<parameter>") |
The uuid of anything in a feed goes to notebook 1.1 to read it in full. Notebook 1.3 keeps a feed current without re-reading what you already have.