news.ffxf.net
Loading…
Loading calendar…

FFxF News API

Real-time forex economic calendar and news feed. No API key required. Designed for MQL4 & MQL5 Expert Advisors — just add the URL to your whitelist and start reading structured JSON.

https://news.ffxf.net

Endpoints

MethodEndpointDescription
GET /api/v1/feed Combined calendar data. Recommended for EAs.
GET /api/v1/calendar Economic calendar events only.
GET /health Service health check. Returns Redis status and last update time.

Query Parameters

ParameterValuesApplies toDescription
currency USD, EUR, GBP, JPY… feed, calendar Filter by currency code. Returns only events for that currency.
impact high, medium, low feed, calendar Filter calendar events by impact level.

MQL5 Integration

Before using WebRequest in MT5, whitelist the URL in Tools → Options → Expert Advisors → Allow WebRequest for listed URL and add https://news.ffxf.net.
MQL5
// Returns true when a news window is active for the given currency.
// Call this at the top of OnTick() to gate your trade logic.
//
// Parameters:
//   currency  — e.g. "USD", "EUR", "GBP"
//   impact    — "high" | "medium" | "low"  (default: "high")
//   minsB     — minutes BEFORE the event to block  (default: 30)
//   minsA     — minutes AFTER  the event to block  (default: 60)

bool IsNewsWindow(const string currency,
                   const string impact = "high",
                   const int    minsB  = 30,
                   const int    minsA  = 60)
{
   string url = "https://news.ffxf.net/api/v1/calendar"
              + "?currency=" + currency
              + "&impact="   + impact;

   string headers = "Accept: application/json\r\n";
   char   post[], result[];
   string resHeaders;

   int code = WebRequest("GET", url, headers, 10000, post, result, resHeaders);
   if(code != 200) { Print("[News] HTTP ", code); return false; }

   string   json = CharArrayToString(result);
   datetime now  = TimeGMT();  // API timestamps are UTC

   string key = "\"timestamp\":\"";
   int    pos = 0;

   while((pos = StringFind(json, key, pos)) >= 0)
   {
      pos += StringLen(key);
      string ts = StringSubstr(json, pos, 19); // "YYYY-MM-DDTHH:MM:00"
      StringReplace(ts, "T", " ");
      datetime evTime = StringToTime(ts);

      if(evTime > 0)
      {
         long diff = (long)(evTime - now);
         if(diff >= -(long)(minsA * 60) && diff <= (long)(minsB * 60))
            return true;
      }
   }
   return false;
}

// ── Usage in your EA ──────────────────────────────────────────────
void OnTick()
{
   // Block trades 30 min before and 60 min after high-impact USD news
   if(IsNewsWindow("USD"))
     {
      Print("[News] USD news window active — skipping tick");
      return;
     }

   // ... your strategy logic here ...
}

MQL4 Integration

Whitelist the URL in Tools → Options → Expert Advisors → Allow WebRequest for listed URL and add https://news.ffxf.net. MQL4's WebRequest has a different signature from MQL5.
MQL4
bool IsNewsWindow(const string currency,
                   const string impact = "high",
                   const int    minsB  = 30,
                   const int    minsA  = 60)
{
   string url = "https://news.ffxf.net/api/v1/calendar"
              + "?currency=" + currency
              + "&impact="   + impact;

   char   post[], result[];
   string cookie = "", referer = "", resHeaders;

   // MQL4 WebRequest has cookie + referer params instead of headers string
   int code = WebRequest("GET", url, cookie, referer,
                          10000, post, 0, result, resHeaders);
   if(code != 200) { Print("[News] HTTP ", code); return false; }

   string   json = CharArrayToString(result);
   datetime now  = TimeGMT();

   string key = "\"timestamp\":\"";
   int    pos = 0;

   while((pos = StringFind(json, key, pos)) >= 0)
   {
      pos += StringLen(key);
      string ts = StringSubstr(json, pos, 19);
      StringReplace(ts, "T", " ");
      datetime evTime = StringToTime(ts);

      if(evTime > 0)
      {
         long diff = (long)(evTime - now);
         if(diff >= -(minsA * 60) && diff <= (minsB * 60))
            return true;
      }
   }
   return false;
}

// ── Usage ─────────────────────────────────────────────────────────
int start()  // MQL4 entry point
{
   if(IsNewsWindow("USD")) return(0);
   // ... your strategy logic ...
   return(0);
}

Filtering Examples

URL Examples
// High-impact events for USD only
https://news.ffxf.net/api/v1/calendar?currency=USD&impact=high

// All EUR events (any impact)
https://news.ffxf.net/api/v1/calendar?currency=EUR

// Combined feed — USD calendar
https://news.ffxf.net/api/v1/feed?currency=USD

// Health check
https://news.ffxf.net/health

JSON Response — /api/v1/calendar

JSON
{
  "updated_at":  "2026-03-11T12:00:00Z",
  "next_update": "2026-03-11T12:10:00Z",
  "count": 1,
  "events": [
    {
      "id":          "mt5_USD_85",
      "title":       "Core CPI m/m",
      "currency":    "USD",
      "level":       "high",       // "high" | "medium" | "low" | "holiday" | "none"
      "event_date":  "2026-03-11",
      "event_time":  "08:30",      // UTC
      "timestamp":   "2026-03-11T08:30:00Z",
      "forecast":    "0.2%",
      "previous":    "0.3%",
      "actual":      ""            // empty until released
    }
  ]
}