economic-calendar-fetcher
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEconomic Calendar Fetcher
经济日历获取工具
Overview
概述
Retrieve upcoming economic events and data releases from the Financial Modeling Prep (FMP) Economic Calendar API. This skill fetches scheduled economic indicators including central bank monetary policy decisions, employment reports, inflation data (CPI/PPI), GDP releases, retail sales, manufacturing data, and other market-moving events that impact financial markets.
The skill uses a Python script to query the FMP API and returns raw JSON or text output. The assistant then filters events, assesses market impact, and generates a chronological Markdown report for each scheduled event. No files are generated automatically.
Key Capabilities:
- Fetch economic events for specified date ranges (max 90 days)
- Support flexible API key provision (environment variable or CLI argument)
- Filter by impact level, country, or event type (filtering performed by the assistant)
- Present filtered results as structured Markdown reports with impact analysis (assistant-generated, not script-generated)
- Default to next 7 days for quick market outlook
Data Source:
- FMP Economic Calendar API:
https://financialmodelingprep.com/api/v3/economic_calendar - Covers major economies: US, EU, UK, Japan, China, Canada, Australia
- Event types: Central bank decisions, employment, inflation, GDP, trade, housing, surveys
从Financial Modeling Prep (FMP)经济日历API获取即将到来的经济事件和数据发布信息。该工具可获取预定的经济指标,包括央行货币政策决议、就业报告、通胀数据(CPI/PPI)、GDP发布、零售销售、制造业数据以及其他影响金融市场的事件。
本工具使用Python脚本查询FMP API,返回原始JSON或文本格式输出。随后由助手对事件进行过滤、评估市场影响,并按时间顺序为每个预定事件生成Markdown报告。不会自动生成文件。
核心功能:
- 获取指定日期范围内的经济事件(最长90天)
- 支持灵活的API密钥提供方式(环境变量或CLI参数)
- 可按影响级别、国家或事件类型过滤(由助手执行过滤)
- 将过滤结果整理为带影响分析的结构化Markdown报告(由助手生成,非脚本自动生成)
- 默认获取未来7天数据,快速查看市场前景
数据源:
- FMP经济日历API:
https://financialmodelingprep.com/api/v3/economic_calendar - 覆盖主要经济体:美国、欧盟、英国、日本、中国、加拿大、澳大利亚
- 事件类型:央行决议、就业、通胀、GDP、贸易、住房、调查类数据
When to Use This Skill
使用场景
Use this skill when the user requests:
-
Economic Calendar Queries:
- "What economic events are coming up this week?"
- "Show me the economic calendar for the next two weeks"
- "When is the next FOMC meeting?"
- "What major economic data is being released next month?"
-
Market Event Planning:
- "What should I watch for in the markets this week?"
- "Are there any high-impact economic releases coming?"
- "When is the next jobs report / CPI release / GDP report?"
-
Specific Date Range Requests:
- "Get economic events from January 1 to January 31"
- "What's on the economic calendar for Q1 2025?"
-
Country-Specific Queries:
- "Show me US economic data releases next week"
- "What ECB events are scheduled?"
- "When is Japan releasing their inflation data?"
DO NOT use this skill for:
- Past economic events (use market-news-analyst for historical analysis)
- Corporate earnings calendars (this skill excludes earnings)
- Real-time market data or live quotes
- Technical analysis or chart interpretation
当用户提出以下请求时,可使用本工具:
-
经济日历查询:
- "本周有哪些经济事件?"
- "显示未来两周的经济日历"
- "下一次FOMC会议是什么时候?"
- "下个月有哪些重要经济数据发布?"
-
市场事件规划:
- "本周市场需要关注什么?"
- "即将发布的高影响经济数据有哪些?"
- "下一次就业报告/CPI发布/GDP报告是什么时候?"
-
特定日期范围请求:
- "获取1月1日至1月31日的经济事件"
- "2025年第一季度的经济日历有什么内容?"
-
特定国家查询:
- "显示下周美国的经济数据发布"
- "欧盟央行有哪些预定事件?"
- "日本什么时候发布通胀数据?"
请勿用于:
- 过往经济事件(如需历史分析,请使用市场新闻分析工具)
- 企业盈利日历(本工具不包含盈利数据)
- 实时市场数据或行情报价
- 技术分析或图表解读
Prerequisites
前置条件
- FMP API Key (required): Sign up at https://financialmodelingprep.com for a free key (250 requests/day). Set via environment variable or pass
FMP_API_KEYto the script.--api-key - Python 3.10+: Required to run .
skills/economic-calendar-fetcher/scripts/get_economic_calendar.py - No third-party packages: The script uses only the Python standard library.
- FMP API密钥(必填): 访问https://financialmodelingprep.com注册免费账户(每日250次请求额度)。可通过`FMP_API_KEY`环境变量设置,或在运行脚本时通过`--api-key`参数传入。
- Python 3.10+: 运行所需版本。
skills/economic-calendar-fetcher/scripts/get_economic_calendar.py - 无需第三方包: 脚本仅使用Python标准库。
Workflow
工作流程
Follow these steps to fetch and analyze the economic calendar:
按照以下步骤获取并分析经济日历:
Step 1: Obtain FMP API Key
步骤1:获取FMP API密钥
Check for API key availability (in priority order):
- Recommended: Check if environment variable is set — this keeps the key out of session logs
FMP_API_KEY - Acceptable: Use CLI argument for one-off runs
--api-key - Not recommended: Asking the user to paste the key into chat — session logs may retain it
- If user doesn't have an API key, provide instructions:
- Visit https://financialmodelingprep.com
- Sign up for free account (250 requests/day limit)
- Navigate to API dashboard to obtain key
Example user interaction:
User: "Show me economic events for next week"
Assistant: "I'll fetch the economic calendar. I'll use the FMP_API_KEY environment variable if it's set. Otherwise, please pass the key via --api-key when running the script."按优先级检查API密钥可用性:
- 推荐方式: 检查是否已设置环境变量——此方式可避免密钥出现在会话日志中
FMP_API_KEY - 可接受方式: 一次性运行时使用CLI参数
--api-key - 不推荐方式: 让用户在聊天中粘贴密钥——会话日志可能会保留该密钥
- 如果用户没有API密钥,提供以下指导:
- 访问https://financialmodelingprep.com
- 注册免费账户(每日250次请求额度)
- 进入API控制台获取密钥
用户交互示例:
用户:"显示下周的经济事件"
助手:"我将为您获取经济日历。如果已设置FMP_API_KEY环境变量,我会直接使用;否则,请在运行脚本时通过--api-key参数传入密钥。"Step 2: Determine Date Range
步骤2:确定日期范围
Set appropriate date range based on user request:
Default (no specific dates): Today + 7 days
User specifies period: Use exact dates (validate format: YYYY-MM-DD)
Maximum range: 90 days (FMP API limitation)
Examples:
- "Next week" → Today to +7 days
- "Next two weeks" → Today to +14 days
- "January 2025" → 2025-01-01 to 2025-01-31
- "Q1 2025" → 2025-01-01 to 2025-03-31
Validate date range:
- Ensure start date ≤ end date
- Ensure range ≤ 90 days
- Warn if querying past dates
根据用户请求设置合适的日期范围:
默认(未指定日期): 今日至未来7天
用户指定时间段: 使用精确日期(验证格式:YYYY-MM-DD)
最大范围: 90天(FMP API限制)
示例:
- "下周" → 今日至未来7天
- "未来两周" → 今日至未来14天
- "2025年1月" → 2025-01-01至2025-01-31
- "2025年第一季度" → 2025-01-01至2025-03-31
日期范围验证:
- 确保开始日期≤结束日期
- 确保范围≤90天
- 若查询过往日期,需发出警告
Step 3: Execute API Fetch Script
步骤3:执行API获取脚本
Run the get_economic_calendar.py script with appropriate parameters:
Basic usage (default 7 days):
bash
python3 skills/economic-calendar-fetcher/scripts/get_economic_calendar.py --api-key YOUR_KEYWith specific date range:
bash
python3 skills/economic-calendar-fetcher/scripts/get_economic_calendar.py \
--from 2025-01-01 \
--to 2025-01-31 \
--api-key YOUR_KEY \
--format jsonUsing environment variable (no --api-key needed):
bash
export FMP_API_KEY=your_key_here
python3 skills/economic-calendar-fetcher/scripts/get_economic_calendar.py \
--from 2025-01-01 \
--to 2025-01-07Script parameters:
- : Start date (YYYY-MM-DD) - default: today
--from - : End date (YYYY-MM-DD) - default: today + 7 days
--to - : FMP API key (optional if FMP_API_KEY env var set)
--api-key - : Output format (json or text) - default: json
--format - : Output file path (optional, default: stdout)
--output
Handle errors:
- Invalid API key → Ask user to verify key
- Rate limit exceeded (429) → Suggest waiting or upgrading FMP tier
- Network errors → Check your connection and re-run the script
- Invalid date format → Provide correct format example
运行get_economic_calendar.py脚本并传入合适参数:
基础用法(默认7天):
bash
python3 skills/economic-calendar-fetcher/scripts/get_economic_calendar.py --api-key YOUR_KEY指定日期范围:
bash
python3 skills/economic-calendar-fetcher/scripts/get_economic_calendar.py \
--from 2025-01-01 \
--to 2025-01-31 \
--api-key YOUR_KEY \
--format json使用环境变量(无需--api-key参数):
bash
export FMP_API_KEY=your_key_here
python3 skills/economic-calendar-fetcher/scripts/get_economic_calendar.py \
--from 2025-01-01 \
--to 2025-01-07脚本参数:
- :开始日期(YYYY-MM-DD)- 默认:今日
--from - :结束日期(YYYY-MM-DD)- 默认:今日+7天
--to - :FMP API密钥(若已设置FMP_API_KEY环境变量则可选)
--api-key - :输出格式(json或text)- 默认:json
--format - :输出文件路径(可选,默认:标准输出)
--output
错误处理:
- 无效API密钥 → 请用户验证密钥
- 超出请求限制(429)→ 建议等待或升级FMP账户等级
- 网络错误 → 检查网络连接后重新运行脚本
- 无效日期格式 → 提供正确格式示例
Step 4: Parse and Filter Events
步骤4:解析并过滤事件
Process the JSON response from the script:
- Parse event data: Extract all events from API response
- Apply user filters if specified:
- Impact level: "High", "Medium", "Low"
- Country: "US", "EU", "JP", "CN", etc.
- Event type: FOMC, CPI, Employment, GDP, etc.
- Currency: USD, EUR, JPY, etc.
Filter examples:
- "Show only high-impact events" → Filter impact == "High"
- "US events only" → Filter country == "US"
- "Central bank decisions" → Search event name for "Rate", "Policy", "FOMC", "ECB", "BOJ"
Event data structure:
json
{
"date": "2025-01-15 14:30:00",
"country": "US",
"event": "Consumer Price Index (CPI) YoY",
"currency": "USD",
"previous": 2.6,
"estimate": 2.7,
"actual": null,
"change": null,
"impact": "High",
"changePercentage": null
}处理脚本返回的JSON响应:
- 解析事件数据: 从API响应中提取所有事件
- 若用户指定过滤条件,则应用过滤:
- 影响级别:"High"、"Medium"、"Low"
- 国家:"US"、"EU"、"JP"、"CN"等
- 事件类型:FOMC、CPI、Employment、GDP等
- 货币:USD、EUR、JPY等
过滤示例:
- "仅显示高影响事件" → 过滤impact == "High"
- "仅美国事件" → 过滤country == "US"
- "央行决议" → 在事件名称中搜索"Rate"、"Policy"、"FOMC"、"ECB"、"BOJ"
事件数据结构:
json
{
"date": "2025-01-15 14:30:00",
"country": "US",
"event": "Consumer Price Index (CPI) YoY",
"currency": "USD",
"previous": 2.6,
"estimate": 2.7,
"actual": null,
"change": null,
"impact": "High",
"changePercentage": null
}Step 5: Assess Market Impact
步骤5:评估市场影响
Evaluate the market significance of each event:
Impact Level Classification (from FMP):
-
High Impact: Major market-moving events
- FOMC rate decisions, ECB/BOJ policy meetings
- Non-Farm Payrolls (NFP), CPI, GDP
- Market typically shows 0.5-2%+ intraday volatility
-
Medium Impact: Significant but less volatile
- Retail Sales, Industrial Production
- PMI surveys, Consumer Confidence
- Housing data, Durable Goods Orders
-
Low Impact: Minor indicators
- Weekly jobless claims (unless extreme)
- Regional manufacturing surveys
- Minor auction results
Additional Context Factors:
-
Current Market Sensitivity:
- High inflation environment → CPI/PPI elevated importance
- Recession fears → Employment data more critical
- Rate cut speculation → Central bank meetings crucial
-
Surprise Potential:
- Compare estimate vs. previous reading
- Large expected changes = higher attention
- Consensus uncertainty = higher impact potential
-
Event Clustering:
- Multiple related events same day = amplified impact
- Example: CPI + Retail Sales + Fed speech = Very High impact day
-
Forward Significance:
- Does this event influence upcoming central bank decisions?
- Is this a preliminary or final reading?
- Will this data be revised?
评估每个事件的市场重要性:
影响级别分类(来自FMP):
-
高影响: 影响市场的重大事件
- FOMC利率决议、ECB/BOJ政策会议
- 非农就业数据(NFP)、CPI、GDP
- 市场通常会出现0.5-2%以上的日内波动
-
中影响: 重要但波动较小的事件
- 零售销售、工业生产
- PMI调查、消费者信心指数
- 住房数据、耐用品订单
-
低影响: 次要指标
- 每周初请失业金人数(除非数据极端)
- 地区制造业调查
- 次要拍卖结果
额外影响因素:
-
当前市场敏感度:
- 高通胀环境 → CPI/PPI的重要性提升
- 衰退担忧 → 就业数据更关键
- 降息预期 → 央行会议至关重要
-
超预期潜力:
- 对比预期值与前值
- 预期变化越大,关注度越高
- 市场共识不确定性越高,影响潜力越大
-
事件集中性:
- 同一天多个相关事件 → 影响被放大
- 示例:CPI + 零售销售 + 美联储讲话 → 极高影响日
-
前瞻性意义:
- 该事件是否会影响未来的央行决议?
- 这是初步数据还是最终数据?
- 数据是否会被修正?
Step 6: Generate Output Report
步骤6:生成输出报告
Responsibility: The script outputs raw JSON or text. This step is performed by the assistant using the script's output. No Markdown files are generated automatically; results are displayed in chat and can be saved toon request.reports/
Create structured markdown report with the following sections:
Report Header:
markdown
undefined说明: 脚本仅输出原始JSON或文本。此步骤由助手使用脚本输出完成,不会自动生成Markdown文件;结果将在聊天中展示,用户可请求保存至目录。reports/
创建结构化Markdown报告,包含以下部分:
报告头部:
markdown
undefinedEconomic Calendar
经济日历
Period: [Start Date] to [End Date]
Report Generated: [Timestamp]
Total Events: [Count]
High Impact Events: [Count]
**Event Listing (Chronological):**
For each event, provide:
```markdown时间段: [开始日期] 至 [结束日期]
报告生成时间: [时间戳]
总事件数: [数量]
高影响事件数: [数量]
**事件列表(按时间顺序):**
每个事件需包含:
```markdown[Date] - [Day of Week]
[日期] - [星期]
[Event Name] ([Impact Level])
[事件名称]([影响级别])
- Country: [Country Code] ([Currency])
- Time: [HH:MM UTC]
- Previous: [Value]
- Estimate: [Consensus Forecast]
- Impact Assessment: [Your analysis]
Market Implications:
[2-3 sentences on why this matters, what markets watch for, typical reaction patterns]
**Example Event Entry:**
```markdown- 国家: [国家代码]([货币])
- 时间: [HH:MM UTC]
- 前值: [数值]
- 预期值: [市场共识预测]
- 影响评估: [你的分析]
市场影响:
[2-3句话说明事件重要性、市场关注点、典型反应模式]
**事件示例:**
```markdown2025-01-15 - Wednesday
2025-01-15 - 星期三
Consumer Price Index (CPI) YoY (High Impact)
消费者价格指数(CPI)同比(高影响)
- Country: US (USD)
- Time: 14:30 UTC (8:30 AM ET)
- Previous: 2.6%
- Estimate: 2.7%
- Impact Assessment: Very High - Core inflation metric for Fed policy decisions
Market Implications:
CPI reading above estimate (>2.7%) likely strengthens hawkish Fed expectations, potentially pressuring equities and supporting USD. Reading at or below 2.7% could reinforce disinflation narrative and support risk assets. Options market pricing 1.2% S&P 500 move on release day.
**Summary Section:**
Add analytical summary at the end:
```markdown- 国家: US(USD)
- 时间: 14:30 UTC(美国东部时间8:30 AM)
- 前值: 2.6%
- 预期值: 2.7%
- 影响评估: 极高 - 美联储政策决策的核心通胀指标
市场影响:
若CPI读数高于预期(>2.7%),可能强化美联储鹰派预期,对股市形成压力并支撑美元;若读数等于或低于2.7%,则可能强化通胀放缓的叙事,提振风险资产。期权市场预计发布日标普500指数波动约1.2%。
**总结部分:**
在报告末尾添加分析总结:
```markdownKey Takeaways
关键要点
Highest Impact Days:
- [Date]: [Events] - [Combined impact rationale]
- [Date]: [Events] - [Combined impact rationale]
Central Bank Activity:
- [Summary of any scheduled Fed/ECB/BOJ meetings or speeches]
Major Data Releases:
- Employment: [NFP, Unemployment Rate dates]
- Inflation: [CPI, PPI dates]
- Growth: [GDP, Retail Sales dates]
Market Positioning Considerations:
[2-3 bullets on how traders might position around these events]
Risk Events:
[Highlight any particularly high-uncertainty or surprise-potential events]
**Filtering Notes:**
If user requested specific filters, note at top:
```markdown
**Filters Applied:**
- Impact Level: High only
- Country: US
- Events shown: [X] of [Y] total events in date rangeOutput:
- Results are displayed in chat. No files are generated automatically.
- To save raw JSON/text data: use when running the script.
--output reports/economic_calendar_[START]_to_[END].json - To save the Markdown report: ask the assistant to write it to after generating it in chat.
reports/
最高影响日期:
- [日期]:[事件] - [综合影响理由]
- [日期]:[事件] - [综合影响理由]
央行动态:
- [美联储/欧央行/日央行等预定会议或讲话摘要]
主要数据发布:
- 就业:[非农就业、失业率日期]
- 通胀:[CPI、PPI日期]
- 增长:[GDP、零售销售日期]
市场仓位建议:
[2-3条关于交易者如何围绕这些事件布局的建议]
风险事件:
[特别强调不确定性高或超预期潜力大的事件]
**过滤说明:**
若用户指定了过滤条件,请在报告顶部注明:
```markdown
**已应用过滤条件:**
- 影响级别:仅高影响
- 国家:美国
- 显示事件数:[X](日期范围内共[Y]个事件)输出方式:
- 结果在聊天中展示,不会自动生成文件。
- 如需保存原始JSON/文本数据:运行脚本时使用参数。
--output reports/economic_calendar_[START]_to_[END].json - 如需保存Markdown报告:在助手生成报告后,请求助手将其写入目录。
reports/
Assistant-Generated Report Format
助手生成报告格式要求
Markdown structure requirements:
- Chronological ordering: Events sorted by date and time (earliest first)
- Impact level indicators: Use (High Impact), (Medium Impact), (Low Impact) labels
- Time zone clarity: Always specify UTC; ET/PT conversions are performed by the assistant based on US DST calendar
- Data completeness: Include all available fields (previous, estimate, actual if past)
- Null handling: Display "N/A" or "No estimate" for null values
- Impact assessment: Every high/medium impact event must have market implications analysis
Table format option (for dense listings):
markdown
| Date/Time (UTC) | Event | Country | Impact | Previous | Estimate | Assessment |
|-----------------|-------|---------|--------|----------|----------|------------|
| 01-15 14:30 | CPI YoY | US | High | 2.6% | 2.7% | Core inflation metric |Language: All reports in English
Markdown结构要求:
- 时间顺序: 事件按日期和时间排序(最早的在前)
- 影响级别标识: 使用(高影响)、(中影响)、(低影响)标签
- 时区明确: 始终标注UTC时间;助手将根据美国夏令时日历转换为ET/PT时间
- 数据完整性: 包含所有可用字段(前值、预期值,若为过往事件则包含实际值)
- 空值处理: 空值显示为"N/A"或"无预期值"
- 影响评估: 所有高/中影响事件必须包含市场影响分析
表格格式选项(用于密集列表):
markdown
| 日期/时间(UTC) | 事件 | 国家 | 影响 | 前值 | 预期值 | 评估 |
|-----------------|-------|---------|--------|----------|----------|------------|
| 01-15 14:30 | CPI同比 | US | 高 | 2.6% | 2.7% | 核心通胀指标 |语言: 所有报告使用英文
Resources
资源
Python Script:
- : Main API fetch script with CLI interface
skills/economic-calendar-fetcher/scripts/get_economic_calendar.py
Reference Documentation:
- : Complete FMP Economic Calendar API reference
references/fmp_api_documentation.md- Authentication and API key management
- Request parameters and date formats
- Response field definitions
- Rate limits and error handling
- Best practices for caching and efficiency
API Details:
- Endpoint:
https://financialmodelingprep.com/api/v3/economic_calendar - Authentication: API key required (free tier: 250 requests/day)
- Max date range: 90 days per request
- Response format: JSON array of event objects
- Rate limits: 5 requests/second (free tier)
Event Coverage:
- Major economies: US, EU, UK, Japan, China, Canada, Australia, Switzerland
- Event categories: Monetary policy, Employment, Inflation, GDP, Trade, Housing, Surveys
- Update frequency: Real-time (events added/updated as scheduled)
- Historical data: Available for past events with actual values
Usage Tips:
- Cache results to minimize API calls (events rarely change once scheduled)
- Query 7-30 day ranges for optimal request efficiency
- Don't query >6 months in future (sparse data, speculative dates)
- Refresh cache daily for upcoming week to catch time changes
- Use smaller ranges (1-7 days) for real-time event monitoring
Error Handling:
- API key errors: Clear user guidance for obtaining free key
- Rate limits (429): Suggest waiting or upgrading FMP tier; re-run the script after the wait
- Network failures: Check connection and re-run; no automatic retry or cache in the script
- Invalid dates: Validation with helpful error messages
Python脚本:
- :带CLI接口的主API获取脚本
skills/economic-calendar-fetcher/scripts/get_economic_calendar.py
参考文档:
- :完整的FMP经济日历API参考
references/fmp_api_documentation.md- 认证与API密钥管理
- 请求参数与日期格式
- 响应字段定义
- 请求限制与错误处理
- 缓存与效率最佳实践
API详情:
- 端点:
https://financialmodelingprep.com/api/v3/economic_calendar - 认证:需API密钥(免费账户:每日250次请求)
- 最大日期范围:每次请求90天
- 响应格式:事件对象的JSON数组
- 请求限制:免费账户每秒5次请求
事件覆盖范围:
- 主要经济体:美国、欧盟、英国、日本、中国、加拿大、澳大利亚、瑞士
- 事件类别:货币政策、就业、通胀、GDP、贸易、住房、调查类
- 更新频率:实时(事件会随日程安排添加/更新)
- 历史数据:包含过往事件的实际值
使用技巧:
- 缓存结果以减少API调用次数(日程确定后事件很少更改)
- 查询7-30天范围以优化请求效率
- 不要查询未来6个月以上的数据(数据稀疏,日期具有推测性)
- 每日刷新未来一周的缓存以获取时间变更
- 监控实时事件时使用更小的范围(1-7天)
错误处理:
- API密钥错误:提供清晰的免费密钥获取指导
- 请求限制(429):建议等待或升级FMP账户等级;等待后重新运行脚本
- 网络故障:检查连接后重新运行;脚本无自动重试或缓存机制
- 无效日期:提供有用的错误提示和正确格式示例