The Easiest Way to Get LBMA Gold Am (LBXAUAM) Historical Rates via Web Scraping
The Easiest Way to Get LBMA Gold Am (LBXAUAM) Historical Rates via Web Scraping
In the world of precious metals trading, having access to accurate and timely historical price data is crucial for making informed decisions. One of the most effective ways to obtain this data is through the Metals-API, which provides a comprehensive suite of endpoints for accessing real-time and historical rates for various metals, including Gold (XAU). 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 considered a safe haven asset, especially during times of economic uncertainty. With the digital transformation in precious metals trading, data analytics and market insights have become more accessible than ever. The integration of technology in trading has revolutionized how investors approach the market, enabling them to leverage real-time data for better decision-making.
As a developer, understanding how to harness the power of APIs like Metals-API can significantly enhance your applications. By utilizing the API's capabilities, you can build innovative solutions that provide users with up-to-date information on Gold prices, trends, and fluctuations. This not only aids in price discovery but also empowers users to make informed investment decisions.
API Description
The Metals-API is a powerful tool that allows developers to access real-time and historical metals data. With a focus on innovation and technological advancement, this API enables the creation of next-generation applications that can analyze market trends and provide insights into precious metals trading.
For more information, you can visit the Metals-API Website or check out the Metals-API Documentation for detailed instructions on how to use the API.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated every 60 minutes, 10 minutes, or even more frequently, depending on your subscription plan.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. You can query the API for historical rates by appending a specific date.
- Bid and Ask Endpoint: Retrieve real-time Bid and Ask prices for metals, allowing traders to make informed decisions based on current market conditions.
- Convert Endpoint: This feature allows you to convert any amount from one metal to another or to/from USD, making it easy to calculate values across different currencies.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, providing a comprehensive view of price trends over time.
- Fluctuation Endpoint: Track how currencies fluctuate on a day-to-day basis, offering insights into market volatility.
- Carat Endpoint: Retrieve information about Gold rates by Carat, which is particularly useful for jewelers and retailers.
- Lowest/Highest Price Endpoint: Get the lowest and highest price for a specified date range, helping traders identify market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: Access 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 comprehensive view of market trends.
- API Key: Your unique API key is required to access the API, ensuring secure and authorized usage.
- API Response: Exchange rates are delivered relative to USD by default, with all data returned in JSON format.
- Available Endpoints: The API includes 14 endpoints, each offering different functionalities to cater to various user needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies, allowing users to stay updated on the latest symbols.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping users informed about market developments.
For a complete list of all supported symbols, refer to the Metals-API Supported Symbols page.
API Endpoint Examples and Responses
To illustrate how to use the Metals-API, let's explore some example endpoints and their responses.
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1772024901,
"base": "USD",
"date": "2026-02-25",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1771938501,
"base": "USD",
"date": "2026-02-24",
"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-18",
"end_date": "2026-02-25",
"base": "USD",
"rates": {
"2026-02-18": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-02-20": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-02-25": {
"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": 1772024901,
"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-18",
"end_date": "2026-02-25",
"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": 1772024901,
"base": "USD",
"date": "2026-02-25",
"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": 1772024901,
"base": "USD",
"date": "2026-02-25",
"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 robust and flexible solution for accessing historical and real-time data for precious metals like Gold (XAU). By leveraging the various endpoints available, developers can create applications that offer valuable insights into market trends, price fluctuations, and trading opportunities. Whether you are building a trading platform, a financial analysis tool, or a market research application, the Metals-API can empower you to deliver accurate and timely information to your users.
For further exploration of the API's capabilities, be sure to check out the Metals-API Documentation and the Metals-API Supported Symbols page. With the right tools and knowledge, you can harness the power of real-time metals data to enhance your applications and provide users with the insights they need to succeed in the precious metals market.