Download Gold Ask (XAU-ASK) Historical Prices using this API
Download Gold Ask (XAU-ASK) Historical Prices using this API
In the world of finance, the ability to access and analyze historical prices of precious metals like gold is crucial for traders, investors, and developers alike. The Metals-API provides a robust solution for obtaining historical prices of gold (XAU) and other metals, enabling users to harness the power of real-time data analytics and market insights. This blog post will delve into the various features of the Metals-API, focusing on how to retrieve historical prices for gold and the innovative capabilities that this API offers.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a symbol of wealth and stability. In recent years, the digital transformation in the precious metals market has revolutionized how traders and investors interact with this valuable asset. With the integration of technology in trading, data analytics has become a vital tool for market insights, allowing stakeholders to make informed decisions based on historical trends and real-time data.
The innovation in price discovery has also been significant, as digital asset solutions enable more efficient trading and investment strategies. By leveraging the capabilities of the Metals-API, developers can create next-generation applications that provide users with comprehensive data on gold prices, including historical rates, bid and ask prices, and fluctuations over time.
API Description
The Metals-API is designed to empower developers by providing access to a wide array of features that facilitate the retrieval of metals data. With a focus on innovation and technological advancement, this API allows users to build applications that can analyze market trends, track price movements, and convert currencies seamlessly.
One of the standout features of the Metals-API is its ability to deliver real-time exchange rate data, which is updated frequently based on the user's subscription plan. This ensures that developers can access the most accurate and timely information available, which is essential for making informed trading decisions.
For more detailed information on how to use the API, refer to the Metals-API Documentation, which provides comprehensive guidance on all available endpoints and their functionalities.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs, making it a versatile tool for developers. Here are some of the key features:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data for gold and other metals. The data is updated every 60 minutes, every 10 minutes, or even more frequently, allowing users to stay on top of market movements.
- Historical Rates Endpoint: Users can access historical rates for gold dating back to 2019. By appending a specific date to the API request, developers can retrieve past prices and analyze trends over time.
- Bid And Ask Endpoint: This powerful feature enables users to retrieve real-time bid and ask prices for gold, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The API includes a currency conversion feature that allows users to convert amounts from one metal to another or to/from USD, facilitating seamless transactions.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two dates of their choice, making it easy to analyze price movements over specific periods.
- Fluctuation Endpoint: Users can track how gold prices fluctuate on a day-to-day basis, providing valuable insights into market volatility.
- Carat Endpoint: This feature allows users to retrieve information about gold rates by carat, catering to specific market needs.
- Lowest/Highest Price Endpoint: Users can query the API to get the lowest and highest prices for gold over a specified period, which is essential for understanding market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides users with open, high, low, and close prices for gold, enabling detailed technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, allowing for comprehensive analysis of market trends.
- API Key: Each user is provided with a unique API key that must be included in requests to authenticate access to the API.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data presentation.
- Available Endpoints: The Metals-API comes with 14 different endpoints, each providing unique functionalities to cater to various user needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies and metal symbols, ensuring users have access to the latest information.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping users informed about market developments.
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.
API Endpoint Examples and Responses
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1765569613,
"base": "USD",
"date": "2025-12-12",
"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": 1765483213,
"base": "USD",
"date": "2025-12-11",
"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": "2025-12-05",
"end_date": "2025-12-12",
"base": "USD",
"rates": {
"2025-12-05": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-12-07": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-12-12": {
"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": 1765569613,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2025-12-05",
"end_date": "2025-12-12",
"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": 1765569613,
"base": "USD",
"date": "2025-12-12",
"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": 1765569613,
"base": "USD",
"date": "2025-12-12",
"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 offers a comprehensive suite of tools for developers looking to access historical prices and real-time data for gold and other precious metals. By utilizing the various endpoints, users can gain valuable insights into market trends, track price fluctuations, and make informed trading decisions. The API's capabilities extend beyond simple data retrieval, enabling developers to create innovative applications that leverage real-time analytics and historical data.
For those interested in exploring the full potential of the Metals-API, I encourage you to visit the Metals-API Website and dive into the Metals-API Documentation for detailed guidance on implementation. With the right tools and data at your fingertips, the possibilities for innovation in the precious metals market are endless.