🏛️ National Debt Ticker
Step 1: Fetch World Bank GC.DOD.TOTL.GD.ZS → debt as % of GDP (e.g. 43.2%)
Step 2: Fetch World Bank NY.GDP.MKTP.CD → GDP in current US dollars
Step 3: Fetch live Frankfurter NZD/USD rate → convert debt to NZD
Step 4: Calculate base debt at WB data year-end: Debt NZD = (GDP USD × debt%) ÷ NZD/USD
Step 5: Extrapolate to today: Base + (years elapsed × annual deficit NZD)
Step 6: Annual deficit = WB fiscal balance % × GDP NZD ÷ 31,557,600 seconds → ticks every second
👤 Debt Per Person
Total current debt ÷ World Bank SP.POP.TOTL (population)
Updates every second as debt ticker changes. Population from WB API, year shown inline.
💼 Debt Per Taxpayer
Total current debt ÷ estimated employed population
Employed population = WB population × labour force participation rate × (1 − unemployment rate)
All three values fetched from World Bank API — no hardcoded ratios.
💱 NZD Exchange Rates
api.frankfurter.app/latest?from=NZD — European Central Bank data served by Frankfurter.app
Free, no API key, CORS-safe, retries 4× with 15s timeout. Progress bar shows rate within 52-week-ish range.
📈 Markets (Brent, Gold, Silver, NZX50)
Yahoo Finance public API via CORS proxy (allorigins.win → corsproxy.io fallback)
Symbols: BZ=F (Brent) · GC=F (Gold) · SI=F (Silver) · ^NZ50 (NZX 50)
% change = (current price − previous close) ÷ previous close × 100
⛽ NZ Petrol Estimate
(Brent USD/bbl ÷ 158.987 L/bbl) ÷ NZD/USD = crude cost in NZD per litre
× 1.48 (refining, distribution, retail margin) + NZ$0.87 (est. NZ fuel excise + ACC + GST component)
This is an approximation only (±5%). Not a live pump price.
📰 NZ News
Radio New Zealand RSS feed rnz.co.nz/rss/news.xml
Fetched via rss2json.com (primary) → allorigins.win XML parse (fallback). Refreshes every hour.
⚠️ Important Notes
World Bank data lags 1–2 years behind real-time. The debt ticker is an estimate extrapolated from the most recent WB data available, not an official NZ Treasury figure. For official figures see:
treasury.govt.nz and
stats.govt.nz