The Easiest Way to Get Gold Bid (XAU-BID) Historical Rates Using APIs
The Easiest Way to Get Gold Bid (XAU-BID) Historical Rates Using APIs
In today's digital age, obtaining real-time and historical data for precious metals like gold (XAU) has become increasingly essential for traders, investors, and developers. The Metals-API offers a robust solution for accessing comprehensive data on gold and other metals through its well-structured API. This blog post will guide you through the process of retrieving historical prices for gold using the Metals-API, including example endpoints, parameters, and data formats.
About Gold (XAU)
Gold has long been a symbol of wealth and stability, often viewed as a safe haven during economic uncertainty. With the rise of digital transformation in the precious metals market, the integration of technology and data analytics has revolutionized how traders and investors access market insights. The Metals-API plays a pivotal role in this transformation, providing developers with the tools necessary to build next-generation applications that leverage real-time metals data.
Through the use of the Metals-API, developers can innovate in price discovery, create digital asset solutions, and enhance trading strategies with accurate and timely information. This API empowers users to access a wealth of data, enabling informed decision-making and strategic planning in the precious metals market.
API Description
The Metals-API is a powerful tool that provides access to real-time and historical prices for various metals, including gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD). With a user-friendly interface and comprehensive documentation, the API allows developers to easily integrate metals data into their applications.
For detailed information on how to use the API, visit the Metals-API Documentation. Here, you will find a complete guide on the available endpoints, parameters, and response formats.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs, from retrieving the latest rates to accessing historical data. 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 metals, updated every 60 minutes or more frequently. This is crucial for traders needing up-to-the-minute information.
- Historical Rates Endpoint: Access historical rates for gold and other metals dating back to 2019. This endpoint allows you to query specific dates to analyze past market trends.
- Bid And Ask Endpoint: Retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: This feature allows you to convert any amount from one metal to another or to/from USD, facilitating easy calculations for traders.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, enabling detailed analysis of price movements over time.
- Fluctuation Endpoint: Track how metal 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 consumers.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest prices for a specific date, aiding in market analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: Obtain OHLC data for a specific time period, which is 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 essential for accessing the API and must be included in your requests.
- API Response: The API delivers exchange rates relative to USD, with all data returned in a structured JSON format.
- Available Endpoints: The Metals-API features 14 different endpoints, each designed to provide specific functionalities.
- Supported Symbols Endpoint: This endpoint returns all available currencies, ensuring you have the latest information on supported symbols.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping you 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
Understanding how to interact with the Metals-API is crucial for effective implementation. Below are examples of various endpoints along with their JSON responses:
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1771374300,
"base": "USD",
"date": "2026-02-18",
"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": 1771287900,
"base": "USD",
"date": "2026-02-17",
"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": "2026-02-11",
"end_date": "2026-02-18",
"base": "USD",
"rates": {
"2026-02-11": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-02-13": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-02-18": {
"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": 1771374300,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2026-02-11",
"end_date": "2026-02-18",
"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": 1771374300,
"base": "USD",
"date": "2026-02-18",
"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": 1771374300,
"base": "USD",
"date": "2026-02-18",
"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
In conclusion, the Metals-API provides a comprehensive and innovative solution for accessing real-time and historical data on precious metals like gold (XAU). By leveraging the various endpoints available, developers can create powerful applications that enhance trading strategies, facilitate market analysis, and provide valuable insights into price movements.
Whether you are looking to retrieve the latest rates, analyze historical trends, or track fluctuations, the Metals-API offers the tools necessary to meet your needs. For more information, explore the Metals-API Documentation and start integrating this powerful API into your applications today.