FMP API Implementation GuideFMP API 实施指南

FMP Earnings Calendar API
Python Example & Workflow
FMP 财报日历 API
Python 示例与生产工作流

Fetch earnings events with Python, preserve revisions, normalize sessions and fiscal periods, and validate every alert before production use.

使用 Python 获取财报事件,保留修订历史,统一发布时段与财务期间,并在生产使用前验证每条提醒。

FMP Earnings Calendar API workflow showing event fetching, timezone normalization, deduplication, enrichment, alerts, and reliability checks
Quick answer

TL;DR

Endpoint

Use FMP's stable /stable/earnings-calendar endpoint with an API key and explicit from/to dates. FMP specifically recommends a date window when requesting future events.

Do not treat the calendar as immutable

Dates, BMO/AMC timing, EPS estimates, revenue estimates, and event availability may change. Keep snapshots and compare revisions instead of overwriting the only record.

Normalize before alerting

Map provider symbols to stable security identity, separate event date from fiscal period, preserve the provider session label, and attach retrieval time and validation status.

Production boundary

The calendar tells you what is scheduled or reported; it does not prove an exchange-local timestamp, filing publication time, or final company confirmation unless those are validated separately.

接口

使用 FMP Stable API 的 /stable/earnings-calendar,携带 API Key 和明确的 from/to 日期。FMP 特别说明,查询未来事件时应提供日期窗口。

不要把日历视为不可变数据

日期、盘前/盘后时段、EPS 预估、营收预估和事件可用性都可能变化。应保存快照并比较修订,而不是覆盖唯一记录。

提醒前先标准化

把服务商股票代码映射到稳定证券身份,分离事件日期和财务期间,保留服务商时段标签,并附加获取时间与验证状态。

生产边界

日历说明计划或已披露事件,但不能自动证明交易所本地精确时间、文件发布时间或公司最终确认状态,这些需要单独验证。

Recommended pattern: fetch a bounded window, store the raw payload, normalize each record into your own event schema, diff it against the prior snapshot, and emit alerts only from accepted changes.

推荐模式:获取有限日期窗口,保存原始响应,把记录转换为自己的事件 Schema,与上一版快照比较,只根据通过验证的变化发送提醒。

Who this is for适用对象

Prerequisites and architecture boundary准备工作与架构边界

This implementation is for research dashboards, portfolio calendars, earnings-monitoring agents, and pre/post-event workflows. You need an FMP API key, an allowed plan, a date-window policy, secure secret storage, and a destination such as a database or queue.

本实施方案适用于研究看板、投资组合日历、财报监控 Agent,以及财报前后工作流。需要准备 FMP API Key、允许访问该接口的套餐、日期窗口策略、安全密钥存储,以及数据库或队列等输出位置。

Credentials

Store FMP_API_KEY in a secret manager or environment variable. Never embed it in browser JavaScript, source control, screenshots, logs, or agent prompts.

Window policy

Choose a bounded UTC date range, for example today through the next seven days. Smaller repeatable windows simplify retries and revision detection.

Identity store

Maintain a security master that maps symbol, exchange, issuer, security, and identifier history. A ticker alone is not a durable key.

Scheduler and state

Use a scheduler for repeat retrieval and persist the previous snapshot or hash. Without state, the system cannot distinguish a new event from a revised event.

凭证

FMP_API_KEY 存入密钥管理器或环境变量,不能放进浏览器 JavaScript、代码仓库、截图、日志或 Agent Prompt。

日期窗口策略

使用有限的 UTC 日期范围,例如今天到未来七天。较小且可重复的窗口更便于重试和识别修订。

身份库

维护证券主数据,映射股票代码、交易所、发行人、证券及标识符历史。股票代码本身不是持久主键。

调度与状态

通过调度器重复获取,并保存上一版快照或哈希。没有状态,就无法区分新增事件与修订事件。

Step-by-step request分步请求

