Skip to main content

FMP SDK

PyPI version Python versions License: BSD-3-Clause

The idea behind this project is to provide a 'one-stop-shop' to the API endpoints provided by Financial Modeling Prep (FMP).

A personal note to you: my apologies for letting this package get so out of date. FMP kept reshuffling its API, then I had a personal issue delay me further. Things are back on track now. Because of that gap, roughly half of this package's old methods had gone defunct against FMP's current API, so rather than patch around that I rebuilt it from scratch against FMP's stable/ API. If you're on 20250102.0 or earlier you're on the old, pre-rewrite methods; anything newer uses the schema described below.

What's covered

29 data groups, ~240 methods total, each reachable both as client.<method>(...) and grouped under a matching namespace, e.g. client.statements.income_statement(...):

  • Company & fundamentals — profile, executives, M&A, DCF valuation, financial statements/ ratios/growth (income, balance sheet, cash flow — as-reported, TTM, and growth variants)
  • Market data — real-time & aftermarket quotes, historical price charts, technical indicators
  • Reference & screening — symbol/CIK/CUSIP/ISIN search, the company screener, sector/ industry/exchange directories
  • Calendars & events — earnings, dividends, splits, IPOs, the economic calendar
  • Ownership & compliance — insider trades, Form 13F institutional ownership, SEC filings, ESG disclosures
  • Alternative markets — crypto, forex, commodities, indexes, ETFs & mutual funds
  • Sentiment & analysis — analyst grades/price targets, TipRanks ratings, congressional trading, market movers
  • Bulk downloads — whole-universe data dumps, one call instead of one per symbol

Every method's own docstring says which FMP plan tier it needs (Free/Starter/Premium/ Ultimate) — see Pricing tiers below. One exception: the 7 client.tipranks methods are implemented and unit-tested but untested against a real response — see that section for why.

How to Use

  1. Requires Python 3.9+. Install the package: pip install fmpsdk python-dotenv (python-dotenv is optional — it's just how the example below loads your API key from a .env file).
  2. Create a .env file and put your API key in it. Inside .env: FMP_API_KEY='blah'
  3. Build a Client and call methods on it, grouped by data category — e.g. client.company.profile(symbol="AAPL"), client.statements.income_statement(symbol="AAPL").
  4. The return from a method call is almost always a list of dictionaries. It is up to you to parse it.

Example code

#!/usr/bin/env python3

from dotenv import load_dotenv

import fmpsdk

# Actual API key is stored in a .env file. Not good to store API key directly in script.
load_dotenv()
client = fmpsdk.Client()  # reads FMP_API_KEY from the environment

# Company Valuation Methods
symbol = "AAPL"
print(f"Company Profile: {client.company.profile(symbol=symbol)}")

# Every non-2xx FMP response raises a typed exception instead of returning
# None or an error-shaped dict, so a plan-gated or bad-key call is obvious:
try:
    client.statements.income_statement_ttm(symbol=symbol)
except fmpsdk.FMPPlanLimitError:
    print("Your FMP plan doesn't cover this endpoint — check its docstring for which tier does.")
except fmpsdk.FMPAuthenticationError:
    print("Check your FMP_API_KEY.")

One naming quirk worth knowing up front: client.quote is the namespace for the whole quote group (client.quote.aftermarket_quote(...), client.quote.batch_quote(...), etc.), so it shadows the top-level quote() method of the same name — call that one as client.quote.quote(symbol="AAPL").

Pricing tiers

FMP's plans form a ladder — Free, Starter, Premium, Ultimate — and each one adds more endpoints on top of the last. A call your plan doesn't cover raises fmpsdk.FMPPlanLimitError rather than returning data. There's no single tier table to keep in sync here — instead, every group module's docstring (e.g. fmpsdk/endpoints/search.py) and every method's own docstring says plainly which tier it needs, right next to the code that calls it, verified live against a real key at every tier from Free through Ultimate. Check those, or just try the call and catch FMPPlanLimitError.

One exception, outside that ladder entirely: client.tipranks's 7 methods. They still 402 even on Ultimate — FMP's own error message says why: TipRanks data needs a separate paid add-on ("TipRanks data boost"), bought independently of the four plan tiers above. We haven't purchased it, so these 7 methods are implemented and unit-tested (mocked) but never verified against a real response — treat them as unverified rather than confirmed-working. If you have that add-on and hit a bug in one of them, a PR with the fix (and what the real response actually looks like) is welcome.

Contributing

See CONTRIBUTING.md — dev setup, the unit/live/ultimate test tiers, and specifically how to verify and PR a fix for the untested tipranks methods above.

License

BSD 3-Clause — see LICENSE.md.

Attribution

Special thanks to the following people who have pitched in on this project! Open source works thanks to people who jump in and help! These are this project's stars. Thank you.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fmpsdk-20260824.0.tar.gz (69.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fmpsdk-20260824.0-py3-none-any.whl (99.5 kB view details)

Uploaded Python 3

File details

Details for the file fmpsdk-20260824.0.tar.gz.

File metadata

  • Download URL: fmpsdk-20260824.0.tar.gz
  • Upload date:
  • Size: 69.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fmpsdk-20260824.0.tar.gz
Algorithm Hash digest
SHA256 25f0228790bf15de2222f56f3ae25ee38aa1b1b5babd763ddcb81bf5b652261f
MD5 348dc739004ae69a33fdc53cb74379b1
BLAKE2b-256 800777457eed5cb72b9ad85514ff726de0529e0315a5f6a35f7689fb1a9cbe41

See more details on using hashes here.

Provenance

The following attestation bundles were made for fmpsdk-20260824.0.tar.gz:

Publisher: publish.yml on daxm/fmpsdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fmpsdk-20260824.0-py3-none-any.whl.

File metadata

  • Download URL: fmpsdk-20260824.0-py3-none-any.whl
  • Upload date:
  • Size: 99.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fmpsdk-20260824.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ff9b13321dd29fc36030c9cb305fc5a1f84601d29bc3848d1829435a4944a8b
MD5 88e7931c9c2e150b9bd12837b7e10883
BLAKE2b-256 11cc1d5165301afa2c92441b75d5ad7394627e535c3fef0cad9458dcd59a3bbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for fmpsdk-20260824.0-py3-none-any.whl:

Publisher: publish.yml on daxm/fmpsdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page