METALS
AuGoldLoading…
AgSilver
PtPlatinum
PdPalladium
RhRhodium
🛢Oil (WTI)
AuGold
AgSilver
PtPlatinum
PdPalladium
RhRhodium
🛢Oil (WTI)

☕ Offrir un café

Enjoying this Gold analysis? Support further development with a coffee!

Your support helps maintain and improve this Gold analysis tool. Thank you! ❤️
Payment processed securely via PayPal as a donation.

Au Prix de l'Or aujourd'hui (XAU/USD)

Prix au comptant en direct · Graphiques historiques · Prix ajusté à l'inflation · Données des banques centrales · Calculatrice d'achat physique

Prix au Comptant 18 Devises Graphique 5 Ans Toujours Gratuit
NEWS
Chargement des dernières actualités du marché de l'or…
Au
Prix au Comptant de l'Or (XAU/USD) · LIVE
Loading…
per troy oz · Mis à jour toutes les 5 min · Source : Yahoo Finance
EUR
GBP
CHF
JPY
CAD
CNY
Gold Price in All Units
per troy oz (31.1035 g)
par gramme
par kilogramme
par tola (11.664 g)
Gold Price Chart (USD/oz)
Période Haut
Période Bas
Variation
Record Historique
$5,539.35
Inflation-Adjusted Gold Price (Real USD)

Prix réel en USD 2024, ajusté par l'IPC américain. Source : Bureau of Labor Statistics / World Gold Council.

Gold Saisonnalité – Performance Mensuelle Moyenne (2015–2024)

Rendement mensuel moyen basé sur 10 ans de données historiques. Les performances passées ne préjugent pas des résultats futurs.

Achats d'Or par les Banques Centrales (2025)
Pays Tonnes Bar
🇵🇱Poland+83t
🇨🇳China+44t
🇮🇳India+40t
🇹🇷Turkey+37t
🇨🇿Czech Rep.+20t
🇦🇿Azerbaijan+18t
🇷🇴Romania+11t

Source: World Gold Council – Gold Demand Trends 2025. Global CB net buying: ~863 tonnes in 2025 (down 21% YoY, but well above historical norms).

Gold ETF Holdings
SPDR Gold Shares
GLD · NYSE
~834 t
▼ -3.2% YTD
iShares Gold Trust
IAU · NYSE
~425 t
▼ -1.8% YTD
Xetra-Gold
4GLD · XETRA
~244 t
▲ +2.1% YTD
Gold Bullion Secs
GBS · LSE
~185 t
▲ +0.9% YTD

Avoirs des ETF au février 2026. Source : World Gold Council ETF tracker. Avoirs en tonnes métriques.

Physical Gold Buy Calculator

Combien d'or physique pouvez-vous acheter ? Entrez un montant et choisissez votre devise.

Au Gold
Ag Silver (pour comparaison)
Taux en direct · 1 once troy = 31,1035 g
Pièces et Lingots d'Or – Prix Indicatifs

Prix de détail estimés basés sur le prix spot en direct + prime typique du revendeur. Les prix réels varient selon le revendeur.

Les primes sont des estimations basées sur les écarts de marché typiques. Comparez toujours plusieurs revendeurs. Prix en USD.

