Async Python client for Financial Modeling Prep API
Project description
fmp-py-client
A fully asynchronous Python client for the Financial Modeling Prep API. Access 180+ financial data endpoints with a modern, type-safe interface.
Features
- Async/await support - Built on
httpxfor high-performance concurrent requests - Fully typed - Complete type hints for IDE autocomplete and static analysis
- 180+ endpoints - Stocks, financials, ETFs, crypto, forex, economics, and more
- Clean API - Intuitive method names that mirror the FMP API structure
- Robust error handling - Custom exceptions with detailed error information
Installation
pip install fmp-py-client
Or with uv:
uv add fmp-py-client
Quick Start
import asyncio
from fmp_py_client import AsyncFMPClient
async def main():
async with AsyncFMPClient("your-api-key") as client:
# Get a stock quote
quote = await client.quote("AAPL")
print(f"Apple: ${quote[0]['price']}")
# Get company profile
profile = await client.profile("AAPL")
print(f"Market Cap: ${profile[0]['mktCap']:,}")
# Search for companies
results = await client.search_name("Tesla", limit=5)
for company in results:
print(f"{company['symbol']}: {company['name']}")
asyncio.run(main())
API Coverage
| Category | Examples |
|---|---|
| Quotes | Real-time quotes, aftermarket, batch quotes |
| Company | Profiles, executives, peers, screener |
| Financials | Income statements, balance sheets, cash flow |
| Metrics | Key metrics, ratios, financial scores |
| Historical | EOD prices, intraday charts (1min to 4hr) |
| Calendar | Dividends, splits, earnings, IPOs |
| Market | Stock lists, ETFs, mutual funds, indices |
| News | Company news, sentiment analysis |
| Technical | SMA, EMA, RSI, MACD, Bollinger Bands |
| Valuation | DCF, enterprise values |
| SEC | Filings, insider trading |
| Economics | Treasury rates, economic calendar |
Error Handling
from fmp_py_client import (
AsyncFMPClient,
FMPAuthenticationError,
FMPRateLimitError,
FMPNotFoundError,
)
async with AsyncFMPClient("your-api-key") as client:
try:
quote = await client.quote("AAPL")
except FMPAuthenticationError:
print("Invalid API key")
except FMPRateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after}s")
except FMPNotFoundError:
print("Symbol not found")
Documentation
Full documentation is available at cbian.github.io/fmp-py-client.
Requirements
- Python 3.12+
- An API key from Financial Modeling Prep (free tier available)
License
MIT
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
fmp_py_client-0.1.0.tar.gz
(12.3 kB
view details)
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_py_client-0.1.0.tar.gz.
File metadata
- Download URL: fmp_py_client-0.1.0.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40d77cec3de9c5412f674c32d666ec451f1b5e6014b4beeb46dfdc588d7c9029
|
|
| MD5 |
fb1c004580b99bde0f6b179819f7a04f
|
|
| BLAKE2b-256 |
9e08eb12e013bf3c0112616f860531bad03031f2ea54b8ae0462ef3a7afe9fee
|
File details
Details for the file fmp_py_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fmp_py_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6360387ab33d75216292039ecab6f76ad615d42beb612eb3fa5787cbfaba41d
|
|
| MD5 |
64a1f416d516d20239daad4bb75a9a8b
|
|
| BLAKE2b-256 |
bbf28c1c207259874af88e23670b70aa812947dd0c512662539539cc96fdfc82
|