Most trading strategies have a rule that never makes it into code: do not trade into the news. Spreads widen around CPI, payrolls and central bank decisions, and stops get hit by moves that have nothing to do with the setup. A human trader glances at a calendar. A bot needs the calendar as data.
This post shows a news filter that takes one HTTP call.
The question a bot asks
Before placing an order on EURUSD, the bot needs one answer: is a high-impact release for EUR or USD within 30 minutes of now, before or after?
The Forex News Filter & Economic Calendar Actor on Apify returns this week's events for nine major currencies. Every row carries two fields that do the work:
-
minutesUntil: minutes to the event, negative once it has passed -
inNewsWindow:truewhen the event is high impact and inside your window
The call
You need a free Apify account and its API token.
const res = await fetch( 'https://api.apify.com/v2/acts/cryptoretirement~forex-news-filter-economic-calendar/run-sync-get-dataset-items', { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.APIFY_TOKEN}` }, body: JSON.stringify({ currencies: ['EUR', 'USD'], minImpact: 'high', upcomingOnly: true, newsWindowMinutes: 30 }), }, ); const rows = await res.json(); const blocked = rows.filter(r => r.inNewsWindow); if (blocked.length) console.log('Stand aside:', blocked.map(r => `${r.currency} ${r.title}`).join('; ')); else console.log('Clear to trade'); The same thing in Python:
import os, requests rows = requests.post( "https://api.apify.com/v2/acts/cryptoretirement~forex-news-filter-economic-calendar/run-sync-get-dataset-items", headers={"Authorization": f"Bearer {os.environ['APIFY_TOKEN']}"}, json={"currencies": ["EUR", "USD"], "minImpact": "high", "upcomingOnly": True, "newsWindowMinutes": 30}, timeout=120, ).json() if any(r["inNewsWindow"] for r in rows): print("Stand aside") What comes back
One row per event, oldest first:
{ "time": "2026-11-13T13:30:00.000Z", "currency": "USD", "title": "Core PPI m/m", "impact": "high", "forecast": "0.3%", "previous": "0.7%", "status": "upcoming", "minutesUntil": 2175, "inNewsWindow": false } Times are UTC. With upcomingOnly: true the first row is the next event, so rows[0].minutesUntil also tells the bot how long it has.
Where to put it
- On demand: call it right before each order. A run takes a few seconds.
- On a schedule: run it every 5 to 15 minutes and cache the answer. Schedules can change during the week, so poll again close to the time that matters.
- Once a week: run it on Monday with
minImpact: "medium"and post the week's events to Slack or Telegram.
Cost and limits
A two-currency, high-impact check returns a handful of rows and costs about a cent. There is no subscription.
Know the limits before you rely on it. The calendar covers the current week only, so late on Friday nothing is upcoming until the new week is published. It carries forecast and previous values but no actual results. The data is ForexFactory's public weekly export, including its impact ratings.
The Actor is here: Forex News Filter & Economic Calendar. A runnable version of this example, with seven more for related Actors, is on GitHub. It returns data only and is not financial advice.

