Get Chennai Gold (XAU-CHEN) - Per Ounce Historical Prices for the Last 5 Years using this API

Get Chennai Gold (XAU-CHEN) - Per Ounce Historical Prices for the Last 5 Years using this API
In the world of precious metals, gold (symbol: XAU) holds a significant place, not only as a valuable asset but also as a barometer for economic stability and investment strategies. With the rise of digital transformation in the financial sector, accessing historical prices for gold has become easier than ever, thanks to innovative solutions like the Metals-API. This blog post will explore how to retrieve historical prices for Chennai Gold (XAU-CHEN) using the Metals-API, focusing on its capabilities, features, and practical applications.
About Gold (XAU)
Gold has been a symbol of wealth and prosperity for centuries. Its allure is not just in its physical properties but also in its role as a hedge against inflation and currency fluctuations. In recent years, the digital transformation of precious metals trading has opened new avenues for investors and developers alike. The integration of data analytics and market insights into trading strategies has become essential for making informed decisions.
With the advent of technology, the way we discover prices and trade gold has evolved. Innovations in price discovery mechanisms and digital asset solutions have made it possible for traders to access real-time data and historical trends with unprecedented ease. The Metals-API stands at the forefront of this transformation, providing developers with the tools they need to build next-generation applications that leverage real-time metals data.
Metals-API Overview
The Metals-API is a powerful JSON API that provides access to real-time and historical prices for various metals, including gold, silver, platinum, and palladium. This API is designed to empower developers to create applications that require accurate and timely metals data. With a user-friendly interface and comprehensive documentation, the Metals-API simplifies the process of integrating metals pricing into applications.
One of the standout features of the Metals-API is its ability to deliver real-time exchange rate data, updated frequently based on the user's subscription plan. This means that whether you're a trader looking to make quick decisions or a developer building a financial application, you can rely on the Metals-API to provide the most current data available.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated every 60 minutes, 10 minutes, or even more frequently, depending on your subscription plan. This is crucial for traders who need to make decisions based on the latest market conditions.
- Historical Rates Endpoint: Access historical rates dating back to 2019. By appending a specific date to the API request, users can retrieve past prices for gold and other metals, allowing for comprehensive analysis and trend identification.
- Bid and Ask Endpoint: This feature enables users to retrieve real-time bid and ask prices for metals, which is essential for understanding market dynamics and making informed trading decisions.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint that allows users to convert amounts from one metal to another or to/from USD. This is particularly useful for traders operating in multiple currencies.
- Time-Series Endpoint: Users can query the API for daily historical rates between two dates of their choice. This feature is invaluable for analyzing price movements over specific periods.
- Fluctuation Endpoint: This endpoint provides information about how metal prices fluctuate on a day-to-day basis, helping traders understand volatility and market trends.
- Carat Endpoint: Users can retrieve information about gold rates by carat, which is essential for jewelers and consumers looking to buy or sell gold jewelry.
- Lowest/Highest Price Endpoint: This endpoint allows users to query the API for the lowest and highest prices of metals over a specified period, providing insights into market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can access open, high, low, and close prices for a specific time period, which is crucial for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, allowing for in-depth analysis of market trends.
- API Key: Each user is provided with a unique API key that must be included in requests to authenticate and authorize access to the API.
- API Response: The API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format.
- Available Endpoints: The Metals-API offers a comprehensive list of endpoints, each providing different functionalities to cater to various user needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies and metal symbols, ensuring users can access the latest data for their specific needs.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for local traders and investors.
- News Endpoint: Stay updated with the latest news articles related to various metals, providing context and insights into market movements.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for developers. Below are examples of how to use various endpoints, along with explanations of the responses you can expect.
Latest Rates Endpoint
To get real-time exchange rates for all available metals, you can use the latest rates endpoint. Here’s an example response:
{
"success": true,
"timestamp": 1748574223,
"base": "USD",
"date": "2025-05-30",
"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"
}
In this response, the success
field indicates whether the request was successful. The timestamp
provides the time of the data retrieval, and the base
indicates the currency against which the rates are quoted. The rates
object contains the exchange rates for various metals, with XAU representing gold.
Historical Rates Endpoint
To access historical exchange rates for any date since 1999, you can use the historical rates endpoint. Here’s an example response:
{
"success": true,
"timestamp": 1748487823,
"base": "USD",
"date": "2025-05-29",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response structure is similar to the latest rates endpoint, with the addition of the date
field indicating the specific date for which the historical rates are provided.
Time-Series Endpoint
The time-series endpoint allows you to get exchange rates for a specific time period. Here’s an example response:
{
"success": true,
"timeseries": true,
"start_date": "2025-05-23",
"end_date": "2025-05-30",
"base": "USD",
"rates": {
"2025-05-23": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-05-25": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-05-30": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily rates for the specified date range, allowing for detailed analysis of price movements over time.
Convert Endpoint
The convert endpoint allows you to convert any amount from one metal to another or to/from USD. Here’s an example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1748574223,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response indicates the success of the conversion request, the original query parameters, and the result of the conversion, which in this case converts 1000 USD to 0.482 troy ounces of gold.
Fluctuation Endpoint
The fluctuation endpoint tracks rate fluctuations between two dates. Here’s an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-23",
"end_date": "2025-05-30",
"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"
}
This response provides detailed information about the price changes for each metal over the specified period, including the percentage change and the absolute change in rates.
OHLC (Open/High/Low/Close) Price Endpoint
The OHLC endpoint provides open, high, low, and close prices for a specific time period. Here’s an example response:
{
"success": true,
"timestamp": 1748574223,
"base": "USD",
"date": "2025-05-30",
"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"
}
This response provides a comprehensive view of the price action for each metal over the specified period, which is essential for traders conducting technical analysis.
Bid/Ask Endpoint
The bid/ask endpoint provides current bid and ask prices for metals. Here’s an example response:
{
"success": true,
"timestamp": 1748574223,
"base": "USD",
"date": "2025-05-30",
"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"
}
This response provides the current bid and ask prices for each metal, along with the spread, which is crucial for traders looking to enter or exit positions.
Conclusion
The Metals-API is a powerful tool for developers and traders looking to access real-time and historical data for precious metals like gold. With its comprehensive range of endpoints, the API allows users to retrieve the latest rates, historical prices, and detailed market insights with ease. By leveraging the capabilities of the Metals-API, developers can create innovative applications that cater to the evolving needs of the financial market.
Whether you are analyzing trends, making trading decisions, or integrating metals data into your applications, the Metals-API provides the necessary tools to succeed. For more information, check out the Metals-API Documentation and explore the Metals-API Supported Symbols to get started with your integration today.