FMP Earnings Calendar API Python exampleFMP 财报日历 API Python 示例

The official stable endpoint is https://financialmodelingprep.com/stable/earnings-calendar. The example below supplies an API key and explicit date window, raises on HTTP errors, validates the JSON shape, and never logs the credential.

官方 Stable API 路径是 https://financialmodelingprep.com/stable/earnings-calendar。下面的示例携带 API Key 和明确日期窗口,对 HTTP 错误直接失败,验证 JSON 结构,并且不记录密钥。

import os
from datetime import date, timedelta

import requests

API_URL = "https://financialmodelingprep.com/stable/earnings-calendar"
API_KEY = os.environ["FMP_API_KEY"]

start = date.today()
end = start + timedelta(days=7)

response = requests.get(
    API_URL,
    params={
        "from": start.isoformat(),
        "to": end.isoformat(),
        "apikey": API_KEY,
    },
    timeout=(3.05, 20),
)
response.raise_for_status()

events = response.json()
if not isinstance(events, list):
    raise ValueError("Expected the FMP earnings calendar to return a list")

print(f"received {len(events)} earnings events")
Production note: add bounded retries for transient 5xx responses, but do not retry every 4xx response. Treat 401/403 as credential or plan issues and 429 as capacity pressure that should respect provider retry guidance.
生产提示:可以对临时 5xx 错误进行有限次数重试,但不能重试所有 4xx。401/403 通常表示凭证或套餐问题;429 表示容量压力,应遵循服务商的重试指引。
Response contract响应契约

Understand the response before writing business logic编写业务逻辑前先理解返回字段

FMP documents announcement date, estimated EPS, and actual EPS as core earnings-calendar data. Its related earnings documentation also describes release-session labels such as before market open (BMO) and after market close (AMC), while the changelog records fields including fiscalDateEnding and updatedFromDate. Inspect the live payload available to your plan before relying on any field.

FMP 官方文档把公告日期、预估 EPS 和实际 EPS 作为财报日历核心数据;相关财报文档还说明了盘前(BMO)和盘后(AMC)等发布时段,Changelog 则记录了 fiscalDateEndingupdatedFromDate 等字段。依赖任何字段前,都要检查当前套餐实际返回的数据。

Field concept字段概念Use用途Do not assume不能默认
symbolProvider-facing security lookup服务商侧证券查询A permanent global identity永久的全球身份
dateScheduled or reported calendar date计划或已报告日历日期An exchange-local exact timestamp交易所本地精确时间戳
time / sessionBMO, AMC, or other provider timing labelBMO、AMC 或其他服务商时段标签A precise clock time精确时钟时间
epsEstimated / epsExpected and actual EPS when available可用时的预估与实际 EPSThat missing actual EPS means zero实际 EPS 缺失等于零
revenueEstimated / revenueExpected and actual revenue when returned返回时的预估与实际营收Consistent currency and scale without validation无需验证即可确定币种与尺度一致
fiscalDateEndingThe fiscal period associated with the event事件对应的财务期末The same thing as announcement date与公告日期相同
updatedFromDateProvider update context when present存在时表示服务商更新上下文A complete revision audit trail by itself它本身就是完整修订审计记录
Canonical schema统一 Schema

Normalize event date, fiscal period, session, and estimates统一事件日期、财务期间、发布时段与预估值

Keep the raw FMP record unchanged, then create a separate canonical event. A normalized record should make uncertainty visible instead of turning a date or BMO/AMC label into a false exact timestamp.

原始 FMP 记录应保持不变,再单独生成统一事件。标准化记录应该显式表达不确定性,而不是把日期或 BMO/AMC 标签伪装成精确时间戳。

