Skip to main content
GET
/
financials
/
segments
Get all segmented financials
curl --request GET \
  --url https://api.financialdatasets.ai/financials/segments \
  --header 'X-API-KEY: <api-key>'
{
  "segmented_financials": [
    {
      "ticker": "<string>",
      "report_period": "2023-12-25",
      "fiscal_period": "<string>",
      "period": "quarterly",
      "currency": "<string>",
      "accession_number": "<string>",
      "filing_url": "<string>",
      "income_statement": {
        "revenue": {
          "product": [
            {
              "label": "<string>",
              "value": 123
            }
          ],
          "segment": [
            {
              "label": "<string>",
              "value": 123
            }
          ]
        },
        "operating_income": {
          "product": [
            {
              "label": "<string>",
              "value": 123
            }
          ],
          "segment": [
            {
              "label": "<string>",
              "value": 123
            }
          ]
        },
        "depreciation": {
          "product": [
            {
              "label": "<string>",
              "value": 123
            }
          ],
          "segment": [
            {
              "label": "<string>",
              "value": 123
            }
          ]
        }
      },
      "balance_sheet": {
        "assets": {
          "product": [
            {
              "label": "<string>",
              "value": 123
            }
          ],
          "segment": [
            {
              "label": "<string>",
              "value": 123
            }
          ]
        },
        "goodwill": {
          "product": [
            {
              "label": "<string>",
              "value": 123
            }
          ],
          "segment": [
            {
              "label": "<string>",
              "value": 123
            }
          ]
        },
        "long_lived_assets": {
          "product": [
            {
              "label": "<string>",
              "value": 123
            }
          ],
          "segment": [
            {
              "label": "<string>",
              "value": 123
            }
          ]
        }
      },
      "cash_flow_statement": {
        "capital_expenditure": {
          "product": [
            {
              "label": "<string>",
              "value": 123
            }
          ],
          "segment": [
            {
              "label": "<string>",
              "value": 123
            }
          ]
        }
      }
    }
  ]
}

Overview

This endpoint aggregates segment breakdowns from all three financial statement types into a single API call. So, instead of calling 3 endpoints to get income statement segments, balance sheet segments, and cash flow statement segments, you can call this endpoint once and get all segment data in one go. The endpoint returns segment breakdowns for: 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/segments/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.

Filtering the Data

You can filter the data by ticker, period, limit, and report_period. Note: ticker and period are required. Alternatively, you can use cik instead of ticker as a company identifier in your request. By default, period is annual, limit is 4, and report_period is null. The period parameter can be set to annual or quarterly. The limit parameter is used to specify the number of periods to return. The report_period parameter is used to specify the date of the statement. For example, you can include filters like report_period_lte=2024-09-30 and report_period_gte=2024-01-01 to get statements between January 1, 2024 and September 30, 2024. The available report_period operations are:
  • report_period_lte
  • report_period_lt
  • report_period_gte
  • report_period_gt
  • report_period

Example

All Segmented Financials
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 periods to return

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

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

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

# each element is a per-period snapshot with all three statement types
for period_data in segmented_financials:
    income_statement = period_data.get('income_statement')    # dict or None
    balance_sheet = period_data.get('balance_sheet')          # dict or None
    cash_flow_statement = period_data.get('cash_flow_statement')  # dict or None

Example (with report_period)

All Segmented Financials
import requests

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

# set your query params
ticker = 'AAPL'
period = 'annual'
limit = 100
report_period_lte = '2024-01-01' # end date
report_period_gte = '2020-01-01' # start date

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

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

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

Authorizations

X-API-KEY
string
header
required

API key for authentication.

Query Parameters

ticker
string

The ticker symbol. Required if cik is not provided.

period
enum<string>
required

The time period of the data.

Available options:
annual,
quarterly
limit
integer<int32>

The maximum number of periods to return.

cik
string

The Central Index Key (CIK) of the company.

report_period
string<date>

Filter by exact report period date in YYYY-MM-DD format.

report_period_gte
string<date>

Filter by report period greater than or equal to date in YYYY-MM-DD format.

report_period_lte
string<date>

Filter by report period less than or equal to date in YYYY-MM-DD format.

report_period_gt
string<date>

Filter by report period greater than date in YYYY-MM-DD format.

report_period_lt
string<date>

Filter by report period less than date in YYYY-MM-DD format.

Response

All segmented financials response

segmented_financials
object[]