Financial Modeling Prep API Wrapper
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fmp_api_python-1.1.0.tar.gz.
File metadata
- Download URL: fmp_api_python-1.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a44b63aac0fa066b45f2465a9adbc66668ea2bbceb9dbba2e9b568e1356d52d
|
|
| MD5 |
3b3e39e3a12001fdfaf8bfb7675fb13a
|
|
| BLAKE2b-256 |
28c5e2953ac066a3571086b6a46f6b57f002ca132577c8f6fc025db39d16af7c
|
File details
Details for the file fmp_api_python-1.1.0-py3-none-any.whl.
File metadata
- Download URL: fmp_api_python-1.1.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4c4da06dd33a314c41bbb5b0140a9f334c5242b5c09f2c56d0b4fb4c4d90258
|
|
| MD5 |
85f81f00b782756dc74d74ac5f679759
|
|
| BLAKE2b-256 |
4a7924016840088ab0b474a57ff87ca13df44da51ccc1695eabce18729a32631
|