{
  "event_id": "earnings:security-123:2026-08-06",
  "issuer_id": "issuer-123",
  "security_id": "security-123",
  "symbol_as_reported": "EXAMPLE",
  "event_date": "2026-08-06",
  "release_session": "after_market_close",
  "release_time_precision": "session_only",
  "exchange_timezone": "America/New_York",
  "fiscal_period_end": "2026-06-30",
  "eps_estimate": 1.23,
  "eps_actual": null,
  "revenue_estimate": null,
  "revenue_actual": null,
  "provider": "financial_modeling_prep",
  "retrieved_at": "2026-08-03T08:00:00Z",
  "validation_status": "accepted_with_unknowns",
  "raw_record_hash": "sha256:..."
}
Identity: resolve issuer, security, exchange, and symbol history before joining portfolio positions.
Time: preserve event date, provider session, exchange timezone, fiscal period end, and retrieval time separately.
Numbers: distinguish estimate, actual, null, zero, currency, and unit scale.
Evidence: store provider, request window, raw hash, retrieval status, and transformation version.
身份:关联投资组合持仓前,先解析发行人、证券、交易所和代码历史。
时间:分别保存事件日期、服务商时段、交易所时区、财务期末和获取时间。
数值:区分预估、实际、null、零、币种和单位尺度。
证据:保存服务商、请求窗口、原始哈希、获取状态和转换版本。
Production workflow生产工作流

Step-by-step earnings monitoring implementation分步构建财报监控工作流

1. Fetch a rolling window

Retrieve a small overlap around the target period—for example yesterday through the next seven days—so delayed jobs do not create silent gaps.

2. Capture raw evidence

Before transformation, store request parameters, HTTP status, retrieval time, response hash, and the raw record or an immutable object reference.

3. Normalize identity and time

Resolve the symbol, map BMO/AMC to controlled session values, attach exchange timezone, and keep fiscal period distinct from event date.

4. Deduplicate by event identity

Use security identity plus event date and fiscal period. Do not deduplicate only on symbol or only on date.

5. Diff against the previous snapshot

Classify new, removed, rescheduled, session-changed, estimate-revised, and actual-reported events. Preserve both old and new values.

6. Emit idempotent actions

Generate one event key per accepted change so retries do not send duplicate notifications or trigger the same downstream job twice.

1. 获取滚动窗口

在目标期间前后保留少量重叠,例如昨天到未来七天,避免调度延迟造成静默缺口。

2. 留存原始证据

转换前保存请求参数、HTTP 状态、获取时间、响应哈希,以及原始记录或不可变对象引用。

3. 统一身份和时间

解析股票代码,把 BMO/AMC 映射为受控时段值,附加交易所时区,并把财务期间与事件日期分开。

4. 按事件身份去重

使用证券身份、事件日期与财务期间组合去重,不能只看股票代码或日期。

5. 与上一版快照比较

分类新增、移除、改期、时段变化、预估修订和实际值发布事件,并保留变化前后的值。

6. 幂等触发下游动作

为每个通过验证的变化生成唯一事件 Key,避免重试造成重复提醒或重复运行下游任务。

Validation checklist验证清单

Validate each event before it reaches an alert or agent事件进入提醒或 Agent 前必须逐项验证

Window: requested from/to dates are valid, bounded, ordered, and cover the intended UTC days.
Payload: response is a JSON list; each accepted item has a usable symbol and event date.
Identity: symbol maps to the intended listing and security; ambiguous or stale mappings are quarantined.
Session: BMO, AMC, or unknown is preserved; unknown is not silently converted into market open.
Fiscal period: fiscal period end is not replaced by announcement date and incompatible quarters are flagged.
Estimate semantics: null remains unknown; zero remains zero; actual and estimate are never swapped.
Revision: date, session, EPS, revenue, and removal changes create versioned records with reason codes.
Freshness: retrieval time and previous successful run are within the workload's freshness budget.
窗口:from/to 日期有效、有限、有序,并覆盖预期 UTC 日期。
响应:返回值是 JSON 列表;每条接受记录都包含可用股票代码和事件日期。
身份:代码映射到预期上市证券;存在歧义或过期映射的记录进入隔离区。
时段:保留 BMO、AMC 或 unknown,不能把 unknown 静默转换成开盘时间。
财务期间:不能用公告日期替代财务期末,不兼容季度必须标记。
预估语义:null 保持未知,零保持零,实际值与预估值不能互换。
修订:日期、时段、EPS、营收和移除变化生成带原因码的版本记录。
新鲜度:获取时间和最近成功运行必须满足工作负载的新鲜度预算。
Security, cost, and latency安全、成本与延迟

