Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fmp-api-python

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fmp-api-python

Financial Modeling Prep API Wrapper

  • 1.1.0
  • PyPI
  • Socket score

Maintainers
1

Financial Modeling Prep API Wrapper

Python wrapper package to request historical, real-time, and fundamental stock data from the Financial Modeling Prep API. Currently only supports a subset of the endpoints available under the personal plan.

Install

An API key is needed and may be obtained at the FMP website.

The package may be installed with the command:

pip install fmp_api_python

Usage

Creating the Client

To make calls to the api, first import the package and create an instance of the client:

from fmp_api_python.fmp import FMPClient
client = FMPClient(<your api key>)

Alternatively, your api key may be stored in the environment variable under the name FMP_API_KEY. In this case, creating the instance may be done simply with:

client = FMPClient()

Making API Calls

The full documentation of existing methods for the FMPClient class can be viewed here. Note that while most methods take a parameter 'return_type' which can be either 'json' or 'df' for pandas.DataFrame, some do not and can only return one of these types. The default return type is usually json if left unspecified. The following are a few example calls:

response = client.income_statement(symbol='AAPL', period='quarter', limit=10, return_type='json')
response = client.balance_sheet(symbol='AAPL', period='annual', limit=None, return_type='df')
response = client.quote('AAPL', 'df')
response = client.historical_price_full('AAPL', return_type='df')
response = client.batch_request_end_of_day_prices('2020-01-01')   # Returns pd.DataFrame, json not supported
response = client.is_the_market_open()    # Returns json, pd.DataFrame not supported

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc