Hong Kong is a major international financial center, and its currency works differently from most: the Hong Kong dollar is tied to the US dollar through a currency board arrangement. For developers this means USD/HKD is almost constant, while HKD/EUR, HKD/JPY or HKD/CNY move with the dollar. The fxapi HKD exchange rate API returns all of them, and the peg makes a good automated sanity check for your data pipeline.
HKD facts for developers
- Where it’s used: Hong Kong. It is also widely accepted in Macau, whose pataca (MOP) is in turn linked to the Hong Kong dollar.
- Symbol and formatting:
$, writtenHK$to distinguish it from other dollars. Format:HK$1,234.50. - Minor unit: 2 decimals (cents).
- Issuer: the Hong Kong Monetary Authority (HKMA) runs the currency board. Banknotes are issued by three commercial banks – HSBC, Standard Chartered and Bank of China (Hong Kong) – plus the government’s own HK$10 note.
- Regime: the Linked Exchange Rate System has fixed the Hong Kong dollar to the US dollar since 1983, originally at 7.80. On 18 May 2005 – the sample date on this page – the HKMA introduced a strong-side Convertibility Undertaking at 7.75 and announced that the weak side would move from 7.80 to 7.85 (completed on 20 June 2005), creating today’s band symmetric around 7.80.
- Events in the historical data: before the 2005 refinements there was no formal strong-side limit, so a band check should only run on dates after mid-2005. The interesting moves are in HKD’s rates against other currencies, which mirror the US dollar.
Get HKD rates with the fxapi API
/v1/latest works on every plan, and Professional and Enterprise refresh it every 60 seconds. This Ruby script fetches USD/HKD and raises an alert if a value falls outside the band – a cheap check that your rate feed and parsing are sane:
require "net/http"
require "json"
BAND = (7.75..7.85)
uri = URI("https://api.fxapi.com/v1/latest")
uri.query = URI.encode_www_form(base_currency: "USD", currencies: "HKD,CNY,EUR")
req = Net::HTTP::Get.new(uri)
req["apikey"] = ENV.fetch("FXAPI_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
raise "fxapi returned #{res.code}" unless res.is_a?(Net::HTTPSuccess)
body = JSON.parse(res.body)
data = body["data"]
usd_hkd = data.dig("HKD", "value")
warn "USD/HKD #{usd_hkd} outside 7.75–7.85 – check your feed" unless BAND.cover?(usd_hkd.round(4))
# Cross rate: HKD per 1 EUR, derived through USD
puts format("USD/HKD %.4f EUR/HKD %.4f (as of %s)",
usd_hkd, usd_hkd / data.dig("EUR", "value"), body.dig("meta", "last_updated_at"))
The cross rate is derived through the dollar – learn how in base currency and cross rates. For a plain feed of live values see the real-time exchange rates API, and for back-dated checks the historical exchange rates API. The Ruby guide covers retries and caching, and the US dollar page lists other dollar pegs.
Things to watch
- Allow tiny tolerance. Market rates can touch the band edges; compare with a rounded value rather than strict equality.
- CNY vs CNH. Hong Kong is the main offshore yuan market (CNH), but fxapi lists the yuan only under its ISO code CNY.
- Same
$sign. ShowHK$orHKDnext to prices that could be read as US dollars.
Popular HKD pairs
Request any of these pairs – or any other combination of the 190+ supported currencies – with base_currency=HKD:
| Pair | Latest rate request |
|---|---|
| HKD/USD | /v1/latest?base_currency=HKD¤cies=USD |
| HKD/CNY | /v1/latest?base_currency=HKD¤cies=CNY |
| HKD/EUR | /v1/latest?base_currency=HKD¤cies=EUR |
| HKD/GBP | /v1/latest?base_currency=HKD¤cies=GBP |
| HKD/JPY | /v1/latest?base_currency=HKD¤cies=JPY |
| HKD/SGD | /v1/latest?base_currency=HKD¤cies=SGD |
| HKD/MOP | /v1/latest?base_currency=HKD¤cies=MOP |
Monthly averages and fluctuation for HKD
# Monthly average HKD rates for 2025 (IAS 21 / ASC 830)
curl -G "https://api.fxapi.com/v1/average" \
-d date_from=2025-01-01 -d date_to=2025-12-31 -d period=month \
-d base_currency=HKD -d currencies=USD,CNY,EUR \
-H "apikey: $FXAPI_KEY"
# How did HKD move over the last year?
curl -G "https://api.fxapi.com/v1/fluctuation" \
-d date_from=2025-10-01 -d date_to=2026-10-01 \
-d base_currency=HKD -d currencies=USD,CNY,EUR \
-H "apikey: $FXAPI_KEY"See the historical exchange rates API, average rates API and documentation for every parameter.
HKD is one of 190+ currencies in fxapi, the foreign exchange rates API for developers – live rates, daily history since 1999 and monthly averages with one API key.
Frequently asked questions
How do I get the USD to HKD exchange rate via API?
/v1/latest?currencies=HKD with your key in the apikey header. With the default USD base, the value is Hong Kong dollars per 1 US dollar and should sit between 7.75 and 7.85.Is the Hong Kong dollar pegged to the US dollar?
Does fxapi have HKD rates before 1999?
Can I get the HKD to CNY rate?
base_currency=HKD¤cies=CNY. Note that fxapi lists the yuan under its ISO code CNY; there is no separate offshore CNH code.