A Free Economic Calendar API for Trading Bots
Every automated strategy eventually asks the same question: is there news in the next half hour? Answering it needs a machine-readable economic calendar, and that turns out to be harder to find than the calendar itself. Most are web pages. The few feeds that exist are rate-limited, paid, or disappear without notice.
This guide is the short version of that search, and the endpoint we ended up building and opening to everyone.
πΊοΈ Where Bots Get the Calendar Today
| Source | Cost | What you get | What breaks |
|---|---|---|---|
Forex Factory weekly file (ff_calendar_thisweek.json, also XML and CSV) | Free | The current week, impact and forecast | Two downloads every five minutes per IP address: a VPS with many terminals hits the limit; no actual values in the file |
Broker's MT5 calendar (MQL5 Calendar* functions) | Free | Full calendar inside the terminal | MT5 only; some brokers do not relay it |
| Scraping a calendar website | Free until it is not | Whatever the page shows | Layout changes, bot protection, terms of use |
| Paid market-data APIs | From tens of dollars a month | Long history, many countries | Overkill and overpriced for "is there news in 30 minutes" |
| Small private APIs | Free tiers with a key | Often good | One person behind them; keys and limits change |
None of these is wrong. Each one just fails in a way that a robot running unattended on a VPS does not notice until it has traded through a rate decision.
π― What a Bot Actually Needs
Strip the question down and the requirements are few:
- The next day or two, not the next year. A filter looks hours ahead.
- Filtered on the server: only the currencies the bot trades, only the impact it cares about. A few kilobytes, not a megabyte.
- Unix timestamps in UTC. Every platform can compare two integers; nobody enjoys parsing dates in MQL.
- Built for polling. Hundreds of robots asking every 15 minutes should be normal traffic, not abuse.
- No key, no account. A key is one more thing to leak, rotate and support.
- Reachable from every platform, including the ones that restrict network access.
π The Endpoint
GET https://showmytrades.com/api/public/calendar/v1?currency=EUR,USD&impact=high&days=1
| Parameter | Values | Default |
|---|---|---|
currency | Any of USD, EUR, GBP, JPY, AUD, NZD, CAD, CHF, CNY, comma-separated | All nine |
impact | high, medium, low, holiday, comma-separated, or all | high |
days | 1 to 30 days ahead; the window always starts 6 hours in the past | 1 |
format | json or csv | json |
Each event has ts (Unix seconds, UTC), time (ISO 8601), currency, impact, title, forecast, previous and actual. Responses are cached 15 minutes and carry an ETag; the limit is 600 requests per minute per IP address. Everything is on the reference page, including a CSV layout designed so that MQL's StringSplit() cannot get it wrong.
Three calls, in three languages:
curl "https://showmytrades.com/api/public/calendar/v1?currency=USD&impact=high,medium&days=7&format=csv"
import requests
events = requests.get(
"https://showmytrades.com/api/public/calendar/v1",
params={"currency": "EUR,USD", "impact": "high", "days": 2},
timeout=10,
).json()["events"]
next_release = min(events, key=lambda e: e["ts"]) if events else None
const res = await fetch('https://showmytrades.com/api/public/calendar/v1?currency=GBP&impact=high&days=1')
const { events } = await res.json()
const soon = events.filter(e => Math.abs(e.ts * 1000 - Date.now()) < 30 * 60 * 1000)
π Per Platform
| Platform | How | Code |
|---|---|---|
| MetaTrader 4 | WebRequest() with https://showmytrades.com in the allow list | One include file, SMT_NewsFilter.mqh |
| MetaTrader 5 | The same include file, or the built-in calendar | Built-in or API, with both snippets |
| cTrader (desktop and cloud) | A WebSocket on port 25345, because cTrader Cloud blocks HTTP from cBots | A complete cBot in C# |
| Python, Node, anything with HTTP | The endpoint above | The snippets in this page |
| An AI assistant (Claude, ChatGPT) | The get_economic_calendar tool of the MCP server, no key | Ask "what high-impact USD news is out this week?" |
The cTrader case is the one that justifies the WebSocket: a cBot in the cloud cannot make an HTTP request at all, and most cTrader users run in the cloud. The socket speaks the same four parameters and returns the same CSV.
π§ Designing the Filter Itself
The API answers when. The strategy decides what to do, and the usual choices are:
- Window. 30 minutes before and after a high-impact release is the common default. Scalpers go wider after; swing systems sometimes only block entries in the minute of the release.
- Which currencies. Both sides of the traded pair. Gold and indices usually watch
USDalone. - Open positions. Blocking new entries is the easy half. Closing or tightening stops before a release is a strategy decision, with its own costs.
- Failure mode. If the download fails and the bot has no calendar, should it trade or wait? Decide explicitly; the sample code trades, and says so.
βοΈ What the API Is Not
It is a schedule, assembled from public calendar sources and served as-is. Releases are sometimes moved or cancelled, surprise announcements are by definition not on it, and the impact level is a classification, not a prediction of the move. It is information to build a filter with, not a signal.
β FAQ
Is it really free, for commercial robots too? Yes. No key, no account, no tier. A credit, Economic calendar by ShowMyTrades linked to the calendar page, is appreciated and never required.
How often should a bot call it?
Every 15 minutes. That is the cache lifetime, and the calendar does not change faster. With If-None-Match an unchanged calendar costs nothing.
What time zone are the times in?
UTC, always. ts is Unix time in seconds; time is the same instant in ISO 8601 with a Z.
Can I get history, to backtest a news filter? Not from this endpoint: the window reaches back six hours and ahead up to 30 days. Historical calendars for backtesting are a different product with different terms.
Where does the data come from? Public economic calendar sources, merged and normalised by ShowMyTrades. The same data drives the calendar page on this site.
π Related
- Economic calendar API reference
- How to add a news filter to your MT4 Expert Advisor
- News filter in MT5: built-in calendar or API
- How to add a news filter to a cTrader cBot
A robot that knows when to stay out is a robot whose track record you can show. Connect it free, and the quiet half hours around the news will be visible on the drawdown chart.
How to Add a News Filter to a cTrader cBot (Cloud Included)
cTrader has no calendar API for cBots, and cTrader Cloud blocks HTTP requests. Here is a news filter that works on the desktop and in the cloud, with a free calendar over WebSocket and the full C# code.
The Complete Guide to Tracking Your Trading Performance {YEAR}
Most traders have no idea if they are actually good. The metrics that matter, how to read them, and what real accounts show about each one.