Welcome to finflux API!#
IMPORTANT LEGAL DISCLAIMERS
finflux is a Python library that provides a unified interface to access publicly available financial data via first- and third-party APIs, including yfinance, Twelve Data, FRED, BLS, BEA, and SEC. This project is not affiliated with or endorsed by any of these providers. All data and trademarks remain the property of their respective owners.
The library is provided “as is” without warranties of any kind. No guarantees are made regarding the accuracy, completeness, or reliability of the data retrieved. Users assume full responsibility for how they use the information and are solely responsible for complying with each provider’s terms of service and rate limits.
By using finflux, you agree that the authors and contributors are not liable for any damages resulting from its use.
Introduction#
finflux is a Python library that aggregates financial and market data from multiple publicly available RESTful JSON APIs. It currently covers equities, bonds, and U.S. economic indicators, offering a consistent and lightweight way to access and work with this data using straightforward code.
finflux leverages both first-party and third-party APIs sourced from the data providers listed below:
Install#
$ pip install finflux
Quick start#
First, import the library.
import finflux as ff
Before using data retrieval functions, you must configure your API keys and email address for specific endpoints that require user identification. If a required identifier is missing when calling a function, a MissingConfigObject error will be raised.
Currently, functions that access Twelve Data, FRED, BEA, BLS, and SEC data require identifiers: API keys for all except the SEC, which requires an email address. Use the links below to obtain the necessary credentials for each provider.
Once you have obtained all required credentials, configure your API keys and email address using the set_config function.
ff.set_config(
td = 'your_twelve_data_api_key',
email = 'example@example.com',
fred = 'your_FRED_api_key',
bea = 'your_BEA_api_key',
bls = 'your_BLS_api_key',
)
Use Case Examples#
EXAMPLE #1: Retrieving dataframe formatted annual income statement data in EUR in millions excluding units past the decimals for Apple Inc. (AAPL).
ff.equity('AAPL').statement(display='table', statement='income', currency='EUR', unit='million', decimal=False, interval='annual')
EXAMPLE #2: Retrieving dataframe formatted monthly timeseries of the US high quality market (A, AA, AAA credit ratings) 7 year maturity corporate bond yield for the past 10 years.
ff.bond().US_HQM_corporate(maturity='7y', period='10y')