{
  "markdown": "# FMP SDK\n\n[![PyPI version](https://img.shields.io/pypi/v/fmpsdk)](https://pypi.org/project/fmpsdk/)\n[![Python versions](https://img.shields.io/pypi/pyversions/fmpsdk)](https://pypi.org/project/fmpsdk/)\n[![License: BSD-3-Clause](https://img.shields.io/badge/license-BSD--3--Clause-blue)](LICENSE.md)\n\nThe idea behind this project is to provide a 'one-stop-shop' to the API endpoints provided by\n[Financial Modeling Prep](http://financialmodelingprep.com) (FMP).\n\nA personal note to you: my apologies for letting this package get so out of date. FMP kept\nreshuffling its API, then I had a personal issue delay me further. Things are back on track now.\nBecause of that gap, roughly half of this package's old methods had gone defunct against FMP's\ncurrent API, so rather than patch around that I rebuilt it from scratch against FMP's `stable/`\nAPI. If you're on `20250102.0` or earlier you're on the old, pre-rewrite methods; anything newer\nuses the schema described below. Old releases are yanked from PyPI (a plain `pip install fmpsdk`\nnow always gets the rewrite), but still installable if you pin one explicitly, e.g.\n`pip install fmpsdk==20250102.0` — note that won't actually restore functionality, though: FMP\nsunset the legacy `/api/v3/` API those old methods called entirely on 2025-08-31, so a pinned old\nversion installs fine but its calls will fail regardless. It's there for compatibility with\nexisting pinned requirements files while you migrate, not as a way to keep avoiding the rewrite.\n\n## What's covered\n\n29 data groups, ~240 methods total, each reachable both as `client.<method>(...)` and grouped\nunder a matching namespace, e.g. `client.statements.income_statement(...)`:\n\n- **Company & fundamentals** — profile, executives, M&A, DCF valuation, financial statements/\n  ratios/growth (income, balance sheet, cash flow — as-reported, TTM, and growth variants)\n- **Market data** — real-time & aftermarket quotes, historical price charts, technical indicators\n- **Reference & screening** — symbol/CIK/CUSIP/ISIN search, the company screener, sector/\n  industry/exchange directories\n- **Calendars & events** — earnings, dividends, splits, IPOs, the economic calendar\n- **Ownership & compliance** — insider trades, Form 13F institutional ownership, SEC filings, ESG\n  disclosures\n- **Alternative markets** — crypto, forex, commodities, indexes, ETFs & mutual funds\n- **Sentiment & analysis** — analyst grades/price targets, TipRanks ratings, congressional\n  trading, market movers\n- **Bulk downloads** — whole-universe data dumps, one call instead of one per symbol\n\nEvery method's own docstring says which FMP plan tier it needs (Free/Starter/Premium/\nUltimate) — see [Pricing tiers](#pricing-tiers) below. One exception: the 7\n`client.tipranks` methods are implemented and unit-tested but **untested against a real\nresponse** — see that section for why.\n\n## How to Use\n1. Requires Python 3.9+. Install the package: `pip install fmpsdk python-dotenv` (`python-dotenv`\n   is optional — it's just how the example below loads your API key from a `.env` file).\n1. Create a `.env` file and put your API key in it. Inside `.env`: `FMP_API_KEY='blah'`\n1. Build a `Client` and call methods on it, grouped by data category — e.g.\n   `client.company.profile(symbol=\"AAPL\")`, `client.statements.income_statement(symbol=\"AAPL\")`.\n1. The return from a method call is almost always a list of dictionaries. It is up to you to\n   parse it.\n\n## Example code\n```python\n#!/usr/bin/env python3\n\nfrom dotenv import load_dotenv\n\nimport fmpsdk\n\n# Actual API key is stored in a .env file. Not good to store API key directly in script.\nload_dotenv()\nclient = fmpsdk.Client()  # reads FMP_API_KEY from the environment\n\n# Company Valuation Methods\nsymbol = \"AAPL\"\nprint(f\"Company Profile: {client.company.profile(symbol=symbol)}\")\n\n# Every non-2xx FMP response raises a typed exception instead of returning\n# None or an error-shaped dict, so a plan-gated or bad-key call is obvious:\ntry:\n    client.statements.income_statement_ttm(symbol=symbol)\nexcept fmpsdk.FMPPlanLimitError:\n    print(\"Your FMP plan doesn't cover this endpoint — check its docstring for which tier does.\")\nexcept fmpsdk.FMPAuthenticationError:\n    print(\"Check your FMP_API_KEY.\")\n```\n\nOne naming quirk worth knowing up front: `client.quote` is the namespace for the whole quote\ngroup (`client.quote.aftermarket_quote(...)`, `client.quote.batch_quote(...)`, etc.), so it\nshadows the top-level `quote()` method of the same name — call that one as\n`client.quote.quote(symbol=\"AAPL\")`.\n\n## Pricing tiers\nFMP's plans form a ladder — Free, Starter, Premium, Ultimate — and each one adds more\nendpoints on top of the last. A call your plan doesn't cover raises\n`fmpsdk.FMPPlanLimitError` rather than returning data. There's no single tier table to keep\nin sync here — instead, every group module's docstring (e.g. `fmpsdk/endpoints/search.py`)\nand every method's own docstring says plainly which tier it needs, right next to the code\nthat calls it, verified live against a real key at every tier from Free through Ultimate.\nCheck those, or just try the call and catch `FMPPlanLimitError`.\n\n**One exception, outside that ladder entirely: `client.tipranks`'s 7 methods.** They still\n402 even on Ultimate — FMP's own error message says why: TipRanks data needs a separate\npaid add-on (\"TipRanks data boost\"), bought independently of the four plan tiers above. We\nhaven't purchased it, so these 7 methods are implemented and unit-tested (mocked) but\n**never verified against a real response** — treat them as unverified rather than\nconfirmed-working. If you have that add-on and hit a bug in one of them, a PR with the fix\n(and what the real response actually looks like) is welcome.\n\n## MCP server & OpenAPI spec\n\n**[`mcp/`](mcp/README.md) — a [Model Context Protocol](https://modelcontextprotocol.io)\nserver**, published separately as [`fmpsdk-mcp`](https://pypi.org/project/fmpsdk-mcp/) (so\n`pip install fmpsdk` never pulls in `fastmcp`). Lets an AI assistant (Claude Code, Claude\nDesktop, …) query FMP through this library: 10 curated tools for the common asks (quotes,\nprofiles, statements, ratios, price history, news) plus discovery tools that reach all\n~240 methods at runtime. With [`uv`](https://docs.astral.sh/uv/):\n\n```bash\nclaude mcp add fmpsdk -s user -e FMP_API_KEY=your-key -- uvx fmpsdk-mcp\n```\n\nSee [`mcp/README.md`](mcp/README.md) for the Claude Desktop config, the full tool list, and\ndevelopment setup.\n\n**[`openapi.json`](openapi.json) — an OpenAPI 3.1 description** of the same API surface.\nFMP publishes no OpenAPI/Swagger document; this file is *generated by introspecting this\nlibrary's source* (`python tools/gen_openapi.py`), not fetched from or endorsed by FMP.\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md) — dev setup, the unit/live/ultimate test tiers, and\nspecifically how to verify and PR a fix for the untested `tipranks` methods above.\n\n## License\nBSD 3-Clause — see [LICENSE.md](LICENSE.md).\n\n## Attribution\nSpecial thanks to the following people who have pitched in on this project!  Open source works thanks to people who \njump in and help!  These are this project's stars.  Thank you.\n  - [Ken Caruso](https://github.com/ipl31)\n  - [iforgotmypass](https://github.com/iforgotmypass)\n  - [Ivelin Ivanov](https://github.com/ivelin)\n  - Claude Code\n",
  "bytes": 7344,
  "sha": "70c549212d99f7e0266d15fbefd03cc57d392ae610bd998eef952bb40c6e25ed",
  "repo_slug": "daxm/fmpsdk",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_daxm_fmpsdk_mcp_876b4263/readme"
}