Control API keys, rate limits, caching, and alert load控制 API Key、限流、缓存与提醒负载

Control控制项Recommended implementation推荐实现Failure prevented避免的问题
Secret handling密钥管理Server-side secret store, rotation, least privilege, redacted logs服务端密钥库、轮换、最小权限和日志脱敏Credential leakage and uncontrolled use凭证泄露与失控调用
Bounded windows有限窗口Small rolling range with intentional overlap带少量重叠的滚动日期范围Wasteful requests and missed events请求浪费与遗漏事件
Cache policy缓存策略Cache raw window responses; invalidate by schedule and revision needs缓存原始窗口响应;按调度与修订需求失效Duplicate calls and inconsistent readers重复调用与读取不一致
Backoff退避Jittered bounded retry for transient errors; respect 429 guidance临时错误采用带抖动的有限重试;遵循 429 指引Retry storms and quota exhaustion重试风暴与配额耗尽
Alert fan-out提醒扩散Queue accepted changes and deduplicate by event version把已接受变化放入队列,并按事件版本去重Duplicate messages and downstream spikes重复消息与下游流量峰值

Do not hardcode plan quotas in application logic or this guide. Verify current endpoint access, call limits, commercial rights, and pricing in FMP's official plan documentation before deployment.

不要在应用逻辑或本指南中写死套餐配额。部署前应在 FMP 官方套餐文档中核对当前接口访问权、调用限制、商业使用权和价格。

Troubleshooting故障排查

Common FMP earnings calendar failure modesFMP 财报日历常见失败模式

No future events are returned

Supply both from and to, verify ISO dates and API-key access, and test a wider known earnings window. FMP's help content specifically calls out the need for a date range.

The same company appears twice

Check multiple listings, duplicate provider records, rescheduled events, and fiscal-period differences. Resolve security identity before deduplication.

An event moves from one day to another

Treat this as a revision, not delete-plus-new noise. Link old and new versions, record detection time, and withdraw obsolete scheduled alerts.

BMO/AMC creates a wrong timestamp

A session label is not an exact time. Keep session-only precision and apply the listing exchange's timezone and calendar only when scheduling a local operational window.

Actual values remain null

Null means unavailable at that retrieval time, not zero. Schedule post-release refreshes and record when the actual first appears.

The API suddenly returns 401, 403, or 429

Separate authentication, subscription access, and rate-limit handling. Do not hide these conditions behind an empty calendar result.

没有返回未来事件

同时提供 fromto,验证 ISO 日期和 API Key 权限,并测试一个已知包含财报的更宽窗口。FMP 帮助内容明确指出查询未来事件需要日期范围。

同一公司出现两次

检查多地上市、服务商重复记录、事件改期和财务期间差异,去重前先解析证券身份。

事件从一天移动到另一天

把它视为修订,而不是无意义的删除加新增。关联新旧版本,记录发现时间,并撤销旧提醒。

BMO/AMC 生成了错误时间戳

时段标签不是精确时间。保留 session-only 精度,只在安排本地操作窗口时应用上市交易所的时区与日历。

实际值一直为 null

null 表示本次获取时不可用,不是零。安排财报发布后的再次获取,并记录实际值首次出现时间。

接口突然返回 401、403 或 429

分别处理认证、套餐权限和限流,不能把这些错误伪装成空日历。

QVeris implementation pattern

Where QVeris fits in an earnings workflowQVeris 在财报工作流中的位置