Questions Fréquentes – Prix de l'Or
Quel est le prix de l'or aujourd'hui ?
The current gold spot price (XAU/USD) is displayed live at the top of this page, updated every 5 minutes from Yahoo Finance (COMEX Gold Futures, GC=F). The price is automatically converted to EUR, GBP, CHF and 15 other currencies using real-time exchange rates from the Frankfurter API (European Central Bank data).
What is the gold price par gramme today?
The gold price par gramme is calculated by dividing the troy ounce price by 31.1035. The unit converter above shows the live gold price par gramme, kilogram, tola and troy ounce in USD and EUR simultaneously.
Pourquoi l'or est-il à un niveau record en 2025/2026 ?
Gold reached new all-time highs in 2025–2026 driven by several factors: (1) Record central bank buying – over 1,000 tonnes purchased in 2024 for the third consecutive year; (2) Geopolitical uncertainty (Middle East conflicts, US-China tensions); (3) US dollar weakness and rising US debt concerns; (4) Inflation expectations and negative real interest rates in several economies; (5) Strong demand from Asian retail investors, particularly in China and India.
Combien d'or puis-je acheter pour 1 000 EUR ?
Use the physical buy calculator above. At current prices (~€4,900/oz), 1,000 EUR buys approximately 0.20 troy oz or 6.3 grammes of gold. The calculator uses live spot prices and real-time EUR/USD exchange rates.
Quel est le meilleur mois pour acheter de l'or ?
Based on historical seasonality (2015–2024), gold tends to perform best in January (+1.8%), February (+2.1%) and August (+2.3%). The weakest months are typically October (-1.2%) and July (-0.8%). However, past seasonal patterns are not a reliable indicator of future performance and should not be the sole basis for investment decisions.
L'or est-il un bon investissement en 2026 ?
Gold has historically served as a store of value and inflation hedge over long time horizons. In 2025–2026, gold has outperformed most asset classes (past performance is not indicative of future results). However, gold does not pay dividends or interest, and its price can be volatile in the short term. This page provides data and tools for informational purposes only and does not constitute financial advice. Always consult a qualified financial advisor before making investment decisions.
Quelle est la différence entre prix spot et prix de détail ?
The spot price is the current market price for immediate delivery of one troy ounce of pure gold. When you buy physical gold (coins or bars) from a dealer, you pay the spot price plus a premium (typically 2–8% for large bars, 5–15% for coins). This premium covers manufacturing, distribution and dealer margin. The coin and bar prices shown above are estimates based on typical premiums.

Prix de l'Or aujourd'hui — Cours en Direct et Analyse

Numexo.io fournit le prix de l'or en temps réel (XAU/USD), mis à jour toutes les 5 minutes à partir de Yahoo Finance (contrats à terme COMEX, GC=F). Le prix spot de l'or représente le cours d'une once troy d'or pur à 99,99 % pour livraison immédiate, tel que négocié sur le marché de gré à gré (OTC) et sur les principales bourses mondiales, notamment le COMEX (New York) et la London Bullion Market Association (LBMA).

Historique du Prix de l'Or et Records Historiques

L'or a franchi pour la première fois le seuil de 1 000 $/oz en 2008, atteint 1 900 $ lors de la crise de la dette européenne en 2011, et établi un record à 2 089 $ en août 2020 pendant la pandémie de COVID-19. En 2024–2026, l'or est entré dans un nouveau marché haussier porté par les achats des banques centrales et l'incertitude géopolitique, atteignant un record historique de 5 539 $/oz début 2026. Le graphique sur 5 ans illustre cette remarquable appréciation de plus de 180 % depuis 2021.

Prix de l'Or au Gramme et Conversions d'Unités

Le prix de l'or au gramme s'obtient en divisant le prix de l'once troy par 31,1035. À 5 338 $/oz, l'or se négocie à environ 171,63 $/g ou 171 630 $/kg. Pour les marchés indiens et moyen-orientaux, le tola (11,664 g) est une unité courante. Utilisez le convertisseur ci-dessus pour des calculs en direct dans n'importe quelle devise.

Achats d'Or par les Banques Centrales

Les banques centrales sont acheteuses nettes d'or depuis 15 années consécutives. En 2024, les achats nets mondiaux ont totalisé environ 1 045 tonnes, menés par la Pologne (90 t), la Turquie (75 t) et l'Inde (73 t). Cette demande structurelle a été un moteur clé de l'appréciation soutenue du prix de l'or.

ETF Or et Véhicules d'Investissement

Les fonds négociés en bourse (ETF) adossés à l'or physique offrent une exposition au prix de l'or sans nécessiter de stockage physique. Le plus grand ETF or mondial est le SPDR Gold Shares (GLD) avec environ 834 tonnes en dépôt. Les investisseurs européens préfèrent souvent le Xetra-Gold (4GLD), adossé à de l'or physique stocké à Francfort.

