The renminbi (“people’s currency”) is the currency of mainland China; the yuan is its unit. China’s role in global trade makes CNY a core currency for importers, marketplaces and supply-chain software, even though the currency is not fully convertible for capital transactions. The fxapi CNY exchange rate API returns yuan rates against 190+ currencies, and its history since 1999 spans the end of the dollar peg and the 2015 change to the daily fixing.
CNY facts for developers
- Where it’s used: mainland China. Hong Kong and Macau have their own currencies (HKD and MOP).
- Symbol and formatting:
¥(also元in Chinese text), shared with the Japanese yen – useCN¥orRMBwhere needed. Format:¥1,234.56. - Minor unit: 2 decimals. One yuan is 10 jiao or 100 fen.
- Central bank: the People’s Bank of China (PBOC).
- Regime: managed. The PBOC publishes a daily central parity rate, and onshore spot trading against the US dollar is limited to a band around it (±2% since 2014).
- Onshore vs offshore: yuan traded outside the mainland, mainly in Hong Kong, is quoted as “CNH” and can differ from onshore CNY. fxapi lists CNY only.
- Events in the historical data: the yuan was held at about 8.28 per US dollar until 21 July 2005, when China revalued it and moved to a managed float with reference to a basket. On 11 August 2015 – the sample date on this page – the PBOC changed how the central parity is set, and the yuan fell by roughly 2% against the dollar that day.
Get CNY rates with the fxapi API
/v1/historical is available on every plan and returns end-of-day (UTC) values. This Go program walks through the days around the August 2015 change:
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
func usdCNY(date string) (float64, error) {
url := "https://api.fxapi.com/v1/historical?currencies=CNY&date=" + date
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return 0, err
}
req.Header.Set("apikey", os.Getenv("FXAPI_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
return 0, err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return 0, fmt.Errorf("fxapi returned %s", resp.Status)
}
var out struct {
Data map[string]struct{ Value float64 } `json:"data"`
}
if err := json.NewDecoder(resp.Body).Decode(&out); err != nil {
return 0, err
}
return out.Data["CNY"].Value, nil
}
func main() {
for _, d := range []string{"2015-08-10", "2015-08-11", "2015-08-12", "2015-08-13"} {
v, err := usdCNY(d)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s USD/CNY %.4f\n", d, v)
}
}
For a single start-to-end comparison, the free fluctuation endpoint returns the change in one call. See the Go guide and the historical exchange rates API.
Things to watch
- CNY vs CNH. If your payment provider settles in offshore yuan, its rate can differ from the CNY value.
- Fixing ≠ market rate. The PBOC central parity is a reference; fxapi returns market rates.
- Symbol collisions with JPY – never infer the currency from
¥.
Popular CNY pairs
Request any of these pairs – or any other combination of the 190+ supported currencies – with base_currency=CNY:
| Pair | Latest rate request |
|---|---|
| CNY/USD | /v1/latest?base_currency=CNY¤cies=USD |
| CNY/EUR | /v1/latest?base_currency=CNY¤cies=EUR |
| CNY/HKD | /v1/latest?base_currency=CNY¤cies=HKD |
| CNY/JPY | /v1/latest?base_currency=CNY¤cies=JPY |
| CNY/KRW | /v1/latest?base_currency=CNY¤cies=KRW |
| CNY/GBP | /v1/latest?base_currency=CNY¤cies=GBP |
| CNY/AUD | /v1/latest?base_currency=CNY¤cies=AUD |
Monthly averages and fluctuation for CNY
# Monthly average CNY 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=CNY -d currencies=USD,EUR,HKD \
-H "apikey: $FXAPI_KEY"
# How did CNY 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=CNY -d currencies=USD,EUR,HKD \
-H "apikey: $FXAPI_KEY"See the historical exchange rates API, average rates API and documentation for every parameter.
CNY is one of 190+ currencies in fxapi, the FX 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 CNY exchange rate via API?
/v1/latest?currencies=CNY with your key in the apikey header. USD is the default base, so the value is yuan per 1 US dollar.Does fxapi provide offshore CNH rates?
Does fxapi have yuan rates before 1999?
Why do yuan and yen share the ¥ symbol?
¥. Use CN¥, RMB or the ISO code in multi-currency interfaces, and see the Japanese yen page for JPY specifics.