Retrieve Chinese Renminbi Yuan Offshore (CNH) prices using this API
Retrieve Chinese Renminbi Yuan Offshore (CNH) Prices Using Metals-API
The Chinese Renminbi Yuan Offshore (CNH) plays a crucial role in global finance, especially in the context of international trade and investment. As the demand for real-time data on currency exchange rates and metal prices increases, developers are seeking innovative solutions to integrate this information into their applications. One such solution is the Metals-API, which provides comprehensive access to metals pricing and currency conversion data, including CNH. This blog post will explore the capabilities of the Metals-API, its endpoints, and how developers can leverage this technology to enhance their applications.
About Chinese Renminbi Yuan (CNY)
The Chinese Renminbi (CNY) has undergone significant transformation in recent years, particularly with the rise of digital currencies and the integration of smart technologies in financial markets. As the world increasingly shifts towards digital transformation, the metal markets are no exception. The integration of data analytics and insights allows for more informed decision-making, while technological advancements enable real-time tracking of currency fluctuations.
In the context of the CNH, developers can utilize the Metals-API to access real-time exchange rates, historical data, and various analytical tools. This not only enhances the ability to monitor market trends but also empowers businesses to make strategic decisions based on accurate and timely information.
API Description
The Metals-API is a powerful tool designed for developers looking to access real-time metals pricing and currency conversion data. With its innovative architecture, the API allows for seamless integration into applications, enabling developers to build next-generation solutions that respond to the dynamic nature of the financial markets. The API provides a variety of endpoints, each tailored to meet specific needs, from retrieving the latest rates to accessing historical data.
For detailed information on how to use the API, developers can refer to the Metals-API Documentation, which outlines the various endpoints, their functionalities, and implementation guidelines.
Key Features and Endpoints
The Metals-API offers a range of features that cater to different aspects of currency and metals data retrieval. Here are some of the key endpoints and their functionalities:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated every 60 minutes, every 10 minutes, or even more frequently, depending on the subscription plan. Developers can easily access the latest rates for CNH and other currencies.
- Historical Rates Endpoint: Historical rates dating back to 2019 are available for most currencies. By appending a specific date in the YYYY-MM-DD format, developers can query the API for historical rates, allowing for in-depth analysis of market trends over time.
- Bid and Ask Endpoint: This powerful feature enables developers to retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The conversion endpoint allows users to convert any amount from one currency to another, facilitating transactions and financial analysis across different currencies, including CNH.
- Time-Series Endpoint: Developers can query the API for daily historical rates between two specified dates, offering a comprehensive view of price movements over time.
- Fluctuation Endpoint: This endpoint provides information on how currencies fluctuate on a day-to-day basis, enabling developers to track volatility and make informed decisions.
- Carat Endpoint: For those interested in gold pricing, the carat endpoint allows users to retrieve information about gold rates by carat, enhancing the granularity of data available.
- Lowest/Highest Price Endpoint: Developers can query the API to get the lowest and highest prices for a specified date, providing insights into market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint allows users to access the open, high, low, and close prices for a specific date, essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, allowing for extensive analysis of metal prices over time.
- API Key: Each user is provided with a unique API key that must be included in the API requests to authenticate and authorize access.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data representation.
- Available Endpoints: The Metals-API features 14 endpoints, each designed to provide specific functionalities tailored to user needs.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, including CNH, ensuring developers have access to the latest data.
- Intraday Endpoint: Query intraday exchange rate data for a single symbol, allowing for real-time monitoring of market movements.
List of Symbols
The Metals-API provides access to a comprehensive range of metal symbols. For a complete list of all supported symbols and their specifications, refer to the Metals-API Supported Symbols page. This resource is invaluable for developers looking to integrate specific metals into their applications.
API Endpoint Examples and Responses
Understanding the API's response structure is crucial for effective integration. Below are examples of responses from various endpoints:
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1788480558,
"base": "USD",
"date": "2026-09-04",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744,
"XCU": 0.294118,
"XAL": 0.434783,
"XNI": 0.142857,
"XZN": 0.344828
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1788394158,
"base": "USD",
"date": "2026-09-03",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2026-08-28",
"end_date": "2026-09-04",
"base": "USD",
"rates": {
"2026-08-28": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-08-30": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-09-04": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Convert Endpoint
Convert any amount from one metal to another or to/from USD:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1788480558,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2026-08-28",
"end_date": "2026-09-04",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
},
"XAG": {
"start_rate": 0.03825,
"end_rate": 0.03815,
"change": -0.0001,
"change_pct": -0.26
},
"XPT": {
"start_rate": 0.000915,
"end_rate": 0.000912,
"change": -3.0e-6,
"change_pct": -0.33
}
},
"unit": "per troy ounce"
}
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1788480558,
"base": "USD",
"date": "2026-09-04",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
},
"XAG": {
"open": 0.03825,
"high": 0.0383,
"low": 0.0381,
"close": 0.03815
},
"XPT": {
"open": 0.000915,
"high": 0.000918,
"low": 0.00091,
"close": 0.000912
}
},
"unit": "per troy ounce"
}
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1788480558,
"base": "USD",
"date": "2026-09-04",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
},
"XAG": {
"bid": 0.0381,
"ask": 0.0382,
"spread": 0.0001
},
"XPT": {
"bid": 0.000911,
"ask": 0.000913,
"spread": 2.0e-6
}
},
"unit": "per troy ounce"
}
Conclusion
The Metals-API provides a robust framework for developers looking to access real-time and historical data on metals and currency exchange rates, including the Chinese Renminbi Yuan Offshore (CNH). By leveraging the various endpoints, developers can create applications that offer valuable insights into market trends, facilitate currency conversions, and track fluctuations over time.
As the financial landscape continues to evolve with technological advancements, APIs like Metals-API will play a pivotal role in enabling businesses to adapt and thrive. For more information on how to get started, visit the Metals-API Website and explore the Metals-API Documentation for detailed guidance on implementation.
In summary, the integration of real-time data through the Metals-API not only enhances the functionality of applications but also empowers developers to create innovative solutions that meet the demands of a rapidly changing market.