FactSet Prices API

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

Gain access to comprehensive global coverage for Equities & Fixed Income. Perform quick analytics by controlling the date ranges, currencies, and rolling periods, or simply request Open, High, Low, and Close prices. Easily connect pricing data with other core company data or alternative content sets using FactSet’s hub and spoke symbology.

Equity and Fund Security types include Common Stock, ADR, GDR, Preferred, Closed-ended Fund, Exchange Traded Fund, Unit, Open-ended Fund, Exchange Traded Fund UVI, Exchange Traded Fund NAV, Preferred Equity, Non-Voting Depository Receipt/Certificate, Alien/Foreign, Structured Product, and Temporary Instruments. Reference over 180,000+ active and inactive securities.

Fixed Income Security Types include Corporate Bonds, Treasury and Agency bonds, Government Bonds, and Municipals. See securityType response items for a full list of security types.

Beta Feature: 8/30/2021

  • Long Running Requests - /prices endpoint - use an asynchronous process to retrieve a larger request payload of up to 10 minutes.
API Definition
SDK Libraries
Notebooks
Getting Started - Juypter Notebook
Getting Started - Juypter Notebook SDK
Code Snippet
Sample code to retrieve the end-of-day Security Prices using FactSet Prices API
# Imports
import pandas as pd

# FDS Packages 
import fds.sdk.FactSetPrices # To install, please use "pip install fds.sdk.utils fds.sdk.FactSetPrices==1.1.7"
from fds.sdk.FactSetPrices.api import prices_api, returns_api, dividends_api, splits_api, shares_api, market_value_api, high_low_api, database_rollover_api
from fds.sdk.FactSetPrices.models import *
from fds.sdk.utils.authentication import ConfidentialClient

# Authentication
configuration = fds.sdk.FactSetPrices.Configuration(
    fds_oauth_client=ConfidentialClient('<PATH_TO_CONFIG_FILE>')
)

# Get fixed-income data
with fds.sdk.FactSetPrices.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = prices_api.PricesApi(api_client)

    prices_fixed_income_request = PricesFixedIncomeRequest(
        ids=FixedIds(["037833BX"]),
        start_date="2019-01-01",
        end_date="2019-12-31",
        frequency=FrequencyFi("M"),
    ) 
    
    # Send Request
    api_response = api_instance.get_fixed_security_prices_for_list(prices_fixed_income_request)

    # Convert to Pandas Dataframe
    results = pd.json_normalize([a.__dict__["_data_store"] for a in api_response["data"]])
    print(results)
Changelog

1.3.0

Summary

Consolidated Batch API endpoints into this FactSet Prices API Swagger specification for increased readability.

1.2.1

Summary

Minor Patch to Id limits due to new "batch" parameter feature

Functionality Additions

  • Increased id limits to 5000 when using the "batch" parameter for asynchronous long-running requests.

v1.2.0

Summary

Beta Feature introducing "batch" parameter, enabling users to submit asynchronous requests for up to 10 minutes.

Functionality Additions

1.1.2

Summary

Minor enhancement to the 'calendar' parameter including the ability to request LOCAL trading calendars.

Functionality Additions

Parameter Enhancement

  • calendar - Added support for 'LOCAL' calendar. This defaults to the securities' trading calendar which excludes date records for respective holiday periods.

v1.1.0

Summary

New Endpoints (as of 09-18-2020)

  • factset-prices/v1/references - fetch security name, date of first/last trade, security type, and more.
  • factset-prices/v1/high-low - fetch security high/low prices and dates for a given period
  • factset-prices/v1/returns-snapshot - fetch returns as of a given date for predefined periods, such as 1YR, 3YR, Since IPO, etc.
  • factset-prices/v1/fixed-income - fetch Bid, Mid, Ask, for Fixed Income instruments
  • factset-prices/v1/database-rollover - fetch the latest database update time to help with production workflows
  • factset-prices/v1/market-value - ability to fetch security and company level market value for a list of ids

Enhanced Error Messages:

  • Future Dates are no longer accepted in the startDate or endDate parameters
  • Parameter Validation - only parameters listed in the endpoints request model are allowed. This helps prevent users from spelling mistakes passed in their requests or improper use of other parameters.

Functionality Additions

Bug Fixes

Minor bug fix allowing for users to fetch Splits declared for a future date.

Sample Use Case

Guidance on Data Extraction and Request Construction:

Performance for each endpoint varies based on the number of `ids` requested and the depth of history / frequency. All endpoints are subject to a 30 second timeout. If the request takes more than 30 seconds to complete you will receive a 400 timeout error.

Concurrency is currently set to 10 requests per user, which will replenish at a rate of 10 per second. Requests must be freed up on our service before the next set of resources will be restored. If you submit too many requests you will receive a 429 error.

The below outlines a P95 runtime for the FactSet Prices API /prices endpoint to help guide how many symbols for the requested history should be able to be completed.  This is not a guarantee of performance. For performance of other endpoints, please reach out to your FactSet Account Team.

/prices

1 day 1 month 6 month 1 year 5 years 10 years 30 years
1 id
P95 Runtime (sec) 0.2 0.2 0.2 0.2 0.3 0.4 0.6
10 ids
P95 Runtime (sec) 0.2 0.3 0.4 0.4 1 1.6 4.8
100 ids
P95 Runtime (sec) 1.5 1.1 1.8 2.2 8.1 16.5 --
500 ids
P95 Runtime (sec) 2.9 3.7 7.1 11.1 -- -- --
1000 ids
P95 Runtime (sec) 6.4 7.2 12.7 19.4 -- -- --