Get Gold Apr 2026 (GCJ26) Historical Prices with a Simple API Request

Introduction
In the world of finance and investment, understanding the historical prices of precious metals like gold is crucial for making informed decisions. One of the most effective ways to access this data is through the Metals-API. This powerful API provides developers with the tools necessary to retrieve historical prices for gold (XAU) and other metals, enabling them to build applications that leverage real-time and historical market data. In this blog post, we will explore how to get historical prices for gold (XAU) using the Metals-API, along with insights into the digital transformation in precious metals trading.
Metals-API Information
About Gold (XAU)
Gold has long been a symbol of wealth and a safe haven for investors. In recent years, the digital transformation of the precious metals market has revolutionized how traders and investors access and analyze data. With the advent of advanced data analytics and technology integration, market insights have become more accessible than ever. The Metals-API plays a pivotal role in this transformation by providing real-time and historical data on gold prices.
As the demand for digital asset solutions grows, the need for innovative price discovery mechanisms becomes paramount. The Metals-API empowers developers to create applications that can analyze trends, track fluctuations, and provide insights into the gold market. By leveraging this API, developers can build next-generation applications that enhance trading strategies and investment decisions.
API Description
The Metals-API is designed to provide comprehensive data on precious metals, including gold, silver, platinum, and palladium. It offers a range of endpoints that allow users to access real-time and historical data, making it an invaluable resource for developers in the financial sector. The API's capabilities include:
- Real-time exchange rates: Access the latest rates for various metals, updated frequently based on your subscription plan.
- Historical rates: Retrieve historical price data for gold and other metals dating back to 2019.
- Bid and ask prices: Get real-time bid and ask prices to inform trading decisions.
- Currency conversion: Convert amounts between different metals and currencies seamlessly.
- Time-series data: Analyze historical trends over specific periods.
- Fluctuation tracking: Monitor how prices change over time.
- Open/High/Low/Close (OHLC) data: Access detailed price information for specific time frames.
For more detailed information, you can refer to the Metals-API Documentation.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs. Hereβs a closer look at some of the key features:
Latest Rates Endpoint
The Latest Rates Endpoint provides real-time exchange rate data for metals. Depending on your subscription plan, you can receive updates every 60 minutes or even every 10 minutes. This endpoint is essential for traders who need to make quick decisions based on the most current market data.
{
"success": true,
"timestamp": 1756630836,
"base": "USD",
"date": "2025-08-31",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
Accessing historical rates is crucial for analyzing market trends. The Historical Rates Endpoint allows you to query historical data for most currencies dating back to 2019. By appending a specific date to your request, you can retrieve the price of gold on that date, enabling in-depth analysis of market movements.
{
"success": true,
"timestamp": 1756544436,
"base": "USD",
"date": "2025-08-30",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"unit": "per troy ounce"
}
Bid And Ask Endpoint
The Bid and Ask Endpoint is a powerful feature that provides real-time bid and ask prices for metals. This information is crucial for traders looking to execute buy or sell orders at the best possible prices. Understanding the spread between bid and ask prices can also help in assessing market liquidity.
{
"success": true,
"timestamp": 1756630836,
"base": "USD",
"date": "2025-08-31",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
},
"XAG": {
"bid": 0.0381,
"ask": 0.0382,
"spread": 0.0001
}
},
"unit": "per troy ounce"
}
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. This feature is particularly useful for traders who need to quickly assess the value of their holdings in different currencies.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1756630836,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series Endpoint allows you to query the API for daily historical rates between two dates of your choice. This feature is invaluable for conducting trend analysis and understanding price movements over time.
{
"success": true,
"timeseries": true,
"start_date": "2025-08-24",
"end_date": "2025-08-31",
"base": "USD",
"rates": {
"2025-08-24": {
"XAU": 0.000485,
"XAG": 0.03825
},
"2025-08-31": {
"XAU": 0.000482,
"XAG": 0.03815
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation Endpoint provides insights into how currencies fluctuate on a day-to-day basis. By tracking the changes in price over a specified period, traders can gain a better understanding of market volatility and make more informed decisions.
{
"success": true,
"fluctuation": true,
"start_date": "2025-08-24",
"end_date": "2025-08-31",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
}
},
"unit": "per troy ounce"
}
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price Endpoint provides detailed price information, including the open, high, low, and close prices for a specific time period. This data is essential for traders who rely on technical analysis to make trading decisions.
{
"success": true,
"timestamp": 1756630836,
"base": "USD",
"date": "2025-08-31",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
}
},
"unit": "per troy ounce"
}
Historical LME Endpoint
The Historical LME Endpoint provides access to historical rates for LME symbols dating back to 2008. This is particularly useful for traders who need to analyze long-term trends in the metals market.
{
"success": true,
"timestamp": 1756544436,
"base": "USD",
"date": "2025-08-30",
"rates": {
"XAU": 0.000485
},
"unit": "per troy ounce"
}
API Key and Authentication
To access the Metals-API, you will need an API key, which is a unique identifier that must be included in your requests. This key is passed into the API base URL's access_key parameter. Proper authentication ensures that only authorized users can access the data, maintaining the integrity and security of the API.
API Response Structure
The API responses are structured in a JSON format, making it easy for developers to parse and utilize the data. Each response includes fields such as success, timestamp, base currency, date, rates, and unit. Understanding these fields is crucial for effectively using the API.
Common Use Cases
Developers can leverage the Metals-API for various applications, including:
- Building trading platforms that require real-time and historical data.
- Creating analytical tools for market research and investment strategies.
- Integrating price data into financial applications for enhanced user experience.
Conclusion
The Metals-API is a powerful tool for developers looking to access historical prices for gold (XAU) and other precious metals. By providing real-time and historical data, the API enables the creation of innovative applications that can transform how traders and investors interact with the metals market. With features like the Latest Rates Endpoint, Historical Rates Endpoint, and various other functionalities, the Metals-API stands out as a comprehensive solution for accessing metals data. For more information, visit the Metals-API Supported Symbols page and explore the extensive capabilities of this API to enhance your trading strategies and market analysis.