Hungarian Forint (HUF) Price Today — Live Exchange Rate and API Endpoint Details
You need the live Hungarian forint (HUF) rate you can trust right now, plus a clean way to pull it into your pricing, hedging, or P&L tools. By the end of this guide you’ll query the Metals-API latest endpoint for HUF, parse a real JSON response, compute both HUF-per-USD and USD-per-HUF, and know how to backfill, cache, and handle weekends safely.
What you’re building: reliable HUF pricing for apps and dashboards
Common workflows that need a robust HUF feed include:
- Converting a USD-denominated metals quote into HUF for a Hungarian storefront or ERP.
- Displaying a “HUF today” banner on a trading page and updating it on a schedule.
- Backfilling historical HUF rates to normalize older fills or build charts.
We’ll focus on two Metals-API endpoints that solve this end to end: Latest (for the live HUF print) and Historical (for a specific past date). When you’re ready to zoom out to multi-day ranges, the Time-series endpoint is the next step. Full endpoint details and optional parameters are documented in the Metals-API Documentation.
How Metals-API represents HUF: base currency and inverse pairs
Metals-API returns rates relative to a base currency (by default USD). For currencies:
- rates.HUF means HUF per 1 USD.
- rates.USDHUF means USD per 1 HUF (the inverse).
This mirrors how metals are exposed too (for example, rates.XAG is ounces per USD while rates.USDXAG is USD per ounce). For HUF, you’ll typically need both sides depending on whether you’re converting USD→HUF (use HUF per USD) or HUF→USD (use USD per HUF), and Metals-API can return both symbols in a single call.
Live HUF today: one request, two rates you’ll actually use
Use the Latest endpoint and request both HUF and USDHUF. Keep the base at USD so the numbers are intuitive for finance and e-commerce stacks that start with USD as the accounting currency.
Copy-paste curl request
curl "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&symbols=HUF,USDHUF"
Official JSON response example
The block below is a real Metals-API response. Do not hardcode values; your app should handle live values from the endpoint at runtime.
{"success":true,"timestamp":1792627800,"date":"2026-10-22","base":"USD","rates":{"HUF":325.033713,"USD":1,"USDHUF":0.0030766039336971797}}
What these fields mean (and how to use them)
- success: Boolean. Check this first; if false, handle the API error payload.
- timestamp: Unix time (seconds) for when the rates were last refreshed. Treat as UTC. Use it to drive caching and staleness warnings in your UI.
- date: Calendar date of the rates. Useful for logs and human-readable display.
- base: USD. All values in rates are relative to 1 USD unless the base is changed.
- rates.HUF: 325.033713 means 1 USD = 325.033713 HUF.
- rates.USDHUF: 0.0030766039336971797 means 1 HUF = 0.0030766039 USD (the inverse).
Quick reference for symbols you’ll request
| Symbol | Meaning (base USD) | Typical usage |
|---|---|---|
| HUF | HUF per 1 USD | Convert USD prices to HUF for storefronts, invoices |
| USDHUF | USD per 1 HUF | Convert HUF balances to USD for P&L, settlement |
| USD | 1 (the base) | Sanity checks, internal cross-rates |
Python example: fetch HUF now, display both sides, and convert amounts
This sample calls the same Latest endpoint as above, reads the timestamp for staleness checks, and performs round-trip conversions. Replace YOUR_API_KEY with the key from your account.
import os
import time
import requests
API_KEY = os.getenv("METALS_API_KEY", "YOUR_API_KEY")
URL = "https://metals-api.com/api/latest"
params = {
"access_key": API_KEY,
"symbols": "HUF,USDHUF"
}
resp = requests.get(URL, params=params, timeout=10)
resp.raise_for_status()
data = resp.json()
if not data.get("success"):
raise RuntimeError(f"Metals-API error: {data}")
# Core fields
ts = data["timestamp"] # Unix seconds, UTC
as_of_date = data["date"] # YYYY-MM-DD
base = data["base"] # Expected 'USD'
huf_per_usd = data["rates"]["HUF"]
usd_per_huf = data["rates"]["USDHUF"]
print(f"As of {as_of_date} (timestamp={ts}, base={base}):")
print(f" 1 USD = {huf_per_usd:.6f} HUF")
print(f" 1 HUF = {usd_per_huf:.10f} USD")
# Conversions you’ll actually do
usd_amount = 129.99
huf_amount = 100000
usd_to_huf = usd_amount * huf_per_usd
huf_to_usd = huf_amount * usd_per_huf
print(f"\n{usd_amount} USD → {usd_to_huf:,.2f} HUF")
print(f"{huf_amount:,} HUF → {huf_to_usd:,.2f} USD")
# Basic staleness logic (e.g., warn if older than 15 minutes)
age_sec = time.time() - ts
if age_sec > 15 * 60:
print(f"Warning: HUF rate is {int(age_sec/60)} minutes old. Consider refreshing or labeling as delayed.")
Tip: If for any reason USDHUF isn’t present in your symbol set, compute it as 1.0 / rates["HUF"]. Requesting both HUF and USDHUF in one call is preferred to avoid floating-point drift across multiple requests.
Historical HUF for backfills and audit
To query an earlier date, use the Historical endpoint by appending a date (YYYY-MM-DD) to the API path and add symbols=HUF,USDHUF. Typical use cases:
- Backfilling HUF close for P&L on a specific booking date.
- Normalizing older orders and invoices to a consistent accounting date.
Example shape (do not copy a response; always use live API data):
GET https://metals-api.com/api/2026-10-21?access_key=YOUR_API_KEY&symbols=HUF,USDHUF
You’ll receive the same JSON structure as Latest, but locked to the date you request. Dates are calendar dates; if you request a weekend or a market holiday, the API may return the latest available rate around that date—plan to label appropriately in the UI.
Optional: HUF time windows for charts or analytics
For multi-day charts or volatility studies, the Time-series endpoint retrieves daily rates between two dates. Use start_date, end_date, and symbols=HUF (and USDHUF if you need the inverse). This is efficient versus looping over day-by-day calls. See request/response details in the Time-series section of the Documentation.
Practical integration notes that save time
1) Base currency and what that means for HUF
- Default base is USD. rates.HUF is “HUF per USD.”
- If you change the base (e.g., base=HUF), interpret all rates accordingly. Many teams keep USD as base and fetch USDHUF to avoid confusion.
2) Units: FX vs. metals
- Currency pairs like HUF are unitless ratios; interpret them as “currency per 1 base-unit.”
- If you combine FX with metals in the same app—say, converting a metal ounce quote into HUF—remember that metals are quoted per troy ounce by default. Always label “per troy ounce” when showing metals prices next to currencies to avoid unit confusion.
3) Timestamps, timezone, and staleness
- timestamp is Unix seconds, UTC. Use it to compute the data age and decide when to refresh.
- date is a YYYY-MM-DD string; treat it as the reference calendar day for the quote.
- Depending on your subscription, updates occur at different frequencies. Align your refresh cadence and cache TTL with that frequency to avoid waste and surprise UI flicker.
4) Caching and cost control
- Cache the Latest response for at least the shortest expected refresh cadence on your plan (for example, 60 seconds or 10 minutes). This prevents bursts during page loads and further smooths your UI.
- At the CDN layer, vary the cache key by the symbols parameter so HUF and USDHUF requests are coalesced properly.
- In backends, memoize by timestamp to ensure multiple services reuse the same value within the refresh window.
5) Weekends and holidays
- FX markets are largely 24x5. On weekends and certain holidays, you may see the previous business day’s value. Use the timestamp and date fields to label data as “Last close” or “Delayed.”
- When querying Historical for a weekend date, handle the case where the returned timestamp aligns to the nearest available session.
6) Error handling and fallbacks
- Always check success before reading rates. If false, the response will include an error payload you should log and surface to monitoring.
- If you rely on USDHUF but it’s absent, compute it from HUF: inverse = 1.0 / rates.HUF.
7) Precision and rounding
- In UI, format HUF-per-USD with up to 3–6 decimals depending on your product’s needs.
- For accounting or payment amounts, set a deterministic rounding mode server-side and be consistent across conversions.
8) Metals + HUF in one request
Many teams price metals in HUF directly. You can request metals and HUF together, then multiply appropriately. For example: get XAU (ounces per USD) and HUF (HUF per USD); the implied HUF per ounce is (HUF per USD) / (ounces per USD) only if you also request USDXAU (USD per ounce). A safer pattern is to request USDXAU (USD per ounce) and HUF (HUF per USD), then compute HUF per ounce = (USD per ounce) × (HUF per USD). When mixing symbols, double-check units and inverses before multiplying.
To confirm available symbols for your plan and metals of interest, review the Metals-API Supported Symbols.
Designing your “HUF today” widget
A simple yet robust widget should:
- Call Latest with symbols=HUF,USDHUF on load and at a plan-aligned interval.
- Display both sides:
- 1 USD = N HUF (big type)
- 1 HUF = M USD (small caption)
- Show an as-of timestamp in local time, derived from timestamp (UTC) with user’s timezone.
- Warn when data age exceeds your SLA (e.g., more than 15 minutes old).
- Offer an inline calculator for quick conversions (USD→HUF and HUF→USD).
Testing strategies and monitoring
- Compare spot checks against an independent source for sanity only (e.g., the Hungarian central bank’s published references at Magyar Nemzeti Bank). Expect small timing differences versus live feeds.
- Alert on missing symbols or if success=false to catch auth/config regressions early.
- Graph the returned timestamp age over time to detect network or plan misconfiguration.
Security, keys, and plans
- Do not embed your API key in client code or public repositories. Proxy through your backend or use server-side rendering.
- Metals-API does not offer a free trial. If you need production-grade HUF plus metals data, pick a plan that matches your update cadence.
- If your focus is copper and you quote in HUF, note that Copper Monthly is $19.99/mo, then add HUF symbols to your requests as shown above.
Create your key here: Register. For managed connectivity and enterprise delivery options, see MCP.
Troubleshooting checklist
- Getting unexpected magnitudes? Confirm your base is USD and that you’re using the right side (HUF vs. USDHUF).
- Seeing old data on weekends? Compare timestamp to your labeling and consider pausing refresh timers until markets reopen.
- Inconsistent amounts across microservices? Centralize conversions in one service and cache by symbols set + timestamp.
- Receiving HTTP 4xx? Check your access_key and the symbols you’ve requested against your plan tier.
Where to go next
- Endpoint parameters, error formats, and advanced usage: Documentation
- Verify available symbols and inverses (HUF, USDHUF, metals you intend to price in HUF): Symbols
FAQ
How do I get both 1 USD in HUF and 1 HUF in USD in one request?
Request symbols=HUF,USDHUF from the Latest endpoint with base=USD (default). Use rates.HUF for USD→HUF and rates.USDHUF for HUF→USD.
Which value should I display to end users by default?
Most sites show 1 USD = N HUF prominently (rates.HUF), and optionally include 1 HUF = M USD (rates.USDHUF) as a secondary line or tooltip.
How should I handle weekends or holidays?
Use the timestamp field to label data as of last refresh. If you see the timestamp age exceed your SLA, display “Last close” or “As of [timestamp]” and throttle refresh attempts until markets reopen.
What if USDHUF isn’t returned?
Compute it as 1.0 / rates.HUF. Prefer requesting both symbols together to keep numbers in sync.
Can I combine metals and HUF in the same response?
Yes. Include both the metal symbol on the USD side you need (often USDXAU, USDXAG, etc.) and HUF or USDHUF. Then multiply carefully with consistent units (metals are per troy ounce).
Ready to ship your HUF integration? Create an API key and start pulling the live forint rate into your tools today: Register. For deployment options and managed connectivity, see MCP.