FMP is the data provider for this calendar endpoint. QVeris can help an agent discover and inspect related financial, transcript, filing, news, and notification capabilities before calling them. Your application still owns credentials, the normalized event store, licensing checks, revision logic, validation, and alert policy.

FMP 是该日历接口的数据服务商。QVeris 可以帮助 Agent 在调用前发现并检查相关金融、电话会、申报文件、新闻和通知能力;凭证、统一事件库、许可检查、修订逻辑、验证和提醒策略仍由应用负责。

Discover

Find calendar, transcript, filing, press-release, quote, and notification capabilities based on the workflow goal.

Inspect

Review schema, provider, cost, latency, date coverage, and required parameters before execution.

Call and preserve evidence

Execute the selected capability and retain request parameters, provider trace, retrieval time, status, and raw evidence.

Validate and orchestrate

Normalize into the event contract, compare revisions, then trigger watchlists, post-release retrieval, variance checks, or human review.

Discover:发现

根据工作流目标查找日历、电话会、申报文件、新闻稿、行情和通知能力。

Inspect:检查

执行前检查 Schema、服务商、成本、延迟、日期覆盖与必填参数。

Call:调用并留证

执行所选能力,保留请求参数、服务商追踪、获取时间、状态和原始证据。

Validate:验证并编排

转换到统一事件契约,比较修订,再触发观察列表、财报后获取、差异检查或人工复核。

FAQ

FMP Earnings Calendar API FAQFMP 财报日历 API 常见问题

What is the FMP Earnings Calendar API endpoint?

FMP documents the stable endpoint as https://financialmodelingprep.com/stable/earnings-calendar. Supply an API key and an explicit from/to date window, especially for future events.

Why are no future earnings returned?

FMP states that future events require both from and to parameters. Also verify date formatting, API-key access, subscription coverage, and whether the window contains scheduled reports.

Are earnings dates and estimates final?

No. Dates, sessions, EPS estimates, and revenue estimates can change. Store retrieval time and a version or hash, then compare snapshots rather than overwriting the only copy.

How should BMO and AMC be handled?

Treat them as sessions, not precise timestamps. Preserve the provider value, map it to a controlled enum, and use the exchange calendar and timezone when scheduling alerts.

Can an AI agent use the calendar directly?

Yes, but it should consume validated normalized records rather than unchecked raw data. Preserve source, retrieval time, event status, estimates, fiscal period, and revision history.

FMP 财报日历 API 的接口是什么?

FMP 官方 Stable API 路径是 https://financialmodelingprep.com/stable/earnings-calendar。应携带 API Key 和明确的 from/to 日期窗口,特别是查询未来事件时。

为什么没有返回未来财报?

FMP 说明查询未来事件需要同时提供 from 和 to。还要检查日期格式、API Key 权限、套餐覆盖,以及窗口内是否确有计划财报。

财报日期和预估值是最终值吗?

不是。日期、发布时段、EPS 预估和营收预估都可能变化。应保存获取时间与版本或哈希,并比较快照,而不是覆盖唯一记录。

应该如何处理 BMO 和 AMC?

把它们视为时段,而不是精确时间戳。保留服务商原始值,映射到受控枚举,并在安排提醒时结合交易所日历与时区。

AI Agent 能直接使用财报日历吗?

可以,但应读取经过验证和标准化的记录,而不是未经检查的原始数据。需要保留来源、获取时间、事件状态、预估值、财务期间与修订历史。

Official sources官方资料

Verify the endpoint, changes, timing, and access核对接口、变更、更新时间与访问权限

FMP documentation is the source of truth for current parameters, fields, cycle times, access tiers, and commercial terms. Re-run contract tests when FMP changes the stable endpoint or response schema.

当前参数、字段、更新周期、访问套餐与商业条款应以 FMP 官方文档为准。Stable API 或返回 Schema 发生变化时,应重新运行契约测试。