The Easiest Way to Get Gold Ask (XAU-ASK) - Per Ounce Historical Rates Using API Access

The Easiest Way to Get Gold Ask (XAU-ASK) - Per Ounce Historical Rates Using API Access
In today's fast-paced financial landscape, the demand for accurate and real-time data on precious metals, particularly gold (XAU), has surged. Developers and analysts alike are seeking efficient ways to access historical prices and market insights. The Metals-API provides a robust solution for retrieving historical prices of gold and other metals, empowering users to harness the power of data analytics and technology integration in trading. This blog post will guide you through the process of obtaining historical prices for gold using the Metals-API, including example endpoints, parameters, and data formats.
About Gold (XAU)
Gold has long been regarded as a safe haven asset and a hedge against inflation. In the context of digital transformation, the trading of gold has evolved significantly. The integration of technology in trading platforms has enabled real-time access to market data, allowing traders to make informed decisions. With the advent of APIs like Metals-API, developers can build applications that provide market insights, track price fluctuations, and analyze trends in gold prices.
The digital asset solutions offered by Metals-API facilitate innovation in price discovery, enabling users to access historical data and real-time rates with ease. By leveraging data analytics, traders can gain insights into market behavior, optimize their trading strategies, and enhance their decision-making processes.
API Description
The Metals-API is a powerful tool designed to provide developers with access to real-time and historical data on various metals, including gold, silver, platinum, and palladium. With a user-friendly interface and comprehensive documentation, the API empowers developers to create next-generation applications that can analyze and visualize metal prices effectively.
For more information, visit the Metals-API Website or check out the Metals-API Documentation for detailed guidance on using the API.
Key Features and Endpoints
The Metals-API offers a variety of endpoints, each designed to serve specific needs. Below are some of the key features and their potential applications:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently. This is crucial for traders who need up-to-the-minute information on gold prices.
- Historical Rates Endpoint: Access historical rates for gold and other metals dating back to 2019. By appending a specific date to the endpoint, users can retrieve past prices, allowing for comprehensive analysis and trend identification.
- Bid And Ask Endpoint: This feature enables users to retrieve real-time bid and ask prices for gold, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The conversion endpoint allows users to convert amounts from one metal to another or to/from USD, facilitating easy calculations for traders dealing in multiple currencies.
- Time-Series Endpoint: Users can query the API for daily historical rates between two dates of their choice, making it easy to analyze trends over specific periods.
- Fluctuation Endpoint: This endpoint provides information about how gold prices fluctuate on a day-to-day basis, helping traders understand market volatility.
- Carat Endpoint: Retrieve information about gold rates by carat, which is particularly useful for jewelers and those in the jewelry industry.
- Lowest/Highest Price Endpoint: This endpoint allows users to query the API for the lowest and highest prices of gold over a specified period, aiding in market analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can obtain open, high, low, and close prices for gold, which are essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a broader context for market analysis.
- API Key: Your unique API key is required to access the API, ensuring secure and authorized usage.
- 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 includes 14 different endpoints, each offering unique functionalities tailored to various user needs.
- Supported Symbols Endpoint: This endpoint returns a constantly updated list of all available metal symbols, ensuring users have access to the latest data.
- 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
To illustrate the functionality of the Metals-API, let's explore some example endpoints and their corresponding JSON responses.
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1761102101,
"base": "USD",
"date": "2025-10-22",
"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": 1761015701,
"base": "USD",
"date": "2025-10-21",
"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-10-15",
"end_date": "2025-10-22",
"base": "USD",
"rates": {
"2025-10-15": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-10-17": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-10-22": {
"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": 1761102101,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2025-10-15",
"end_date": "2025-10-22",
"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": 1761102101,
"base": "USD",
"date": "2025-10-22",
"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": 1761102101,
"base": "USD",
"date": "2025-10-22",
"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
Accessing historical prices for gold (XAU) has never been easier, thanks to the Metals-API. With its comprehensive set of endpoints, developers can retrieve real-time and historical data, enabling them to build powerful applications that analyze market trends and provide valuable insights. Whether you are a trader looking to optimize your strategies or a developer seeking to integrate metal price data into your applications, the Metals-API offers the tools you need.
For further exploration, refer to the Metals-API Documentation for detailed guidance on each endpoint and its capabilities. Additionally, the Metals-API Supported Symbols page provides a comprehensive list of available metal symbols, ensuring you have access to the latest data.
In summary, the integration of technology in trading precious metals like gold is transforming the landscape of financial data access. By leveraging the capabilities of the Metals-API, developers can create innovative solutions that enhance market analysis and trading strategies, ultimately leading to more informed decision-making.