feat: WTI/Brent via Stooq, PMI scraping (TE), Groq replace Bytez

- drivers: switch Brent (cb.f) and WTI (cl.f) from stale FRED to Stooq
  near-real-time futures — same stooqMetal() already used for gold/silver
- macro: add scrapePMI() to scrape Trading Economics meta description for
  manufacturing-pmi and services-pmi for all 8 currencies (no API key needed)
- narrative: replace dead Bytez API with Groq (OpenAI-compatible, free tier)
  env var renamed BYTEZ_API_KEY → GROQ_API_KEY, model llama-3.1-8b-instant
- NarrativeButton: rebrand "Erreur Bytez" / "Bytez AI" → "Erreur IA" / "Groq AI"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Capucine Gest
2026-05-28 22:52:49 +02:00
co-authored by Claude Sonnet 4.6
parent 0a42e93d01
commit ecb815619b
4 changed files with 99 additions and 20 deletions
+10 -6
View File
@@ -105,12 +105,16 @@ export async function GET() {
// 1. Marchés indices — FRED (données fin de journée, cache 24h)
// VIXCLS = VIX clôture CBOE | SP500 = S&P 500
// DCOILBRENTEU = Brent | DCOILWTICO = WTI
const [vixQ, sp500Q, brentQ, wtiQ] = await Promise.all([
fredObsDelta("VIXCLS", fredKey),
fredObsDelta("SP500", fredKey),
fredObsDelta("DCOILBRENTEU", fredKey),
fredObsDelta("DCOILWTICO", fredKey),
const [vixQ, sp500Q] = await Promise.all([
fredObsDelta("VIXCLS", fredKey),
fredObsDelta("SP500", fredKey),
]);
// Pétrole — Stooq futures (quasi temps réel, cache 5 min, sans clé API)
// cl.f = WTI NYMEX | cb.f = Brent ICE → delta = variation intraday vs ouverture
const [brentQ, wtiQ] = await Promise.all([
stooqMetal("cb.f"),
stooqMetal("cl.f"),
]);
// 2. Métaux précieux — Stooq (quasi temps réel, cache 5 min, sans clé API)