feat: FXStreet calendar — free upcoming events with forecasts (no API key)

FXStreet calendar.fxstreet.com/eventdate/ returns ~300-400 events over
6 weeks including consensus forecasts, no authentication required.
FF HTML scraper is blocked by Cloudflare even on residential IPs.
FMP free plan returns 403 on /economic_calendar (requires Starter plan).

- Add backend/services/fxstreet_calendar.py: single GET request returning
  all major currencies; maps Volatility 0/1/2 → low/medium/high
- Add POST /api/eco/fxs-sync + GET /api/eco/fxs-sync/status endpoints
- Add FXStreet to daily background sync in main.py (runs every 24h)
- Add "Sync Upcoming (FXStreet)" button in ImportPanel (no key needed)
- Fix FMP 403 error message to say endpoint requires Starter plan
- Keep FMP panel for users who upgrade to FMP Starter ($14.99/month)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-26 17:54:15 +02:00
parent 5c86d6e715
commit bdbb87962d
5 changed files with 241 additions and 14 deletions

View File

@@ -109,7 +109,15 @@ def startup():
print(f"[Daily] FF live sync error: {e}", flush=True)
try:
# FMP — upcoming forecasts (only if key is set)
# FXStreet — upcoming forecasts (no API key needed)
from services.fxstreet_calendar import fetch_upcoming as fxs_fetch
r = fxs_fetch(weeks_ahead=6)
print(f"[Daily] FXStreet sync: {r.get('total_upserted', 0)} upserted", flush=True)
except Exception as e:
print(f"[Daily] FXStreet sync error: {e}", flush=True)
try:
# FMP — upcoming forecasts (only if key is set + Starter plan)
from services.database import get_config
fmp_key = get_config("fmp_api_key") or ""
if fmp_key: