FactSet Fundamentals API

  • SECTIONS
  • Overview
  • API Definition
  • SDK Libraries
  • Notebooks
  • Code Snippet
  • Changelog
  • Sample Use Case
Overview

Reference a global universe of timely Fundamental Data items. With access to over 1400+ individual data items, 116 countries, and over 86,000+ companies, this API will give you the power to take deeper dives into your fundamental analysis or build meaningful fundamental applications. Learn more about the data items available by using the /metrics endpoint, giving you a list of all available items and their respective definitions.

For clients interested in curated, relevant data, the FactSet Fundamentals API now includes Company Reports endpoints for accessing company financials, profiles, and fundamentals. These endpoints return data in a format that is easy to consume for mobile and web display. Please review the Sample Use Case section for more details.

Categories of Data items include:

  • Income Statement = Income Statement line items, such as Sales, Gross Profit, Net Income.
  • Balance Sheet = Balance Sheet line items, such as Assets, Liabilities, and Shareholders Equity.
  • Cash Flow = Cash Flow Statement line items, such as Financing activities, Operation, and Per Share.
  • Ratios = Pre-calculated Ratios, including Financial, Growth Rates, Profitability, Liquidity, Size, and Valuation.
  • Financial Services = Financial Statement Items modified for Financial Services companies.
  • Industry Metrics = Industry Specific Line Items or Modifications. View subcategory for list of Industries.
  • Pension and Postretirement = Accumulated Pension Benefit Obligations and related data.
  • Market Data = General Market Data, such as Shares Outstanding.
  • Miscellaneous = Corporation Data, Financial Records details, Indicators.
  • Dates = Relevant Dates

How to Programmatically Download API Specification file:

Please use the below link to download the FactSet Fundamentals API Specification file in .yaml. You must be authorized for this API to extract. This specification can then be used for Codegen to create your own SDKs. You can also access by selecting the "Download Spec" button to the right of the version below.

https://api.factset.com/content/factset-fundamentals/v2/spec/swagger.yaml

This API is rate-limited to 10 requests per second and 10 concurrent requests per user.

API Definition
SDK Libraries
Notebooks
Getting Started - Juypter Notebook v1
Getting Started - Juypter Notebook v2
Getting Started - SDK - Juypter Notebook v2
Code Snippet
Sample code to retrieve the company fundamental data using FactSet Fundamentals API
# Imports
import pandas as pd
import time

# FDS Packages
import fds.sdk.FactSetFundamentals # To install, please use "pip install fds.sdk.FactSetFundamentals==2.2.0"
from fds.sdk.FactSetFundamentals.api import metrics_api,fact_set_fundamentals_api,segments_api,batch_processing_api
from fds.sdk.FactSetFundamentals.models import *
from fds.sdk.utils.authentication import ConfidentialClient # To install, please use "pip install fds.sdk.utils"

# Authentication using OAuth
configuration = fds.sdk.FactSetFundamentals.Configuration(
    fds_oauth_client=ConfidentialClient('<PATH_TO_CONFIG_FILE>') # Path to config file from OAuth registration
)

# Get Fundamentals Data
with fds.sdk.FactSetFundamentals.ApiClient(configuration) as api_client:
    # Create Instance
    api_instance = fact_set_fundamentals_api.FactSetFundamentalsApi(api_client)

    # Request Object to Define Parameters
    fundamentals_request = FundamentalsRequest(
        data = FundamentalRequestBody(
            ids = IdsBatchMax30000(["FDS-US"]),
            periodicity = Periodicity("QTR"),
            fiscal_period = FiscalPeriod(
                start = "2012-01-01",
                end = "2014-01-01",
            ),
            metrics = Metrics(["FF_SALES"]),
            currency = "USD",
            update_type = UpdateType("RP"),
            batch = Batch("N"),
        )
    )

    # Send Request
    api_response_wrapper = api_instance.get_fds_fundamentals_for_list(fundamentals_request)
    api_response = api_response_wrapper.get_response_200()

    # Convert to Pandas Dataframe
    results = pd.DataFrame(api_response.to_dict()['data'])
    print(results)
Changelog

v2.1.0

Summary

Added support for LTM_R and SEMI_R periodicities to /fundamentals endpoint.

Functionality Additions

  • Restated Data - Added LTM_R and SEMI_R data.

v2.0.0

Summary

Major version upgrade to include FF segments data, batching capabilities, additional content coverage and consistency with other FactSet APIs.

Functionality Additions

  • Segments Data - Added FF segments data, with this Business and Geographic Segment data is available in an easy-to-use endpoint with a curated response model.

  • Batching Capabilities - Added Batching Capabilities to support bulk workflows with asynchronous requests allowing for requests up to 20 minutes (compared to 30 seconds with non-batch request). Batching support has been added to both GET and POST method for Fundamentals and Segments endpoints. To use this feature, set the "batch" parameter to "Y".

  • Additional Metrics - Included 32 additional metrics.

Changes

  • This Version adheres to all the FactSet API standards for a consistent user experience across all FactSet APIs.

  • Added a new parameter "metricDataType" in /metrics endpoint to filter the data based on data type of the metrics like integer, float or strings.

  • Renamed the "restated" parameter in the /fundamentals endpoint in v1 as "updateType" in v2.

  • Removed "updateStatus" from the response model and changed the datatype of "updateType" from integer to string for /fundamentals endpoint.

  • In v1, the parameters "fiscalPeriodStart" and "fiscalPeriodEnd" were used to specify the fiscal periods in POST requests. In v2 POST requests, the fiscal periods are specified through the "fiscalPeriod" object. The structure of the "fiscalPeriod" object is "fiscalPeriod": {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"}.

  • Default Periodicity has been changed from QTR to ANN for /fundamentals.

  • Error Response has been changed to an Error Object which now includes id, code, links and title in accordance with FactSet API standards.

  • JSON request body has a top-level "data" member. The structure of post request is {"data": { request parameters like IDs, Metrics etc. }}.

Sample Use Case

API Documentation: Understanding Display Levels and Display Order

Overview:

Our company financials API provides detailed financial data, including balance sheet items, organized using displayLevel and displayOrder attributes. This documentation explains how these features function, to help with proper utilization of the data.

Display Levels:

The displayLevel attribute signifies the hierarchical level of each item on the balance sheet, aiding in logical categorization and structuring of the data. The arrangement is as follows:

  • Level 0 ("L0"): Represents the broadest category. For example, "Cash & Short Term Investments".
  • Level 1 ("L1"): Designates a sub-category under a Level 0 item. Examples include "Cash Only" and "Total Short-Term Investments", both falling under "Cash & Short Term Investments".

Display Order:

The displayOrder attribute determines the sequence of items. This order may span across various display levels, ensuring that items are presented in a consistent and logical sequence, irrespective of their hierarchical position.

For instance, in the API response for the "Cash & Short Term Investments" category:

  • "Cash & Short Term Investments" is assigned displayOrder: 1
  • "Cash Only" is assigned displayOrder: 2
  • "Total Short-Term Investments" is assigned displayOrder: 3

This structured approach to data organization facilitates easier interpretation and application of financial information returned by the API.

Example:

workstation_api_comparison