Query Gold Bid (XAU-BID) - Per Ounce Historical Prices through this API

Query Gold Bid (XAU-BID) - Per Ounce Historical Prices through this API
In the world of precious metals, gold (symbol: XAU) stands out as a significant asset, both for investors and for those interested in the broader economic landscape. With the rise of digital transformation, data analytics, and technology integration in trading, accessing historical prices for gold has become more streamlined and efficient. One of the most innovative tools available for developers and traders alike is the Metals-API, which provides real-time and historical data for various metals, including gold. This blog post will delve into the capabilities of the Metals-API, focusing on how to retrieve historical prices for gold and the transformative potential of real-time metals data.
About Gold (XAU)
Gold has long been regarded as a safe haven asset, a hedge against inflation, and a store of value. In recent years, the digital transformation in the precious metals market has led to the integration of advanced technologies that enhance trading efficiency and market insights. The Metals-API plays a crucial role in this transformation by providing developers with access to real-time and historical data, enabling them to build next-generation applications that can analyze market trends, optimize trading strategies, and improve decision-making processes.
Data analytics has become a cornerstone of modern trading, allowing investors to gain insights into market behavior and price movements. By leveraging the capabilities of the Metals-API, developers can harness the power of data to create applications that not only track gold prices but also analyze fluctuations, predict trends, and provide actionable insights. This level of technological integration is essential for staying competitive in today's fast-paced financial markets.
API Description
The Metals-API is a powerful tool that empowers developers to access a wealth of information about precious metals, including gold. With its user-friendly interface and comprehensive documentation, the API allows for seamless integration into various applications. The API provides a range of endpoints that cater to different needs, from retrieving the latest rates to accessing historical data and analyzing price fluctuations.
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 ensures that developers have access to the most current information, allowing them to make informed decisions. Additionally, the API offers historical rates dating back to 2019, enabling users to analyze trends over time and make predictions based on historical data.
For more information on how to utilize the Metals-API, developers can refer to the Metals-API Documentation, which provides detailed guidance on each endpoint and its capabilities.
Key Features and Endpoints
The Metals-API boasts a variety of endpoints, each designed to serve specific functions. 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 for gold and other metals, updated every 60 minutes, 10 minutes, or even more frequently. This feature is essential for traders who need to make quick decisions based on the latest market conditions.
- 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 historical prices, allowing for in-depth analysis of price movements over time.
- Bid And Ask Endpoint: This powerful feature enables users to retrieve real-time bid and ask prices for gold. Understanding the bid-ask spread is crucial for traders, as it directly impacts trading costs and profitability.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, allowing users to convert amounts from one metal to another or to/from USD. This feature is particularly useful for traders dealing with multiple currencies.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two specified dates. By analyzing time-series data, developers can identify trends and patterns that inform trading strategies.
- Fluctuation Endpoint: Users can track how gold prices fluctuate on a day-to-day basis. This endpoint provides valuable insights into market volatility and helps traders anticipate potential price movements.
- Carat Endpoint: For those interested in gold purity, the carat endpoint provides information about gold rates based on carat weight. This feature is essential for jewelers and consumers alike.
- Lowest/Highest Price Endpoint: This endpoint allows users to query the API for the lowest and highest prices of gold over a specified period, providing insights into market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can retrieve open, high, low, and close prices for gold over a specific time period. This data is crucial for technical analysis and trading strategies.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols, dating back to 2008. It is particularly useful for traders who focus on industrial metals.
- API Key: Each user receives a unique API key that must be included in the API request to authenticate access. This ensures secure and controlled access to the API's features.
- API Response: The Metals-API delivers exchange rates relative to USD by default. All data is returned in a structured JSON format, making it easy to integrate into applications.
- Available Endpoints: The API provides a constantly updated list of available endpoints, ensuring that developers have access to the latest features and functionalities.
- Gold Price India Endpoint: This dedicated endpoint allows users to retrieve the latest gold price in India, catering to a specific market segment.
- News Endpoint: Users can access the latest news articles related to various metals, keeping them informed about market developments and trends.
List of Symbols
The Metals-API supports a comprehensive range of metal symbols, including XAU for gold, XAG for silver, XPT for platinum, and XPD for palladium. 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 capabilities of the Metals-API, here are some examples of API responses for various endpoints:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1749427780,
"base": "USD",
"date": "2025-06-09",
"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"
}
This response indicates that the current price of gold (XAU) is 0.000482 per troy ounce, with additional rates for other metals provided in the response.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1749341380,
"base": "USD",
"date": "2025-06-08",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows the historical price of gold on June 8, 2025, allowing users to analyze past price movements.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-06-02",
"end_date": "2025-06-09",
"base": "USD",
"rates": {
"2025-06-02": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-06-04": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-06-09": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily rates for gold over a specified time period, enabling users to visualize trends and fluctuations.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1749427780,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This example demonstrates how to convert an amount from USD to gold (XAU), showing that $1000 is equivalent to 0.482 troy ounces of gold.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-06-02",
"end_date": "2025-06-09",
"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 insights into how gold prices fluctuated over a specified period, highlighting both the absolute change and the percentage change.
OHLC (Open/High/Low/Close) Endpoint
{
"success": true,
"timestamp": 1749427780,
"base": "USD",
"date": "2025-06-09",
"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 example illustrates the open, high, low, and close prices for gold on a specific date, which is essential for traders conducting technical analysis.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1749427780,
"base": "USD",
"date": "2025-06-09",
"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 gold, along with the spread, which is critical for traders looking to execute buy and sell orders efficiently.
Conclusion
The Metals-API is a transformative tool for developers and traders in the precious metals market, particularly for those focused on gold (XAU). By providing access to real-time and historical data, the API empowers users to make informed decisions, analyze market trends, and optimize trading strategies. With features such as the latest rates, historical rates, bid and ask prices, and various conversion options, the Metals-API stands out as a comprehensive solution for anyone looking to delve into the world of precious metals.
For developers interested in integrating the Metals-API into their applications, the Metals-API Documentation offers extensive guidance on how to utilize its features effectively. Additionally, the Metals-API Supported Symbols page provides a complete list of available metal symbols, ensuring that users can access the data they need.
In conclusion, the digital transformation of the precious metals market, combined with the capabilities of the Metals-API, presents a wealth of opportunities for developers and traders alike. By leveraging this innovative API, users can stay ahead of market trends, enhance their trading strategies, and ultimately achieve greater success in their investments.