Get Gold Ask (XAU-ASK) Historical Prices from 2020 to 2026 using this API
Introduction
Gold, represented by the symbol XAU, has long been a cornerstone of financial markets and investment strategies. With the rise of digital transformation in precious metals trading, accessing historical prices has become increasingly vital for developers and analysts alike. The Metals-API offers a robust solution for retrieving historical prices of gold (XAU-ASK) from 2020 to 2026, empowering users with real-time data analytics and market insights. This blog post will delve into the capabilities of the Metals-API, exploring its innovative features and how they can be leveraged to enhance trading strategies and investment decisions.
About Gold (XAU)
Gold has always held a unique position in the financial world, serving as a safe haven during economic uncertainty and a hedge against inflation. As the market evolves, the integration of technology in trading has transformed how investors approach gold. The advent of data analytics and digital asset solutions allows for more informed decision-making, enabling traders to analyze historical trends and make predictions based on real-time data.
The Metals-API stands at the forefront of this transformation, providing developers with the tools necessary to create next-generation applications that can track and analyze gold prices effectively. By harnessing the power of real-time metals data, users can innovate in price discovery and enhance their trading strategies.
API Description
The Metals-API is a comprehensive solution for accessing metals prices and currency conversion data. It offers a wide array of endpoints that cater to various needs, from retrieving the latest rates to accessing historical data. This API is designed to empower developers by providing them with the necessary tools to build applications that can analyze and visualize metals data effectively.
With the Metals-API, users can access real-time exchange rate data, historical rates dating back to 2019, and various endpoints that allow for detailed analysis of market fluctuations. The API's capabilities extend beyond simple data retrieval; it enables developers to create applications that can provide insights into market trends, optimize trading strategies, and enhance user experiences.
For more detailed information, refer to the Metals-API Documentation.
Key Features and Endpoints
The Metals-API boasts a variety of endpoints that cater to different functionalities, each designed to provide users with the most relevant data for their needs. Here are some of the key features:
Latest Rates Endpoint
The Latest Rates Endpoint allows users to retrieve real-time exchange rate data for various metals, including gold. Depending on the subscription plan, this endpoint can return data updated every 60 minutes, every 10 minutes, or even more frequently. This feature is crucial for traders who need to make quick decisions based on the most current market data.
{
"success": true,
"timestamp": 1781828290,
"base": "USD",
"date": "2026-06-19",
"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
Accessing historical rates is essential for analyzing trends and making informed predictions. The Historical Rates Endpoint allows users to query the Metals-API for historical rates dating back to 2019. By appending a specific date in the format YYYY-MM-DD, users can retrieve past exchange rates, which can be invaluable for backtesting trading strategies.
{
"success": true,
"timestamp": 1781741890,
"base": "USD",
"date": "2026-06-18",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Bid And Ask Endpoint
The Bid and Ask Endpoint is a powerful feature that enables users to retrieve real-time bid and ask prices for metals. This information is crucial for traders looking to execute orders at the best possible prices. Depending on the subscription plan, users can access this data to optimize their trading strategies and improve their execution timing.
{
"success": true,
"timestamp": 1781828290,
"base": "USD",
"date": "2026-06-19",
"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"
}
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 or metals. By specifying the amount and the currencies involved, users can obtain immediate conversion results.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1781828290,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series Endpoint allows users to query the API for daily historical rates between two dates of their choice. This feature is invaluable for conducting in-depth analyses of price movements over specific periods, enabling traders to identify trends and make data-driven decisions.
{
"success": true,
"timeseries": true,
"start_date": "2026-06-12",
"end_date": "2026-06-19",
"base": "USD",
"rates": {
"2026-06-12": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-06-14": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-06-19": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation Endpoint provides insights into how currencies fluctuate on a day-to-day basis. By specifying a date range, users can track rate fluctuations and assess market volatility, which is essential for risk management and strategic planning.
{
"success": true,
"fluctuation": true,
"start_date": "2026-06-12",
"end_date": "2026-06-19",
"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"
}
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price Endpoint allows users to retrieve the open, high, low, and close prices for a specific time period. This data is crucial for technical analysis, enabling traders to identify potential entry and exit points based on historical price movements.
{
"success": true,
"timestamp": 1781828290,
"base": "USD",
"date": "2026-06-19",
"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"
}
Lowest/Highest Price Endpoint
The Lowest/Highest Price Endpoint allows users to query the API to get the lowest and highest price for a specified date. This feature is particularly useful for traders looking to identify price extremes and assess market conditions.
{
"success": true,
"timestamp": 1781828290,
"base": "USD",
"date": "2026-06-19",
"rates": {
"XAU": {
"lowest": 0.000481,
"highest": 0.000487
}
},
"unit": "per troy ounce"
}
Historical LME Endpoint
The Historical LME Endpoint provides access to historical rates for LME symbols dating back to 2008. This endpoint is particularly useful for users interested in analyzing the performance of metals traded on the London Metal Exchange.
{
"success": true,
"timestamp": 1781741890,
"base": "USD",
"date": "2026-06-18",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
API Key and Response
Your API Key is a unique identifier that is passed into the API base URL's access_key parameter. This key is essential for authenticating requests and ensuring secure access to the API's features. The exchange rates delivered by the Metals-API are by default relative to USD, and all data is returned in a structured JSON format, making it easy to integrate into applications.
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 understand the available options for their applications.
Conclusion
In conclusion, the Metals-API offers a powerful suite of tools for accessing historical prices of gold (XAU-ASK) and other metals. With its extensive range of endpoints, developers can retrieve real-time data, analyze historical trends, and optimize their trading strategies. The integration of technology in precious metals trading has opened up new avenues for innovation and data-driven decision-making.
By leveraging the capabilities of the Metals-API, developers can build applications that not only enhance user experiences but also provide valuable insights into market dynamics. Whether you are a seasoned trader or a developer looking to create cutting-edge financial applications, the Metals-API is an essential resource for navigating the complexities of the metals market.
For more information on how to get started with the Metals-API, visit the Metals-API Website and explore the comprehensive Metals-API Documentation for detailed guidance on implementation and usage.