GET
/
financials
/
segmented-revenues

👋 Overview

The segmented revenues API provides as-reported, granular revenue data for a given stock ticker.

I finally launched the segmented revenues API, which lets your AI financial agent access segmented revenue data by product lines, business segments, and geographical regions for a given stock ticker.

This includes revenue data segmented by:

  • product lines
  • business segments
  • geographical regions

For example, Apple Inc. reports segmented revenue for its different product lines like iPhone, Mac, iPad, and wearables.

Apple also reports segmented revenue for its different geographical regions like the Americas, Europe, and China.

The segmented revenues API lets you easily access this data in a structured format:

{
  "segmented_revenues": [
    {
      "ticker": "AAPL",
      "report_period": "2023-09-30",
      "period": "annual",
      "items": [
        "...",
        {
          "key": "aapl:IPhoneMember",
          "axis": "srt:ProductOrServiceAxis",
          "value": 200583000000,
          "segment": "IPhone"
        },
        {
          "key": "aapl:MacMember",
          "axis": "srt:ProductOrServiceAxis",
          "value": 29357000000,
          "segment": "Mac"
        },
        {
          "key": "aapl:IPadMember",
          "axis": "srt:ProductOrServiceAxis",
          "value": 28300000000,
          "segment": "IPad"
        },
        {
          "key": "aapl:AmericasSegmentMember",
          "axis": "us-gaap:StatementBusinessSegmentsAxis",
          "value": 60508000000,
          "segment": "AmericasSegment"
        },
        {
          "key": "aapl:EuropeSegmentMember",
          "axis": "us-gaap:StatementBusinessSegmentsAxis",
          "value": 36098000000,
          "segment": "EuropeSegment"
        },
        {
          "key": "aapl:GreaterChinaSegmentMember",
          "axis": "us-gaap:StatementBusinessSegmentsAxis",
          "value": 30328000000,
          "segment": "GreaterChinaSegment"
        },
        "..."
      ]
    }
  ]
}

This data is pulled directly from XBRL filings (10-Ks and 10-Qs). We have included the original XBRL tags like key and axis in the response for your reference.

To get started, please create an account and grab your API key at financialdatasets.ai.

You will use the API key to authenticate your API requests.

📊 Available Tickers

You can fetch a list of available tickers with a GET request to: https://api.financialdatasets.ai/financials/segmented-revenue/tickers/

🚀 Getting Started

There are only 3 steps for making a successful API call:

  1. Add your API key to the header of the request as X-API-KEY.
  2. Add query params like ticker, period and limit to filter the data.
  3. Execute the API request.

You can filter the data by ticker, period, limit, and cik.

The period parameter can be set to "annual" or "quarterly". The limit parameter is used to specify the number of statements to return.

Note: ticker and period are required. Alternatively, you can use cik instead of ticker as a company identifier in your request. By default, limit is 4.

💻 Example

Segmented Revenues
import requests

# add your API key to the headers
headers = {
    "X-API-KEY": "your_api_key_here"
}

# set your query params
ticker = "AAPL"     # stock ticker
period = "annual"   # possible values are "annual" or "quarterly"
limit = 5           # number of statements to return

# create the URL
url = (
    f'https://api.financialdatasets.ai/financials/segmented-revenues/'
    f'?ticker={ticker}'
    f'&period={period}'
    f'&limit={limit}'
)

# make API request
response = requests.get(url, headers=headers)

# parse segmented_revenues from the response
segmented_revenues = response.json().get('segmented_revenues')

Authorizations

X-API-KEY
string
headerrequired

API key for authentication.

Query Parameters

ticker
string
required

The ticker symbol.

period
enum<string>
required

The date or time period to which the reported revenue data relates in ISO 8601 format (YYYY-MM-DD).

Available options:
annual,
quarterly
limit
integer

The maximum number of revenue statements to return.

cik
string

The Central Index Key (CIK) of the company.

Response

200 - application/json
segmented_revenues
object[]