Get Gold Bid (XAU-BID) Historical Prices for Financial Modeling using this API
Get Gold Bid (XAU-BID) Historical Prices for Financial Modeling using this API
In today's rapidly evolving financial landscape, the demand for accurate and real-time data is paramount, especially in the realm of precious metals like Gold (XAU). The ability to access historical prices through a robust API can significantly enhance financial modeling, trading strategies, and market analysis. The Metals-API provides a comprehensive solution for developers looking to integrate gold pricing data into their applications, enabling them to leverage advanced analytics and insights.
About Gold (XAU)
Gold has long been a symbol of wealth and a critical asset in financial markets. As digital transformation sweeps across industries, the precious metals market is also undergoing significant changes. The integration of technology in trading, data analytics, and market insights is reshaping how investors approach gold trading. With the rise of digital asset solutions, the demand for real-time and historical gold pricing data has never been higher.
The Metals-API stands out as a powerful tool for developers, offering a suite of features that facilitate the retrieval of gold prices and other precious metals. By utilizing this API, developers can create applications that provide innovative price discovery mechanisms, enabling users to make informed decisions based on accurate data.
API Description
The Metals-API is designed to empower developers with real-time and historical data for precious metals. It provides a seamless integration experience, allowing users to access a variety of endpoints that cater to different data needs. The API's capabilities include retrieving the latest rates, historical prices, bid and ask prices, and much more. This flexibility makes it an invaluable resource for financial modeling and analysis.
For more information, visit the Metals-API Website or explore the Metals-API Documentation for detailed guidance on implementation.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different aspects of precious metals data retrieval. 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, updated every 60 minutes or every 10 minutes. This feature is essential for applications that require up-to-the-minute pricing information.
- Historical Rates Endpoint: Users can access historical rates for most currencies dating back to 2019. By appending a specific date in the format YYYY-MM-DD, developers can query the Metals-API for historical rates, making it ideal for back-testing trading strategies and analyzing market trends.
- Bid And Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices for gold and other metals. Depending on the subscription plan, this data can be crucial for traders looking to optimize their entry and exit points.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, enabling users to convert amounts from one metal to another or to/from USD. This functionality is particularly useful for applications that require multi-currency support.
- Time-Series Endpoint: This endpoint allows users to query daily historical rates between two specified dates. It is particularly beneficial for trend analysis and forecasting.
- Fluctuation Endpoint: Users can track how metal prices fluctuate on a day-to-day basis, providing insights into market volatility and helping traders make informed decisions.
- Carat Endpoint: This feature allows users to retrieve gold rates by carat, which is essential for jewelers and those in the jewelry industry.
- Lowest/Highest Price Endpoint: This endpoint enables 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 access OHLC data for a specific time period, which 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, making it a valuable resource for comprehensive market analysis.
- API Key: Each user is assigned a unique API key that must be included in the API base URL's access_key parameter for authentication.
- API Response: The Metals-API delivers exchange rates relative to USD by default, ensuring consistency in data presentation.
- Available Endpoints: The API features 14 endpoints, each providing distinct functionalities to cater to various data needs.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, allowing users to stay informed about the latest symbols.
- Intraday Endpoint: Users can query intraday exchange rate data for a single symbol, which is essential for high-frequency trading 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.
API Endpoint Examples and Responses
Understanding the API responses is crucial for effective integration. Below are examples of responses from various endpoints, along with explanations of their fields.
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1786493758,
"base": "USD",
"date": "2026-08-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"
}
In this response, the success field indicates whether the request was successful. The timestamp provides the time of the response, while base shows the base currency (USD in this case). The rates object contains the exchange rates for various metals, with each metal symbol as a key and its corresponding value per troy ounce.
Historical Rates Endpoint
Access historical exchange rates for any date since 1999.
{
"success": true,
"timestamp": 1786407358,
"base": "USD",
"date": "2026-08-11",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response provides historical rates for a specific date. The date field indicates the date for which the rates are provided, and the rates object contains the exchange rates for that date.
Time-series Endpoint
Get exchange rates for a specific time period.
{
"success": true,
"timeseries": true,
"start_date": "2026-08-05",
"end_date": "2026-08-12",
"base": "USD",
"rates": {
"2026-08-05": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-08-07": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-08-12": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time series of exchange rates between two specified dates. The start_date and end_date fields indicate the range of the query, while the rates object contains the rates for each date within that range.
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": 1786493758,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows the result of converting 1000 USD to gold (XAU). The query object details the conversion parameters, while the result field provides the converted amount in troy ounces.
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2026-08-05",
"end_date": "2026-08-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"
}
This response provides information about how metal prices fluctuated over a specified period. The change and change_pct fields indicate the absolute and percentage changes in price, respectively.
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period.
{
"success": true,
"timestamp": 1786493758,
"base": "USD",
"date": "2026-08-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"
}
This response provides OHLC data for a specific date, which is essential for traders conducting technical analysis. The open, high, low, and close fields provide critical information for evaluating market performance.
Bid/Ask Endpoint
Get current bid and ask prices for metals.
{
"success": true,
"timestamp": 1786493758,
"base": "USD",
"date": "2026-08-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"
}
This response provides the current bid and ask prices for gold and other metals. The spread field indicates the difference between the bid and ask prices, which is crucial for traders looking to optimize their trades.
Conclusion
In conclusion, the Metals-API offers a comprehensive suite of features that empower developers to access real-time and historical gold pricing data. By leveraging this API, developers can create innovative applications that enhance financial modeling, trading strategies, and market analysis. The ability to retrieve accurate data on gold prices, fluctuations, and historical trends is invaluable in today's fast-paced financial environment.
For more detailed information on how to implement these features, refer to the Metals-API Documentation. Additionally, explore the Metals-API Supported Symbols page to stay updated on the latest symbols available for use.
As the financial landscape continues to evolve, staying informed and utilizing advanced tools like the Metals-API will be essential for developers aiming to create cutting-edge financial applications.