Economic 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 generates chronological markdown reports with impact assessment for each scheduled event.
Key Capabilities:
- - Fetch economic events for specified date ranges (max 90 days)
- Support flexible API key provision (environment variable or user input)
- Filter by impact level, country, or event type
- Generate structured markdown reports with impact analysis
- Default to next 7 days for quick market outlook
Data Source:
- - FMP Economic Calendar API: INLINECODE0
- Covers major economies: US, EU, UK, Japan, China, Canada, Australia
- Event types: Central bank decisions, employment, inflation, GDP, trade, housing, surveys
When to Use This Skill
Use this skill when the user requests:
- 1. 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?"
- 2. 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?"
- 3. Specific Date Range Requests:
- "Get economic events from January 1 to January 31"
- "What's on the economic calendar for Q1 2025?"
- 4. 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
Workflow
Follow these steps to fetch and analyze the economic calendar:
Step 1: Obtain FMP API Key
Check for API key availability:
- 1. First check if FMPAPIKEY environment variable is set
- If not available, ask user to provide API key via chat
- If user doesn't have 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:
CODEBLOCK0
Step 2: Determine Date Range
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
Step 3: Execute API Fetch Script
Run the geteconomiccalendar.py script with appropriate parameters:
Basic usage (default 7 days):
CODEBLOCK1
With specific date range:
CODEBLOCK2
Using environment variable (no --api-key needed):
CODEBLOCK3
Script parameters:
- -
--from: Start date (YYYY-MM-DD) - default: today - INLINECODE2 : End date (YYYY-MM-DD) - default: today + 7 days
- INLINECODE3 : FMP API key (optional if FMPAPIKEY env var set)
- INLINECODE4 : Output format (json or text) - default: json
- INLINECODE5 : Output file path (optional, default: stdout)
Handle errors:
- - Invalid API key → Ask user to verify key
- Rate limit exceeded (429) → Suggest waiting or upgrading FMP tier
- Network errors → Retry with exponential backoff
- Invalid date format → Provide correct format example
Step 4: Parse and Filter Events
Process the JSON response from the script:
- 1. 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:
CODEBLOCK4
Step 5: Assess Market Impact
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:
- 1. Current Market Sensitivity:
- High inflation environment → CPI/PPI elevated importance
- Recession fears → Employment data more critical
- Rate cut speculation → Central bank meetings crucial
- 2. Surprise Potential:
- Compare estimate vs. previous reading
- Large expected changes = higher attention
- Consensus uncertainty = higher impact potential
- 3. Event Clustering:
- Multiple related events same day = amplified impact
- Example: CPI + Retail Sales + Fed speech = Very High impact day
- 4. Forward Significance:
- Does this event influence upcoming central bank decisions?
- Is this a preliminary or final reading?
- Will this data be revised?
Step 6: Generate Output Report
Create structured markdown report with the following sections:
Report Header:
CODEBLOCK5
Event Listing (Chronological):
For each event, provide:
CODEBLOCK6
Example Event Entry:
CODEBLOCK7
Summary Section:
Add analytical summary at the end:
CODEBLOCK8
Filtering Notes:
If user requested specific filters, note at top:
CODEBLOCK9
Output Format:
- - Primary: Markdown file saved to disk
- Filename format: INLINECODE6
- Also display summary to user in chat
Output Format Specifications
File naming convention:
CODEBLOCK10
Markdown structure requirements:
- 1. 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 and provide ET/PT conversions for US events
- 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):
CODEBLOCK11
Language: All reports in English
Resources
Python Script:
- -
scripts/get_economic_calendar.py: Main API fetch script with CLI interface
Reference Documentation:
- -
references/fmp_api_documentation.md: Complete FMP Economic Calendar API reference
- 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: INLINECODE9
- 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:
- 1. 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: Exponential backoff retry logic
- Network failures: Graceful degradation with cached data if available
- Invalid dates: Validation with helpful error messages
经济日历获取工具
概述
从金融建模预备(FMP)经济日历API检索即将发生的经济事件和数据发布。该技能获取计划中的经济指标,包括央行货币政策决策、就业报告、通胀数据(CPI/PPI)、GDP发布、零售销售、制造业数据以及其他影响金融市场的市场驱动事件。
该技能使用Python脚本查询FMP API,并为每个计划事件生成带有影响评估的时间顺序Markdown报告。
关键能力:
- - 获取指定日期范围(最长90天)的经济事件
- 支持灵活的API密钥提供方式(环境变量或用户输入)
- 按影响级别、国家或事件类型筛选
- 生成带有影响分析的结构化Markdown报告
- 默认获取未来7天以快速了解市场展望
数据来源:
- - FMP经济日历API:https://financialmodelingprep.com/api/v3/economic_calendar
- 覆盖主要经济体:美国、欧盟、英国、日本、中国、加拿大、澳大利亚
- 事件类型:央行决策、就业、通胀、GDP、贸易、住房、调查
何时使用该技能
当用户提出以下请求时使用该技能:
- 1. 经济日历查询:
- 本周有哪些经济事件?
- 显示未来两周的经济日历
- 下一次FOMC会议是什么时候?
- 下个月将发布哪些重要经济数据?
- 2. 市场事件规划:
- 本周我应该关注市场的哪些方面?
- 是否有即将发布的高影响力经济数据?
- 下一次就业报告/CPI发布/GDP报告是什么时候?
- 3. 特定日期范围请求:
- 获取1月1日至1月31日的经济事件
- 2025年第一季度的经济日历上有什么?
- 4. 特定国家查询:
- 显示下周美国经济数据发布
- 有哪些计划中的欧洲央行事件?
- 日本什么时候发布通胀数据?
不要将此技能用于:
- - 过去的经济事件(使用市场新闻分析师进行历史分析)
- 企业财报日历(该技能不包括财报)
- 实时市场数据或实时报价
- 技术分析或图表解读
工作流程
按以下步骤获取和分析经济日历:
步骤1:获取FMP API密钥
检查API密钥可用性:
- 1. 首先检查是否设置了FMPAPIKEY环境变量
- 如果不可用,请用户通过聊天提供API密钥
- 如果用户没有API密钥,提供说明:
- 访问 https://financialmodelingprep.com
- 注册免费账户(每天250次请求限制)
- 导航至API仪表板获取密钥
用户交互示例:
用户:显示下周的经济事件
助手:我将获取经济日历。您有FMP API密钥吗?我可以使用FMPAPIKEY环境变量,或者您现在可以提供您的API密钥。
步骤2:确定日期范围
根据用户请求设置适当的日期范围:
默认(无具体日期): 今天 + 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天
- 如果查询过去日期则发出警告
步骤3:执行API获取脚本
使用适当参数运行geteconomiccalendar.py脚本:
基本用法(默认7天):
bash
python3 /path/to/economic-calendar-fetcher/scripts/geteconomiccalendar.py --api-key YOUR_KEY
指定日期范围:
bash
python3 /path/to/economic-calendar-fetcher/scripts/geteconomiccalendar.py \
--from 2025-01-01 \
--to 2025-01-31 \
--api-key YOUR_KEY \
--format json
使用环境变量(无需--api-key):
bash
export FMPAPIKEY=yourkeyhere
python3 /path/to/economic-calendar-fetcher/scripts/geteconomiccalendar.py \
--from 2025-01-01 \
--to 2025-01-07
脚本参数:
- - --from:开始日期(YYYY-MM-DD)- 默认:今天
- --to:结束日期(YYYY-MM-DD)- 默认:今天 + 7天
- --api-key:FMP API密钥(如果设置了FMPAPIKEY环境变量则可选)
- --format:输出格式(json或text)- 默认:json
- --output:输出文件路径(可选,默认:标准输出)
错误处理:
- - 无效API密钥 → 请用户验证密钥
- 超出速率限制(429)→ 建议等待或升级FMP层级
- 网络错误 → 使用指数退避重试
- 无效日期格式 → 提供正确格式示例
步骤4:解析和筛选事件
处理脚本返回的JSON响应:
- 1. 解析事件数据: 从API响应中提取所有事件
- 如果指定了用户筛选条件则应用:
- 影响级别:高、中、低
- 国家:US、EU、JP、CN等
- 事件类型:FOMC、CPI、就业、GDP等
- 货币:USD、EUR、JPY等
筛选示例:
- - 仅显示高影响事件 → 筛选影响 == 高
- 仅美国事件 → 筛选国家 == US
- 央行决策 → 在事件名称中搜索利率、政策、FOMC、ECB、BOJ
事件数据结构:
json
{
date: 2025-01-15 14:30:00,
country: US,
event: 消费者价格指数(CPI)同比,
currency: USD,
previous: 2.6,
estimate: 2.7,
actual: null,
change: null,
impact: 高,
changePercentage: null
}
步骤5:评估市场影响
评估每个事件的市场重要性:
影响级别分类(来自FMP):
- FOMC利率决策、ECB/BOJ政策会议
- 非农就业(NFP)、CPI、GDP
- 市场通常出现0.5-2%+的日内波动
- 零售销售、工业生产
- PMI调查、消费者信心
- 住房数据、耐用品订单
- 每周失业救济申请(除非极端值)
- 地区制造业调查
- 小型拍卖结果
额外背景因素:
- 1. 当前市场敏感度:
- 高通胀环境 → CPI/PPI重要性提升
- 衰退担忧 → 就业数据更关键
- 降息预期 → 央行会议至关重要
- 2. 意外潜力:
- 比较预估与前期读数
- 预期变化大 = 更高关注度
- 共识不确定性 = 更高影响潜力
- 3. 事件集群:
- 同一天多个相关事件 = 影响放大
- 示例:CPI + 零售销售 + 美联储讲话 = 非常高影响日
- 4. 前瞻意义:
- 该事件是否影响即将到来的央行决策?
- 这是初步还是最终读数?
- 该数据会被修正吗?
步骤6:生成输出报告
创建包含以下部分的结构化Markdown报告:
报告头部:
markdown
经济日历
期间: [开始日期] 至 [结束日期]
报告生成时间: [时间戳]
事件总数: [数量]
高影响事件: [数量]
事件列表(按时间顺序):
为每个事件提供:
markdown
[日期] - [星期几]
[事件名称]([影响级别])
- - 国家: [国家代码]([货币])
- 时间: [HH:MM UTC]
- 前期: [数值]
- 预估: [共识预测]
- 影响评估: [您的分析]
市场影响:
[2-3句话说明为什么重要、市场关注什么、典型反应模式]
事件条目示例:
markdown
2025-01-15 - 星期三