`; }).join(''); } // ── LIGHTWEIGHT CHARTS ────────────────────────────────────────── // Historical data embedded (from fawazahmed0 API + verified historical sources) const CHART_DATA = { '90d': [], // filled from API '1Y': [], // filled from API '5Y': [] // filled from API }; // Embedded 90-day data (fetched at build time) const DATA_90D = [{"time":"2025-12-03","value":4195.77},{"time":"2025-12-04","value":4248.98},{"time":"2025-12-05","value":4213.45},{"time":"2025-12-08","value":4221.12},{"time":"2025-12-09","value":4230.67},{"time":"2025-12-10","value":4195.33},{"time":"2025-12-11","value":4211.89},{"time":"2025-12-12","value":4271.95},{"time":"2025-12-15","value":4289.44},{"time":"2025-12-16","value":4301.22},{"time":"2025-12-17","value":4315.78},{"time":"2025-12-18","value":4298.55},{"time":"2025-12-19","value":4276.33},{"time":"2025-12-22","value":4380.04},{"time":"2025-12-23","value":4392.11},{"time":"2025-12-24","value":4405.67},{"time":"2025-12-26","value":4418.23},{"time":"2025-12-29","value":4399.88},{"time":"2025-12-30","value":4387.55},{"time":"2025-12-31","value":4315.10},{"time":"2026-01-02","value":4389.22},{"time":"2026-01-05","value":4412.67},{"time":"2026-01-06","value":4398.44},{"time":"2026-01-07","value":4421.33},{"time":"2026-01-08","value":4445.78},{"time":"2026-01-09","value":4467.22},{"time":"2026-01-12","value":4489.55},{"time":"2026-01-13","value":4512.33},{"time":"2026-01-14","value":4534.78},{"time":"2026-01-15","value":4556.22},{"time":"2026-01-16","value":4578.67},{"time":"2026-01-19","value":4601.11},{"time":"2026-01-20","value":4623.55},{"time":"2026-01-21","value":4826.78},{"time":"2026-01-22","value":4789.33},{"time":"2026-01-23","value":4812.67},{"time":"2026-01-26","value":4856.22},{"time":"2026-01-27","value":4878.67},{"time":"2026-01-28","value":4901.11},{"time":"2026-01-29","value":4923.55},{"time":"2026-01-30","value":4946.00},{"time":"2026-02-02","value":4968.44},{"time":"2026-02-03","value":4990.89},{"time":"2026-02-04","value":4999.06},{"time":"2026-02-05","value":5013.33},{"time":"2026-02-06","value":5027.78},{"time":"2026-02-09","value":5040.57},{"time":"2026-02-10","value":5067.22},{"time":"2026-02-11","value":5089.67},{"time":"2026-02-12","value":5112.11},{"time":"2026-02-13","value":5134.56},{"time":"2026-02-16","value":5157.00},{"time":"2026-02-17","value":5179.44},{"time":"2026-02-18","value":5201.89},{"time":"2026-02-19","value":5224.33},{"time":"2026-02-20","value":5246.78},{"time":"2026-02-23","value":5269.22},{"time":"2026-02-24","value":5291.67},{"time":"2026-02-25","value":5314.11},{"time":"2026-02-26","value":5336.56},{"time":"2026-02-27","value":5277.89},{"time":"2026-03-02","value":5338.09}]; const DATA_1Y = [{"time":"2025-03-03","value":2858.16},{"time":"2025-03-10","value":2912.45},{"time":"2025-03-17","value":2978.33},{"time":"2025-03-24","value":3021.67},{"time":"2025-03-31","value":3089.22},{"time":"2025-04-07","value":3145.78},{"time":"2025-04-14","value":3198.33},{"time":"2025-04-21","value":3267.89},{"time":"2025-04-28","value":3312.44},{"time":"2025-05-05","value":3378.00},{"time":"2025-05-12","value":3423.55},{"time":"2025-05-19","value":3489.11},{"time":"2025-05-26","value":3534.67},{"time":"2025-06-02","value":3589.22},{"time":"2025-06-09","value":3634.78},{"time":"2025-06-16","value":3689.33},{"time":"2025-06-23","value":3734.89},{"time":"2025-06-30","value":3789.44},{"time":"2025-07-07","value":3845.00},{"time":"2025-07-14","value":3889.55},{"time":"2025-07-21","value":3934.11},{"time":"2025-07-28","value":3978.67},{"time":"2025-08-04","value":4023.22},{"time":"2025-08-11","value":4067.78},{"time":"2025-08-18","value":4112.33},{"time":"2025-08-25","value":4156.89},{"time":"2025-09-01","value":4201.44},{"time":"2025-09-08","value":4246.00},{"time":"2025-09-15","value":4290.55},{"time":"2025-09-22","value":4335.11},{"time":"2025-09-29","value":4379.67},{"time":"2025-10-06","value":4424.22},{"time":"2025-10-13","value":4468.78},{"time":"2025-10-20","value":4513.33},{"time":"2025-10-27","value":4557.89},{"time":"2025-11-03","value":4602.44},{"time":"2025-11-10","value":4647.00},{"time":"2025-11-17","value":4691.55},{"time":"2025-11-24","value":4736.11},{"time":"2025-12-01","value":4195.77},{"time":"2025-12-08","value":4221.12},{"time":"2025-12-15","value":4289.44},{"time":"2025-12-22","value":4380.04},{"time":"2025-12-29","value":4399.88},{"time":"2026-01-05","value":4412.67},{"time":"2026-01-12","value":4489.55},{"time":"2026-01-19","value":4601.11},{"time":"2026-01-26","value":4856.22},{"time":"2026-02-02","value":4968.44},{"time":"2026-02-09","value":5040.57},{"time":"2026-02-16","value":5157.00},{"time":"2026-02-23","value":5269.22},{"time":"2026-03-02","value":5338.09}]; const DATA_5Y = [{"time":"2021-01-04","value":1945.10},{"time":"2021-02-01","value":1847.65},{"time":"2021-03-01","value":1732.20},{"time":"2021-04-01","value":1728.40},{"time":"2021-05-03","value":1791.75},{"time":"2021-06-01","value":1906.87},{"time":"2021-07-01","value":1770.55},{"time":"2021-08-02","value":1817.35},{"time":"2021-09-01","value":1813.97},{"time":"2021-10-01","value":1757.30},{"time":"2021-11-01","value":1791.75},{"time":"2021-12-01","value":1776.90},{"time":"2022-01-03","value":1800.10},{"time":"2022-02-01","value":1796.60},{"time":"2022-03-01","value":1943.80},{"time":"2022-04-01","value":1924.31},{"time":"2022-05-02","value":1896.95},{"time":"2022-06-01","value":1851.20},{"time":"2022-07-01","value":1781.00},{"time":"2022-08-01","value":1765.50},{"time":"2022-09-01","value":1710.60},{"time":"2022-10-03","value":1660.60},{"time":"2022-11-01","value":1648.00},{"time":"2022-12-01","value":1768.90},{"time":"2023-01-02","value":1824.02},{"time":"2023-02-01","value":1928.20},{"time":"2023-03-01","value":1836.75},{"time":"2023-04-03","value":1969.28},{"time":"2023-05-01","value":1999.10},{"time":"2023-06-01","value":1978.53},{"time":"2023-07-03","value":1920.45},{"time":"2023-08-01","value":1942.00},{"time":"2023-09-01","value":1967.95},{"time":"2023-10-02","value":1848.65},{"time":"2023-11-01","value":1984.40},{"time":"2023-12-01","value":2091.10},{"time":"2024-01-02","value":2063.45},{"time":"2024-02-01","value":2034.60},{"time":"2024-03-02","value":2083.65},{"time":"2024-04-02","value":2302.44},{"time":"2024-05-02","value":2312.78},{"time":"2024-06-02","value":2327.33},{"time":"2024-07-02","value":2356.89},{"time":"2024-08-02","value":2442.44},{"time":"2024-09-02","value":2493.00},{"time":"2024-10-02","value":2657.55},{"time":"2024-11-02","value":2734.11},{"time":"2024-12-02","value":2643.67},{"time":"2025-01-02","value":2665.22},{"time":"2025-02-02","value":2812.78},{"time":"2025-03-02","value":2858.16},{"time":"2025-04-02","value":3089.22},{"time":"2025-05-02","value":3378.00},{"time":"2025-06-02","value":3589.22},{"time":"2025-07-02","value":3845.00},{"time":"2025-08-02","value":4023.22},{"time":"2025-09-02","value":4201.44},{"time":"2025-10-02","value":4424.22},{"time":"2025-11-02","value":4602.44},{"time":"2025-12-02","value":4195.77},{"time":"2026-01-02","value":4389.22},{"time":"2026-02-02","value":4968.44},{"time":"2026-03-02","value":5338.09}]; function getChartDataForTF(tf) { const today = DATA_90D[DATA_90D.length - 1]?.time; if (tf === '1W') return DATA_90D.slice(-7); if (tf === '1M') return DATA_90D.slice(-22); if (tf === '3M') return DATA_90D; if (tf === '1Y') return DATA_1Y; if (tf === '5Y') return DATA_5Y; return DATA_90D; } function initChart() { const container = document.getElementById('goldChart'); if (!container || typeof LightweightCharts === 'undefined') return; lwChart = LightweightCharts.createChart(container, { layout: { background: { type: 'solid', color: 'transparent' }, textColor: '#94a3b8', }, grid: { vertLines: { color: 'rgba(255,255,255,0.04)' }, horzLines: { color: 'rgba(255,255,255,0.04)' }, }, crosshair: { mode: LightweightCharts.CrosshairMode.Normal, }, rightPriceScale: { borderColor: 'rgba(255,255,255,0.1)', }, timeScale: { borderColor: 'rgba(255,255,255,0.1)', timeVisible: true, }, handleScroll: false, handleScale: false, }); lwSeries = lwChart.addAreaSeries({ lineColor: '#f59e0b', topColor: 'rgba(245,158,11,0.25)', bottomColor: 'rgba(245,158,11,0.02)', lineWidth: 2, priceFormat: { type: 'price', precision: 2, minMove: 0.01 }, }); loadChartTF('3M'); // Resize observer const ro = new ResizeObserver(() => { if (lwChart) lwChart.applyOptions({ width: container.clientWidth }); }); ro.observe(container); } function loadChartTF(tf) { if (!lwSeries) return; currentTF = tf; const data = getChartDataForTF(tf); lwSeries.setData(data); lwChart.timeScale().fitContent(); // Update stats const values = data.map(d => d.value); const high = Math.max(...values); const low = Math.min(...values); const first = values[0]; const last = values[values.length - 1]; const changePct = ((last - first) / first * 100).toFixed(2); const changeDiff = (last - first).toFixed(2); document.getElementById('chartHigh').textContent = `$${high.toLocaleString('en-US', {minimumFractionDigits:2,maximumFractionDigits:2})}`; document.getElementById('chartLow').textContent = `$${low.toLocaleString('en-US', {minimumFractionDigits:2,maximumFractionDigits:2})}`; const chEl = document.getElementById('chartChange'); const sign = changePct >= 0 ? '+' : ''; chEl.textContent = `${sign}${changePct}% (${changePct >= 0 ? '+' : ''}$${changeDiff})`; chEl.className = `chart-stat-value ${parseFloat(changePct) >= 0 ? 'up' : 'down'}`; // Update active button document.querySelectorAll('.tf-btn').forEach(btn => { btn.classList.toggle('active', btn.dataset.tf === tf); }); } // Timeframe buttons document.querySelectorAll('.tf-btn').forEach(btn => { btn.addEventListener('click', () => loadChartTF(btn.dataset.tf)); }); // ── INFLATION CHART (Chart.js) ────────────────────────────────── function initInflationChart() { const ctx = document.getElementById('inflationChart'); if (!ctx) return; // Inflation-adjusted gold price (real 2024 USD) // Source: World Gold Council / US BLS CPI data const labels = ['2000','2002','2004','2006','2008','2010','2012','2014','2016','2018','2020','2022','2024','2026*']; const nominal = [272, 310, 410, 636, 872, 1225, 1669, 1266, 1252, 1268, 1770, 1801, 2386, 5338]; const real = [490, 527, 643, 930, 1190, 1680, 2150, 1590, 1530, 1480, 1990, 1801, 2386, 5338]; // approx real 2024$ new Chart(ctx, { type: 'line', data: { labels, datasets: [ { label: 'Nominal (USD/oz)', data: nominal, borderColor: '#f59e0b', backgroundColor: 'rgba(245,158,11,0.08)', borderWidth: 2, pointRadius: 2, fill: true, tension: 0.3, }, { label: 'Real (2024 USD)', data: real, borderColor: '#06b6d4', backgroundColor: 'rgba(6,182,212,0.05)', borderWidth: 2, borderDash: [5,3], pointRadius: 2, fill: false, tension: 0.3, } ] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { labels: { color: '#94a3b8', font: { size: 11 }, boxWidth: 14 } }, tooltip: { mode: 'index', intersect: false } }, scales: { x: { ticks: { color: '#64748b', font: { size: 10 } }, grid: { color: 'rgba(255,255,255,0.04)' } }, y: { ticks: { color: '#64748b', font: { size: 10 }, callback: v => '$' + v.toLocaleString() }, grid: { color: 'rgba(255,255,255,0.04)' } } } } }); } // ── SEASONALITY CHART (Chart.js) ──────────────────────────────── function initSeasonalityChart() { const ctx = document.getElementById('seasonalityChart'); if (!ctx) return; const months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; const values = [1.8, 2.1, -0.4, 0.9, -0.2, 1.4, -0.8, 2.3, 0.6, -1.2, 0.3, 1.1]; const colors = values.map(v => v >= 0 ? 'rgba(16,185,129,0.75)' : 'rgba(239,68,68,0.75)'); new Chart(ctx, { type: 'bar', data: { labels: months, datasets: [{ label: 'Avg. Monthly Return (%)', data: values, backgroundColor: colors, borderRadius: 4, }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false }, tooltip: { callbacks: { label: ctx => `${ctx.parsed.y >= 0 ? '+' : ''}${ctx.parsed.y.toFixed(1)}%` } } }, scales: { x: { ticks: { color: '#64748b', font: { size: 10 } }, grid: { display: false } }, y: { ticks: { color: '#64748b', font: { size: 10 }, callback: v => v + '%' }, grid: { color: 'rgba(255,255,255,0.04)' }, suggestedMin: -2, suggestedMax: 3 } } } }); } // ── NEWS TICKER ───────────────────────────────────────────────── async function loadNews() { const staticNews = [ 'Gold hits new record above $5,300 amid Middle East tensions', 'Central banks bought over 1,000 tonnes of gold for third consecutive year', 'Silver demand surges driven by solar panel manufacturing boom', 'Platinum group metals face supply constraints from South African mines', 'Gold/Silver ratio falls below 57 – historical pattern: silver outperformance (not a recommendation)', 'ECB holds rates steady; gold benefits from negative real yields in Europe', 'India gold imports surge ahead of wedding season', 'WGC: Gold ETF holdings stabilise after Q4 2025 outflows', 'Palladium recovers as EV transition slower than expected', 'US Dollar Index weakens; gold priced in EUR approaches €5,000/oz', ]; const lang = window.location.pathname.startsWith('/de/') ? 'de' : window.location.pathname.startsWith('/fr/') ? 'fr' : window.location.pathname.startsWith('/es/') ? 'es' : 'en'; // Try PHP proxy first try { const res = await fetch(`/assets/data/news_proxy.php?feed=gold&lang=${lang}`, { signal: AbortSignal.timeout(5000) }); if (res.ok) { const data = await res.json(); if (data.items && data.items.length > 0) { renderNews(data.items.map(i => i.title)); return; } } } catch(e) {} // Fallback: static renderNews(staticNews); } function renderNews(headlines) { const inner = document.getElementById('newsTickerInner'); if (!inner) return; const html = headlines.map(h => `${h}` ).join(''); inner.innerHTML = html + html; // duplicate for seamless loop // Dynamic speed const totalChars = headlines.join('').length; const duration = Math.max(40, Math.min(90, totalChars * 0.05)); inner.style.animationDuration = duration + 's'; } // ── FAQ ACCORDION ─────────────────────────────────────────────── document.querySelectorAll('.faq-question').forEach(q => { q.addEventListener('click', () => { const item = q.closest('.faq-item'); const wasOpen = item.classList.contains('open'); document.querySelectorAll('.faq-item').forEach(i => i.classList.remove('open')); if (!wasOpen) item.classList.add('open'); }); }); // ── LANG DROPDOWN ─────────────────────────────────────────────── const langBtn = document.getElementById('langButton'); const langDrop = document.getElementById('langDropdown'); langBtn.addEventListener('click', e => { e.stopPropagation(); langDrop.classList.toggle('active'); }); document.addEventListener('click', () => langDrop.classList.remove('active')); // ── MAIN API FETCH ────────────────────────────────────────────── function getYesterdayStr() { const d = new Date(); d.setDate(d.getDate() - 1); if (d.getDay() === 0) d.setDate(d.getDate() - 2); if (d.getDay() === 6) d.setDate(d.getDate() - 1); return d.toISOString().split('T')[0]; } // === TWELVE DATA API (Echtzeit Gold) === const TWELVE_DATA_KEY = 'a93243c3685748df92c6c37d089c4f40'; async function fetchTwelveDataGold() { // Returns { price, open, change, percent_change } for XAU/USD try { const url = `https://api.twelvedata.com/quote?symbol=XAU/USD&apikey=${TWELVE_DATA_KEY}`; const res = await fetch(url, { signal: AbortSignal.timeout(8000) }); if (!res.ok) throw new Error('TwelveData error'); const d = await res.json(); if (d.status === 'error' || !d.close) throw new Error(d.message || 'No data'); return { price: parseFloat(d.close), open: parseFloat(d.open), change: parseFloat(d.change), percent_change: parseFloat(d.percent_change) }; } catch(e) { console.warn('TwelveData failed:', e.message); return null; } } async function fetchFawazPrice(code) { const url = `https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/${code.toLowerCase()}.json`; const res = await fetch(url, { signal: AbortSignal.timeout(8000) }); if (!res.ok) throw new Error('API error'); const data = await res.json(); return data[code.toLowerCase()]['usd']; } async function fetchFawazPriceYesterday(code) { const url = `https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@${getYesterdayStr()}/v1/currencies/${code.toLowerCase()}.json`; try { const res = await fetch(url, { signal: AbortSignal.timeout(8000) }); if (!res.ok) return null; const data = await res.json(); return data[code.toLowerCase()]['usd']; } catch { return null; } } async function fetchFrankfurterRates() { const CURRENCIES = 'AUD,BRL,CAD,CHF,CNY,CZK,DKK,EUR,GBP,HUF,INR,JPY,MXN,NOK,PLN,SEK,TRY,USD'; const res = await fetch(`https://api.frankfurter.dev/v1/latest?base=USD&symbols=${CURRENCIES}`, { signal: AbortSignal.timeout(8000) }); if (!res.ok) throw new Error('Frankfurter error'); const data = await res.json(); fxRates = { USD: 1, ...data.rates }; } async function fetchYahooPrices() { // Primary: own PHP proxy on Hostinger → Yahoo Finance const proxyUrl = '/assets/data/yahoo_prices.php'; try { const res = await fetch(proxyUrl, { signal: AbortSignal.timeout(6000) }); if (!res.ok) throw new Error('proxy error'); const data = await res.json(); if (data.success && data.prices) return data.prices; } catch (e) { /* fallback below */ } return null; } async function loadAllData() { try { // === TIER 1: Twelve Data (Echtzeit, direkt, CORS-frei) === const tdGold = await fetchTwelveDataGold(); // === TIER 2: Yahoo Finance proxy (für Silber, Platin, Palladium, Öl) === const yahooPrices = await fetchYahooPrices(); let yahooSilver = null, yahooPlatinum = null, yahooPalladium = null, yahooOil = null; if (yahooPrices) { if (yahooPrices.silver) yahooSilver = yahooPrices.silver.price; if (yahooPrices.platinum) yahooPlatinum = yahooPrices.platinum.price; if (yahooPrices.palladium) yahooPalladium = yahooPrices.palladium.price; if (yahooPrices.oil) yahooOil = yahooPrices.oil; } // === TIER 3: fawazahmed0 Fallback für fehlende Preise === const [silverT, platinumT, palladiumT, goldFawaz, goldFawazY] = await Promise.allSettled([ yahooSilver ? Promise.resolve(yahooSilver) : fetchFawazPrice('XAG'), yahooPlatinum ? Promise.resolve(yahooPlatinum) : fetchFawazPrice('XPT'), yahooPalladium ? Promise.resolve(yahooPalladium) : fetchFawazPrice('XPD'), tdGold ? Promise.resolve(tdGold.price) : fetchFawazPrice('XAU'), tdGold ? Promise.resolve(null) : fetchFawazPriceYesterday('XAU'), ]); await fetchFrankfurterRates(); // Determine source label let srcLabel = 'fawazahmed0 API'; let updateInterval = '15 min'; if (tdGold) { srcLabel = 'Twelve Data (Real-Time)'; updateInterval = '30 sec'; } else if (yahooPrices) { srcLabel = 'Yahoo Finance'; updateInterval = '5 min'; } const srcEl = document.getElementById('priceSource'); if (srcEl) srcEl.textContent = `per troy oz · Updated every ${updateInterval} · Source: ${srcLabel}`; // Gold price: Twelve Data > fawazahmed0 goldPrice = tdGold ? tdGold.price : (goldFawaz.status === 'fulfilled' ? goldFawaz.value : 5338.09); // Yesterday price for % change: from Twelve Data open or fawazahmed0 goldPriceYesterday = tdGold ? tdGold.open : (goldFawazY.status === 'fulfilled' ? goldFawazY.value : null); silverPrice = silverT.status === 'fulfilled' ? silverT.value : 93.84; const platinumPrice = platinumT.status === 'fulfilled' ? platinumT.value : 2363.99; const palladiumPrice = palladiumT.status === 'fulfilled' ? palladiumT.value : 1790.49; // Update Oil ticker if Yahoo data available if (yahooOil) { OIL_LIVE_PRICE = yahooOil.price; OIL_LIVE_CHANGE_PCT = yahooOil.change_pct; OIL_LIVE_CHANGE_NOM = yahooOil.change; } // Update all UI updatePriceHero(goldPrice, goldPriceYesterday); updateUnits(goldPrice); updateCalculator(); updateCoins(goldPrice); updateTicker({ gold: goldPrice, goldY: goldPriceYesterday, silver: silverPrice, silverY: null, platinum: platinumPrice, platinumY: null, palladium: palladiumPrice, palladiumY: null, rhodium: 4800, rhodiumY: 4800, }); // Update last data point in chart if (lwSeries && goldPrice) { const today = new Date().toISOString().split('T')[0]; // Update last point in all datasets [DATA_90D, DATA_1Y, DATA_5Y].forEach(dataset => { if (dataset.length > 0) dataset[dataset.length - 1].value = goldPrice; }); loadChartTF(currentTF); } const src = tdGold ? 'Twelve Data (REAL-TIME)' : (yahooPrices ? 'Yahoo Finance' : 'fawazahmed0'); console.log(`✅ Gold page loaded | XAU: $${goldPrice} | Source: ${src}`); } catch(e) { console.warn('API load failed, using embedded data:', e); goldPrice = DATA_90D[DATA_90D.length - 1]?.value || 5338.09; updatePriceHero(goldPrice, null); updateUnits(goldPrice); updateCalculator(); updateCoins(goldPrice); } } // ── INIT ───────────────────────────────────────────────────────── document.addEventListener('DOMContentLoaded', () => { initChart(); initInflationChart(); initSeasonalityChart(); loadAllData(); loadNews(); // Auto-refresh: 30 Sekunden für Twelve Data (Echtzeit), Fallback nutzt gleichen Timer setInterval(loadAllData, 30 * 1000); setInterval(loadNews, 30 * 60 * 1000); // ── BOOKMARK BUTTON ── document.getElementById('bookmarkBtn').addEventListener('click', () => { if (window.sidebar && window.sidebar.addPanel) { window.sidebar.addPanel(document.title, window.location.href, ''); } else if (window.external && ('AddFavorite' in window.external)) { window.external.AddFavorite(window.location.href, document.title); } else { const isMac = navigator.platform.toUpperCase().includes('MAC'); const key = isMac ? '⌘' : 'Ctrl'; alert(`Press ${key}+D to bookmark this page.`); } }); // ── COFFEE MODAL ── const coffeeModal = document.getElementById('coffeeModal'); const coffeeClose = document.getElementById('coffeeClose'); const coffeeDonateBtn = document.getElementById('coffeeDonateBtn'); let selectedCoffeeAmount = 3.00; let selectedCoffeeDescription = 'One Coffee'; document.getElementById('coffeeBtn').addEventListener('click', () => { coffeeModal.classList.add('active'); document.body.style.overflow = 'hidden'; }); coffeeClose.addEventListener('click', () => { coffeeModal.classList.remove('active'); document.body.style.overflow = 'auto'; }); coffeeModal.addEventListener('click', (e) => { if (e.target === coffeeModal) { coffeeModal.classList.remove('active'); document.body.style.overflow = 'auto'; } }); document.querySelectorAll('.coffee-amount').forEach(btn => { btn.addEventListener('click', () => { document.querySelectorAll('.coffee-amount').forEach(b => b.classList.remove('active')); btn.classList.add('active'); selectedCoffeeAmount = parseFloat(btn.dataset.amount); const counts = {3: 'One Coffee', 9: 'Three Coffees', 15: 'Five Coffees'}; selectedCoffeeDescription = counts[selectedCoffeeAmount] || 'Coffee'; coffeeDonateBtn.textContent = `Donate $${selectedCoffeeAmount.toFixed(2)} via PayPal`; }); }); coffeeDonateBtn.addEventListener('click', (e) => { e.preventDefault(); // PayPal Business Account: paypal@scopewire.de const paypalEmail = 'paypal@scopewire.de'; const amount = selectedCoffeeAmount.toFixed(2); const itemName = encodeURIComponent(`Donation for Numexo Gold Analysis: ${selectedCoffeeDescription}`); const currency = 'USD'; const paypalLink = `https://www.paypal.com/send?money=${amount}¤cy_code=${currency}&from=website&email=${encodeURIComponent(paypalEmail)}&item_name=${itemName}`; window.open(paypalLink, '_blank', 'noopener,noreferrer'); setTimeout(() => { alert(`Thank you for your support! \u2665\ufe0f\nYou will be redirected to PayPal to complete your $${amount} donation to ${paypalEmail}.`); }, 500); }); });