Building with the API? Open the developer docs
Finmagine API & MCP — free tier to test • Pro/Max for full access • REST + MCP
Master openapi.json and the API Reference page through a complete learning overview and interactive flashcards
Both llms.txt and agent-recipes.json point here for a reason: openapi.json is the single source of truth every other Finmagine developer resource is generated from or defined against. This guide takes you inside the actual file, shows how a single operation is described end to end, and explains the discipline that keeps it from ever drifting out of sync with the code it documents.
Click any card to reveal the answer. Use the search box to find a specific topic.
Finmagine's developer surface has a machine-readable contract and a human-readable reference page, and it's worth being precise about which is which before going further — they're often conflated but they serve different readers.
| File / Page | Format | Reader | Source of Truth? |
|---|---|---|---|
/openapi.json | OpenAPI 3.1 JSON | Machines — codegen tools, OpenAPI-compatible clients, agent frameworks | Yes — everything else is generated from or defined against it |
/developer/api-reference.php | Rendered HTML | Humans — developers reading in a browser | No — rendered live from openapi.json, never hand-authored |
developer/api-reference.php's source and you'll find almost no HTML for the actual endpoint listings — just a call to a renderer function that reads openapi.json at request time and builds the sidebar, tier chips, and parameter tables from it. If openapi.json is missing or fails to parse, the page shows an explicit "temporarily unavailable" notice rather than falling back to stale, hand-typed content.
Finmagine's spec is standard OpenAPI 3.1 — any tool that already knows how to read an OpenAPI document can read this one without special handling. Here's the top-level shape:
Three things worth noticing:
apiKeyHeader (X-Api-Key), bearerAuth (Authorization: Bearer), and apiKeyQuery (?apiKey=) are all listed as valid — any one authenticates the same key, useful because some MCP clients only support Bearer auth while REST tooling often prefers a header.x-rate-limits is the machine-readable twin of the pricing guide. The exact numbers from Understanding API & MCP Pricing Tiers live here too — an agent doesn't need to scrape a pricing page to know its limits, it can read them directly from the spec it already loaded.x-mcp-only-tools flags the one operation with no REST equivalent. screen_natural_language exists only as an MCP tool — there's no /screener/nl REST path, because natural-language parsing is inherently an LLM-in-the-loop operation.Here's a real, complete operation from the live spec — get_momentum, one of the technical-analysis tools:
| Field | What it's for |
|---|---|
operationId | The stable identifier — also doubles as the MCP tool name whenever a REST/MCP pair exists |
x-tier | Minimum tier required — free, api_pro, or api_max — the exact field the pricing guide explains in depth |
x-mcp-tool | The corresponding MCP tool name, or null for REST-only operations like /status |
x-anchor | A stable anchor ID used to deep-link from other pages straight to this operation's section on the API Reference page |
x-response-fields | A curated (not exhaustive) list of the most important response fields and what they mean — enough for an agent to know what to look for without guessing from a raw JSON blob |
x- is a Finmagine-specific OpenAPI extension. That's the standard, spec-compliant way to add custom metadata to an OpenAPI document — any generic OpenAPI tool will simply ignore fields it doesn't recognise, while Finmagine's own renderer and generator scripts read them directly.
The single most important design decision behind openapi.json isn't a field — it's how the x-tier value on every operation gets set. It is not hand-typed anywhere. The generator script that builds openapi.json regex-scans each REST handler file's actual source code, every time it runs, looking for the real function calls that enforce access:
If a handler calls requireMaxTier(), that operation is classified x-tier: api_max in the generated spec — automatically, from the code that actually enforces it, not from a person remembering to update a table somewhere.
routes.php every single generation run, not to hope future edits remember to update a hand-typed number.
The practical result: if you ever see a mismatch between what the API Reference page says a tier requires and what the live endpoint actually enforces, that's a bug to report — by construction, the spec should always match the code, because it's derived from the code, not from someone's memory of the code.
The full spec is comprehensive but sizeable — everything an agent needs for one specific call, plus a lot it doesn't. openapi-compact.json strips each of the 86 operations down to just what's needed for routing:
The API Reference page is what most human developers actually read — a sidebar-navigated, market-tabbed (🇮🇳 India / 🇺🇸 US) HTML rendering of the exact same 86 operations, generated fresh from openapi.json on every request.
x-anchorIf openapi.json can't be read or fails to parse, the page shows an explicit "API reference temporarily unavailable" notice and points to the narrative docs instead — it never silently falls back to a cached or hand-typed copy that could go stale without anyone noticing.
Because the spec is standard OpenAPI 3.1 with no proprietary format, several practical paths open up beyond just reading the reference page:
https://finmagine.com/openapi.json and produce typed request/response models for your language of choice, without hand-transcribing 86 endpoint signatures.This closes out Wave 1 — Discovery & Orientation. With llms.txt (how agents find Finmagine), pricing tiers (what they're allowed to call), and openapi.json (the exact contract for every call), the next wave moves into hands-on tools:
See the API & Agent Integration hub for the full 12-guide roadmap.
Finmagine gives you 30+ computed financial ratios, sector benchmarks, FII/DII flows, the Finmagine Score, and AI-powered analysis — all in one place.