Revenue by segment from XBRL: business segment, geography and product figures
Get revenue, operating income or assets by business segment, country or region and product line from a company's 10-K and 10-Q XBRL, with the member names and the filing behind every number.
Segment, geographic and product revenue sit in the notes of a 10-K, not on the face of the income statement, so the usual XBRL company facts files leave them out. They are tagged in the filing's XBRL instance with dimensions (an axis such as ProductOrServiceAxis and a member such as aapl:IPhoneMember). /v1/segments reads those dimensional facts from each 10-K, 10-Q, 20-F and 40-F filed since 2019 and returns them per filing.
Setup
import os
import requests
H = {"Authorization": "Bearer " + os.environ["SECFEED_KEY"]}
BASE = "https://secfeedapi.com/v1"
Product revenue of one company
type is business, geography or product; metric is revenue (default), operatingIncome or assets. A 10-K reports several years, so keep the latest end date for the current year:
r = requests.get(BASE + "/segments", headers=H, params={"ticker": "AAPL", "type": "product", "limit": 1}).json()
f = r["filings"][0]
print(f["form"], f["filed"], f["accessionNo"], f["concept"])
latest = max(i["end"] for i in f["items"])
for i in f["items"]:
if i["end"] == latest:
print(f"{i['name']:<28} {i['value']/1e9:7.1f}")
Output from a real run (billions of dollars):
10-K 2026-11-03 0000320193-26-000026 RevenueFromContractWithCustomerExcludingAssessedTax
Product 355.5
IPhone 254.1
Service 123.3
Mac 37.9
Wearables Homeand Accessories 35.6
IPad 27.9
Read the list before you sum it. Companies often tag a subtotal next to its parts: here Product is the total of iPhone, Mac, iPad and Wearables, and Service is the other half of revenue. Use the member field (for example us-gaap:ProductMember versus aapl:IPhoneMember) to tell them apart. Names are built from the member, so they read like Wearables Homeand Accessories.
Segment operating income
r = requests.get(BASE + "/segments", headers=H,
params={"ticker": "MSFT", "type": "business", "metric": "operatingIncome", "limit": 1}).json()
f = r["filings"][0]
print(f["form"], f["filed"], f["concept"])
for i in f["items"][:6]:
print(i["end"], f"{i['name']:<36} {i['value']/1e9:6.1f}")
10-K 2026-07-29 OperatingIncomeLoss
2026-06-30 Productivity And Business Processes 83.9
2026-06-30 Intelligent Cloud 57.0
2026-06-30 More Personal Computing 14.4
2025-06-30 Productivity And Business Processes 69.8
2025-06-30 Intelligent Cloud 44.6
2025-06-30 More Personal Computing 14.2
Several years of history
limit returns up to 8 filings, newest first. With the default period=annual that reaches back to the 2019 10-K:
r = requests.get(BASE + "/segments", headers=H, params={"ticker": "AAPL", "type": "geography", "limit": 8}).json()
for f in r["filings"]:
print(f["form"], f["filed"], len(f["items"]))
10-K 2026-11-03 9
10-K 2025-10-31 9
10-K 2024-11-01 9
10-K 2023-11-03 9
10-K 2022-10-28 9
10-K 2021-10-29 9
10-K 2020-10-30 9
10-K 2019-10-31 9
period=quarterly returns 10-Q filings instead.
Limits
- Only what the company tagged. If a company describes its segments in text but does not tag them, there is nothing to return.
- Filings since 2019. Members are each company's own, so segment names are not comparable across companies without your own mapping.
- Values are as filed in that filing. A later 10-K can recast segments; compare the same
enddate across filings to see restatements.