Query LBMA Gold Pm (LBXAUPM) Historical Prices via this API

Introduction
In the ever-evolving landscape of financial markets, the demand for precise and timely data has never been more critical. For those interested in precious metals, particularly gold, accessing historical prices is essential for informed decision-making. The Metals-API provides a robust solution for querying historical prices of gold, represented by the symbol XAU. This blog post delves into the capabilities of the Metals-API, focusing on how developers can leverage its features to obtain historical prices and gain valuable market insights.
About Gold (XAU)
Gold, denoted by the symbol XAU, has been a cornerstone of wealth and value for centuries. Its allure goes beyond mere aesthetics; gold serves as a hedge against inflation, a safe haven during economic uncertainty, and a critical component in various industries. As the world embraces digital transformation, the integration of technology in trading and data analytics has revolutionized how investors approach the gold market.
Digital Transformation in Precious Metals
The digital transformation of the precious metals market has led to increased accessibility and transparency. With the advent of APIs like Metals-API, developers can create applications that provide real-time data, historical insights, and analytical tools. This shift empowers traders and investors to make data-driven decisions, enhancing their ability to navigate the complexities of the gold market.
Data Analytics and Market Insights
Data analytics plays a pivotal role in understanding market trends and price movements. By utilizing the Metals-API, developers can access a wealth of historical data, enabling them to perform in-depth analyses. This capability allows for the identification of patterns, correlations, and anomalies that can inform trading strategies and investment decisions.
Technology Integration in Trading
Integrating technology into trading platforms has transformed how transactions are executed. The Metals-API offers a suite of endpoints that facilitate seamless integration with existing systems. Developers can harness these capabilities to build applications that provide real-time pricing, historical data, and advanced analytics, all of which are crucial for effective trading in gold and other precious metals.
Innovation in Price Discovery
The Metals-API is at the forefront of innovation in price discovery. By providing access to real-time and historical data, it enables traders to assess market conditions accurately. This innovation fosters a more competitive environment, where price discrepancies are quickly identified and corrected, leading to a more efficient market.
Digital Asset Solutions
As digital assets gain traction, the role of APIs in managing and trading these assets becomes increasingly important. The Metals-API not only provides historical prices for gold but also supports various functionalities that cater to the needs of digital asset traders. This versatility positions the Metals-API as a vital tool for developers looking to create comprehensive trading solutions.
Metals-API Overview
The Metals-API Website offers a powerful platform for accessing real-time and historical data on precious metals. With a focus on innovation and technological advancement, the Metals-API empowers developers to build next-generation applications that can transform how traders interact with the gold market.
API Capabilities
The Metals-API provides a range of endpoints that cater to various data needs. Here are some key features:
- 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 feature is essential for traders who require up-to-the-minute pricing information.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. By appending a specific date to your query, you can retrieve historical prices for gold, allowing for comprehensive analysis and reporting.
- Bid and Ask Endpoint: This powerful feature enables you to retrieve real-time bid and ask prices for gold and other metals, providing insights into market liquidity and trading opportunities.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, allowing you to convert any amount from one metal to another or to/from USD. This functionality is particularly useful for traders dealing in multiple currencies.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice. This endpoint is invaluable for analyzing trends over specific periods.
- Fluctuation Endpoint: Retrieve information about how gold prices fluctuate on a day-to-day basis, providing insights into market volatility.
- Carat Endpoint: Access information about gold rates by carat, which is essential for jewelers and those in the jewelry industry.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price of gold for a specified date, aiding in market analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: Retrieve OHLC data for a specific time period, which is crucial for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a comprehensive view of market trends.
- API Key: Your unique API key is required to access the Metals-API, ensuring secure and authorized usage.
- API Response: Exchange rates are delivered relative to USD by default, with all data returned in a structured JSON format.
- Available Endpoints: The Metals-API offers multiple endpoints, each providing different functionalities tailored to specific needs.
- Supported Symbols Endpoint: Access a constantly updated list of all available currencies and metals supported by the API.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, catering to regional market needs.
- News Endpoint: Stay updated with the latest news articles related to various metals, helping traders stay informed about market developments.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for developers. Below are examples of various endpoints and their JSON responses, providing clarity on how to utilize the API effectively.
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1749600479,
"base": "USD",
"date": "2025-06-11",
"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, relative to USD.
Historical Rates Endpoint
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1749514079,
"base": "USD",
"date": "2025-06-10",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response shows the historical price of gold on June 10, 2025, allowing for retrospective analysis.
Time-Series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2025-06-04",
"end_date": "2025-06-11",
"base": "USD",
"rates": {
"2025-06-04": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-06-06": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-06-11": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily historical rates for gold over a specified period, enabling trend analysis.
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": 1749600479,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response indicates that 1000 USD converts to 0.482 troy ounces of gold at the current rate.
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2025-06-04",
"end_date": "2025-06-11",
"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 absolute and percentage changes.
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1749600479,
"base": "USD",
"date": "2025-06-11",
"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 the open, high, low, and close prices for gold on a specific date, which is crucial for traders performing technical analysis.
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1749600479,
"base": "USD",
"date": "2025-06-11",
"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 essential for traders looking to execute orders effectively.
Conclusion
The Metals-API stands out as a powerful tool for developers seeking to access historical prices and real-time data for gold and other precious metals. By leveraging its extensive features, including the latest rates, historical data, and various conversion options, developers can create innovative applications that enhance trading strategies and market analysis.
As the financial landscape continues to evolve, the integration of technology and data analytics will play a crucial role in shaping the future of trading in precious metals. The Metals-API not only facilitates this transformation but also empowers developers to build solutions that meet the demands of a dynamic market.
For more information on how to get started with the Metals-API, visit the Metals-API Documentation and explore the Metals-API Supported Symbols for a comprehensive list of available options. Embrace the future of trading with the Metals-API and unlock the potential of real-time metals data.