DEV Community

Cover image for I created an API with real-time economic calendar for trading bots
Marc Piatkowski
Marc Piatkowski

Posted on

I created an API with real-time economic calendar for trading bots

The Problem

Your bot trades during Non-Farm Payrolls. EUR/USD moves 150 pips in 2 minutes. Your stops get hit.

or you are creating a trading bot and you need an API to know when to stop trading.

The Solution

An API that tells your bot when to pause:

import requests

response = requests.get(
    "https://api.forex-calendar.pro/events/upcoming",
    headers={"X-API-Key": "your_key"},
    params={"impact": "HIGH", "hours": 1}
)

if response.json():
    print("⚠️ High-impact news coming - pausing")
else:
    bot.trade()
JSON Response
{
  "events": [{
    "name": "Non-Farm Payrolls",
    "currency": "USD",
    "datetime": "2025-01-10T14:30:00Z",
    "impact": "HIGH",
    "minutes_until": 87
  }]
}
Enter fullscreen mode Exit fullscreen mode

Free Tier
✅ 100 requests / 15 min
✅ NFP, Fed, CPI, GDP, etc.
✅ Filter by impact (HIGH/MEDIUM/LOW)

Bonus
Telegram bot for alerts: @ForexCalendarProBot
🔗 forex-calendar.pro

Questions or suggestions : wdltradingapi@gmail.com

Top comments (0)