[{"data":1,"prerenderedAt":942},["ShallowReactive",2],{"\u002Fguides\u002Ffree-economic-calendar-api-for-trading-bots":3,"\u002Fguides\u002Ffree-economic-calendar-api-for-trading-bots-surround":932},{"id":4,"title":5,"authors":6,"badge":12,"body":14,"date":920,"description":921,"draft":922,"extension":923,"image":924,"meta":926,"navigation":436,"path":927,"seo":928,"stem":929,"updated":930,"__hash__":931},"posts\u002F3.guides\u002F44.free-economic-calendar-api-for-trading-bots.md","A Free Economic Calendar API for Trading Bots",[7],{"name":8,"to":9,"avatar":10},"ShowMyTrades Team","https:\u002F\u002Fshowmytrades.com",{"src":11},"\u002Ficon-512.png",{"label":13},"Automation",{"type":15,"value":16,"toc":910},"minimark",[17,26,29,34,151,154,158,161,211,215,225,330,384,387,631,635,746,749,753,764,795,799,806,810,825,835,854,860,869,873,895,898,906],[18,19,20,21,25],"p",{},"Every automated strategy eventually asks the same question: ",[22,23,24],"em",{},"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.",[18,27,28],{},"This guide is the short version of that search, and the endpoint we ended up building and opening to everyone.",[30,31,33],"h2",{"id":32},"️-where-bots-get-the-calendar-today","🗺️ Where Bots Get the Calendar Today",[35,36,37,56],"table",{},[38,39,40],"thead",{},[41,42,43,47,50,53],"tr",{},[44,45,46],"th",{},"Source",[44,48,49],{},"Cost",[44,51,52],{},"What you get",[44,54,55],{},"What breaks",[57,58,59,83,103,119,135],"tbody",{},[41,60,61,74,77,80],{},[62,63,64,68,69,73],"td",{},[65,66,67],"strong",{},"Forex Factory weekly file"," (",[70,71,72],"code",{},"ff_calendar_thisweek.json",", also XML and CSV)",[62,75,76],{},"Free",[62,78,79],{},"The current week, impact and forecast",[62,81,82],{},"Two downloads every five minutes per IP address: a VPS with many terminals hits the limit; no actual values in the file",[41,84,85,95,97,100],{},[62,86,87,90,91,94],{},[65,88,89],{},"Broker's MT5 calendar"," (MQL5 ",[70,92,93],{},"Calendar*"," functions)",[62,96,76],{},[62,98,99],{},"Full calendar inside the terminal",[62,101,102],{},"MT5 only; some brokers do not relay it",[41,104,105,110,113,116],{},[62,106,107],{},[65,108,109],{},"Scraping a calendar website",[62,111,112],{},"Free until it is not",[62,114,115],{},"Whatever the page shows",[62,117,118],{},"Layout changes, bot protection, terms of use",[41,120,121,126,129,132],{},[62,122,123],{},[65,124,125],{},"Paid market-data APIs",[62,127,128],{},"From tens of dollars a month",[62,130,131],{},"Long history, many countries",[62,133,134],{},"Overkill and overpriced for \"is there news in 30 minutes\"",[41,136,137,142,145,148],{},[62,138,139],{},[65,140,141],{},"Small private APIs",[62,143,144],{},"Free tiers with a key",[62,146,147],{},"Often good",[62,149,150],{},"One person behind them; keys and limits change",[18,152,153],{},"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.",[30,155,157],{"id":156},"what-a-bot-actually-needs","🎯 What a Bot Actually Needs",[18,159,160],{},"Strip the question down and the requirements are few:",[162,163,164,171,177,183,193,199,205],"ol",{},[165,166,167,170],"li",{},[65,168,169],{},"The next day or two",", not the next year. A filter looks hours ahead.",[165,172,173,176],{},[65,174,175],{},"Filtered on the server",": only the currencies the bot trades, only the impact it cares about. A few kilobytes, not a megabyte.",[165,178,179,182],{},[65,180,181],{},"Unix timestamps in UTC."," Every platform can compare two integers; nobody enjoys parsing dates in MQL.",[165,184,185,188,189,192],{},[65,186,187],{},"A clock it can trust."," The robot's own clocks are a guess: broker time at an unknown offset, a VPS in an unknown zone. The calendar should say what time it is ",[22,190,191],{},"now",", so the robot can compare like with like.",[165,194,195,198],{},[65,196,197],{},"Built for polling."," Hundreds of robots asking every 15 minutes should be normal traffic, not abuse.",[165,200,201,204],{},[65,202,203],{},"No key, no account."," A key is one more thing to leak, rotate and support.",[165,206,207,210],{},[65,208,209],{},"Reachable from every platform",", including the ones that restrict network access.",[30,212,214],{"id":213},"the-endpoint","🔓 The Endpoint",[216,217,223],"pre",{"className":218,"code":220,"language":221,"meta":222},[219],"language-text","GET https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fpublic\u002Fcalendar\u002Fv1?currency=EUR,USD&impact=high&days=1\n","text","",[70,224,220],{"__ignoreMap":222},[35,226,227,240],{},[38,228,229],{},[41,230,231,234,237],{},[44,232,233],{},"Parameter",[44,235,236],{},"Values",[44,238,239],{},"Default",[57,241,242,259,289,310],{},[41,243,244,249,256],{},[62,245,246],{},[70,247,248],{},"currency",[62,250,251,252,255],{},"Any of ",[70,253,254],{},"USD, EUR, GBP, JPY, AUD, NZD, CAD, CHF, CNY",", comma-separated",[62,257,258],{},"All nine",[41,260,261,266,285],{},[62,262,263],{},[70,264,265],{},"impact",[62,267,268,271,272,271,275,271,278,281,282],{},[70,269,270],{},"high",", ",[70,273,274],{},"medium",[70,276,277],{},"low",[70,279,280],{},"holiday",", comma-separated, or ",[70,283,284],{},"all",[62,286,287],{},[70,288,270],{},[41,290,291,296,306],{},[62,292,293],{},[70,294,295],{},"days",[62,297,298,301,302,305],{},[70,299,300],{},"1"," to ",[70,303,304],{},"30"," days ahead; the window always starts 6 hours in the past",[62,307,308],{},[70,309,300],{},[41,311,312,317,326],{},[62,313,314],{},[70,315,316],{},"format",[62,318,319,322,323],{},[70,320,321],{},"json"," or ",[70,324,325],{},"csv",[62,327,328],{},[70,329,321],{},[18,331,332,333,336,337,340,341,271,343,271,345,271,348,271,351,354,355,358,359,362,363,365,366,369,370,373,374,379,380,383],{},"Each event has ",[70,334,335],{},"ts"," (Unix seconds, UTC), ",[70,338,339],{},"time"," (ISO 8601), ",[70,342,248],{},[70,344,265],{},[70,346,347],{},"title",[70,349,350],{},"forecast",[70,352,353],{},"previous"," and ",[70,356,357],{},"actual",". Every response also says what time it is now, in UTC, as ",[70,360,361],{},"server_time",": the clock to compare ",[70,364,335],{}," against, instead of the broker's or the VPS's. If you only want the clock, ",[70,367,368],{},"GET https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fpublic\u002Ftime"," returns it alone, never cached. Responses are cached 15 minutes and carry an ",[70,371,372],{},"ETag","; the limit is 600 requests per minute per IP address. Everything is on the ",[375,376,378],"a",{"href":377},"\u002Fdocs\u002Fapi\u002Feconomic-calendar","reference page",", including a CSV layout designed so that MQL's ",[70,381,382],{},"StringSplit()"," cannot get it wrong.",[18,385,386],{},"Three calls, in three languages:",[388,389,390,418,479],"code-group",{},[216,391,396],{"className":392,"code":393,"filename":394,"language":395,"meta":222,"style":222},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl \"https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fpublic\u002Fcalendar\u002Fv1?currency=USD&impact=high,medium&days=7&format=csv\"\n","cURL","bash",[70,397,398],{"__ignoreMap":222},[399,400,403,407,411,415],"span",{"class":401,"line":402},"line",1,[399,404,406],{"class":405},"sBMFI","curl",[399,408,410],{"class":409},"sMK4o"," \"",[399,412,414],{"class":413},"sfazB","https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fpublic\u002Fcalendar\u002Fv1?currency=USD&impact=high,medium&days=7&format=csv",[399,416,417],{"class":409},"\"\n",[216,419,424],{"className":420,"code":421,"filename":422,"language":423,"meta":222,"style":222},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import requests\n\nevents = requests.get(\n    \"https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fpublic\u002Fcalendar\u002Fv1\",\n    params={\"currency\": \"EUR,USD\", \"impact\": \"high\", \"days\": 2},\n    timeout=10,\n).json()[\"events\"]\n\nnext_release = min(events, key=lambda e: e[\"ts\"]) if events else None\n","Python","python",[70,425,426,431,438,444,450,456,462,468,473],{"__ignoreMap":222},[399,427,428],{"class":401,"line":402},[399,429,430],{},"import requests\n",[399,432,434],{"class":401,"line":433},2,[399,435,437],{"emptyLinePlaceholder":436},true,"\n",[399,439,441],{"class":401,"line":440},3,[399,442,443],{},"events = requests.get(\n",[399,445,447],{"class":401,"line":446},4,[399,448,449],{},"    \"https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fpublic\u002Fcalendar\u002Fv1\",\n",[399,451,453],{"class":401,"line":452},5,[399,454,455],{},"    params={\"currency\": \"EUR,USD\", \"impact\": \"high\", \"days\": 2},\n",[399,457,459],{"class":401,"line":458},6,[399,460,461],{},"    timeout=10,\n",[399,463,465],{"class":401,"line":464},7,[399,466,467],{},").json()[\"events\"]\n",[399,469,471],{"class":401,"line":470},8,[399,472,437],{"emptyLinePlaceholder":436},[399,474,476],{"class":401,"line":475},9,[399,477,478],{},"next_release = min(events, key=lambda e: e[\"ts\"]) if events else None\n",[216,480,485],{"className":481,"code":482,"filename":483,"language":484,"meta":222,"style":222},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const res = await fetch('https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fpublic\u002Fcalendar\u002Fv1?currency=GBP&impact=high&days=1')\nconst { events } = await res.json()\nconst soon = events.filter(e => Math.abs(e.ts * 1000 - Date.now()) \u003C 30 * 60 * 1000)\n","JavaScript","js",[70,486,487,522,551],{"__ignoreMap":222},[399,488,489,493,497,500,504,508,511,514,517,519],{"class":401,"line":402},[399,490,492],{"class":491},"spNyl","const",[399,494,496],{"class":495},"sTEyZ"," res ",[399,498,499],{"class":409},"=",[399,501,503],{"class":502},"s7zQu"," await",[399,505,507],{"class":506},"s2Zo4"," fetch",[399,509,510],{"class":495},"(",[399,512,513],{"class":409},"'",[399,515,516],{"class":413},"https:\u002F\u002Fshowmytrades.com\u002Fapi\u002Fpublic\u002Fcalendar\u002Fv1?currency=GBP&impact=high&days=1",[399,518,513],{"class":409},[399,520,521],{"class":495},")\n",[399,523,524,526,529,532,535,538,540,543,546,548],{"class":401,"line":433},[399,525,492],{"class":491},[399,527,528],{"class":409}," {",[399,530,531],{"class":495}," events ",[399,533,534],{"class":409},"}",[399,536,537],{"class":409}," =",[399,539,503],{"class":502},[399,541,542],{"class":495}," res",[399,544,545],{"class":409},".",[399,547,321],{"class":506},[399,549,550],{"class":495},"()\n",[399,552,553,555,558,560,563,565,568,570,574,577,580,582,585,588,590,593,596,600,603,606,608,610,613,616,619,622,625,627,629],{"class":401,"line":440},[399,554,492],{"class":491},[399,556,557],{"class":495}," soon ",[399,559,499],{"class":409},[399,561,562],{"class":495}," events",[399,564,545],{"class":409},[399,566,567],{"class":506},"filter",[399,569,510],{"class":495},[399,571,573],{"class":572},"sHdIc","e",[399,575,576],{"class":491}," =>",[399,578,579],{"class":495}," Math",[399,581,545],{"class":409},[399,583,584],{"class":506},"abs",[399,586,587],{"class":495},"(e",[399,589,545],{"class":409},[399,591,592],{"class":495},"ts ",[399,594,595],{"class":409},"*",[399,597,599],{"class":598},"sbssI"," 1000",[399,601,602],{"class":409}," -",[399,604,605],{"class":495}," Date",[399,607,545],{"class":409},[399,609,191],{"class":506},[399,611,612],{"class":495},"()) ",[399,614,615],{"class":409},"\u003C",[399,617,618],{"class":598}," 30",[399,620,621],{"class":409}," *",[399,623,624],{"class":598}," 60",[399,626,621],{"class":409},[399,628,599],{"class":598},[399,630,521],{"class":495},[30,632,634],{"id":633},"per-platform","🔌 Per Platform",[35,636,637,650],{},[38,638,639],{},[41,640,641,644,647],{},[44,642,643],{},"Platform",[44,645,646],{},"How",[44,648,649],{},"Code",[57,651,652,677,693,710,723],{},[41,653,654,659,668],{},[62,655,656],{},[65,657,658],{},"MetaTrader 4",[62,660,661,664,665,667],{},[70,662,663],{},"WebRequest()"," with ",[70,666,9],{}," in the allow list",[62,669,670],{},[375,671,673,674],{"href":672},"\u002Fguides\u002Fadd-a-news-filter-to-your-mt4-expert-advisor","One include file, ",[70,675,676],{},"SMT_NewsFilter.mqh",[41,678,679,684,687],{},[62,680,681],{},[65,682,683],{},"MetaTrader 5",[62,685,686],{},"The same include file, or the built-in calendar",[62,688,689],{},[375,690,692],{"href":691},"\u002Fguides\u002Fnews-filter-mt5-expert-advisor-built-in-calendar-or-api","Built-in or API, with both snippets",[41,694,695,701,704],{},[62,696,697,700],{},[65,698,699],{},"cTrader"," (desktop and cloud)",[62,702,703],{},"A WebSocket on port 25345, because cTrader Cloud blocks HTTP from cBots",[62,705,706],{},[375,707,709],{"href":708},"\u002Fguides\u002Fadd-a-news-filter-to-a-ctrader-cbot","A complete cBot in C#",[41,711,712,717,720],{},[62,713,714],{},[65,715,716],{},"Python, Node, anything with HTTP",[62,718,719],{},"The endpoint above",[62,721,722],{},"The snippets in this page",[41,724,725,731,743],{},[62,726,727,730],{},[65,728,729],{},"An AI assistant"," (Claude, ChatGPT)",[62,732,733,734,737,738,742],{},"The ",[70,735,736],{},"get_economic_calendar"," tool of the ",[375,739,741],{"href":740},"\u002Fdocs\u002Fapi\u002Fmcp","MCP server",", no key",[62,744,745],{},"Ask \"what high-impact USD news is out this week?\"",[18,747,748],{},"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.",[30,750,752],{"id":751},"designing-the-filter-itself","🧭 Designing the Filter Itself",[18,754,755,756,759,760,763],{},"The API answers ",[22,757,758],{},"when",". The strategy decides ",[22,761,762],{},"what to do",", and the usual choices are:",[765,766,767,773,783,789],"ul",{},[165,768,769,772],{},[65,770,771],{},"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.",[165,774,775,778,779,782],{},[65,776,777],{},"Which currencies."," Both sides of the traded pair. Gold and indices usually watch ",[70,780,781],{},"USD"," alone.",[165,784,785,788],{},[65,786,787],{},"Open positions."," Blocking new entries is the easy half. Closing or tightening stops before a release is a strategy decision, with its own costs.",[165,790,791,794],{},[65,792,793],{},"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.",[30,796,798],{"id":797},"️-what-the-api-is-not","⚖️ What the API Is Not",[18,800,801,802,805],{},"It is a ",[65,803,804],{},"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.",[30,807,809],{"id":808},"faq","❓ FAQ",[18,811,812,815,816,819,820,824],{},[65,813,814],{},"Is it really free, for commercial robots too?","\nYes. No key, no account, no tier. A credit, ",[22,817,818],{},"Economic calendar by ShowMyTrades"," linked to the ",[375,821,823],{"href":822},"\u002Ftools\u002Feconomic-calendar","calendar page",", is appreciated and never required.",[18,826,827,830,831,834],{},[65,828,829],{},"How often should a bot call it?","\nEvery 15 minutes. That is the cache lifetime, and the calendar does not change faster. With ",[70,832,833],{},"If-None-Match"," an unchanged calendar costs nothing.",[18,836,837,840,841,843,844,846,847,850,851,853],{},[65,838,839],{},"What time zone are the times in?","\nUTC, always. ",[70,842,335],{}," is Unix time in seconds; ",[70,845,339],{}," is the same instant in ISO 8601 with a ",[70,848,849],{},"Z",". And because a robot rarely knows what time it is itself (broker time at an unknown offset, a VPS in an unknown zone), every response carries ",[70,852,361],{},", the current UTC time: compute the offset to your own clock once per download and the ambiguity is gone.",[18,855,856,859],{},[65,857,858],{},"Can I get history, to backtest a news filter?","\nNot 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.",[18,861,862,865,866,868],{},[65,863,864],{},"Where does the data come from?","\nPublic economic calendar sources, merged and normalised by ShowMyTrades. The same data drives the ",[375,867,823],{"href":822}," on this site.",[30,870,872],{"id":871},"related","🔗 Related",[765,874,875,880,885,890],{},[165,876,877],{},[375,878,879],{"href":377},"Economic calendar API reference",[165,881,882],{},[375,883,884],{"href":672},"How to add a news filter to your MT4 Expert Advisor",[165,886,887],{},[375,888,889],{"href":691},"News filter in MT5: built-in calendar or API",[165,891,892],{},[375,893,894],{"href":708},"How to add a news filter to a cTrader cBot",[896,897],"hr",{},[18,899,900,901,905],{},"A robot that knows when to stay out is a robot whose track record you can show. ",[375,902,904],{"href":903},"\u002Fsignup","Connect it free",", and the quiet half hours around the news will be visible on the drawdown chart.",[907,908,909],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":222,"searchDepth":433,"depth":433,"links":911},[912,913,914,915,916,917,918,919],{"id":32,"depth":433,"text":33},{"id":156,"depth":433,"text":157},{"id":213,"depth":433,"text":214},{"id":633,"depth":433,"text":634},{"id":751,"depth":433,"text":752},{"id":797,"depth":433,"text":798},{"id":808,"depth":433,"text":809},{"id":871,"depth":433,"text":872},"2026-10-17T00:00:00.000Z","Where a trading robot can get the economic calendar: the sources people use, what breaks with each, and a free API with no key built for polling from Expert Advisors, cBots, Python and JavaScript.",false,"md",{"src":925},"\u002Fimages\u002Fblog\u002Ffree-economic-calendar-api-for-trading-bots-hero.svg",{},"\u002Fguides\u002Ffree-economic-calendar-api-for-trading-bots",{"title":5,"description":921},"3.guides\u002F44.free-economic-calendar-api-for-trading-bots",null,"7F-EpmWiX3Und3iiFeS3wFy6xkqZapagzGo25zhh1WA",[933,937],{"title":934,"path":708,"stem":935,"description":936,"children":-1},"How to Add a News Filter to a cTrader cBot (Cloud Included)","3.guides\u002F43.add-a-news-filter-to-a-ctrader-cbot","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.",{"title":938,"path":939,"stem":940,"description":941,"children":-1},"The Complete Guide to Tracking Your Trading Performance {YEAR}","\u002Fguides\u002Ftracking-trading-performance","3.guides\u002F7.tracking-trading-performance","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.",1792249019852]