Query LBMA Platinum Am (LBXPTAM) Historical Prices with this API
Introduction
In the ever-evolving landscape of financial markets, the ability to access and analyze historical prices of precious metals such as Gold (XAU) is crucial for investors, analysts, and developers alike. The Metals-API provides a robust solution for querying historical prices, enabling users to harness real-time and historical data effectively. This blog post delves into the intricacies of the Metals-API, focusing on how to retrieve historical prices for Gold and other metals, while exploring the transformative potential of this powerful tool.
Understanding Gold (XAU)
Gold, represented by the symbol XAU, has been a cornerstone of wealth and investment for centuries. Its applications span from jewelry to electronics and even as a hedge against inflation. In recent years, the demand for Gold has surged, driven by its role in green technology applications and sustainable innovation. As the world shifts towards clean energy solutions, Gold's properties make it an essential component in various technologies, including solar panels and electric vehicles.
Green Technology Applications
Gold's unique properties, such as its conductivity and resistance to corrosion, make it invaluable in the realm of green technology. For instance, Gold is used in photovoltaic cells, which convert sunlight into electricity, thereby playing a pivotal role in the transition to renewable energy sources.
Sustainable Innovation
As industries strive for sustainability, Gold's recyclability and durability position it as a key player in sustainable innovation. The ability to recycle Gold from electronic waste not only reduces environmental impact but also contributes to a circular economy.
Digital Transformation and Smart Technology Integration
The integration of Gold in smart technologies, such as advanced sensors and communication devices, highlights its importance in the digital transformation era. Developers can leverage the Metals-API to access real-time data on Gold prices, facilitating the development of applications that require up-to-date financial information.
Metals-API Overview
The Metals-API is a comprehensive JSON API that provides access to real-time and historical prices of various metals, including Gold, Silver, Platinum, and more. With its user-friendly interface and extensive documentation, developers can easily integrate this API into their applications. The API empowers users to build next-generation applications that require accurate and timely metals data.
API Capabilities
The Metals-API offers a range of capabilities that cater to the needs of developers and analysts. From retrieving the latest rates to accessing historical data, the API is designed to provide seamless access to critical information. The following sections will explore the key features and endpoints of the Metals-API, illustrating how they can be utilized effectively.
Key Features of Metals-API
The Metals-API boasts several key features that enhance its functionality and usability:
Latest Rates Endpoint
The Latest Rates Endpoint allows users to retrieve real-time exchange rate data for various metals. Depending on the subscription plan, the API can return updates every 60 minutes, every 10 minutes, or even more frequently. This feature is essential for applications that require up-to-the-minute pricing information.
{
"success": true,
"timestamp": 1777508130,
"base": "USD",
"date": "2026-04-30",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
The Historical Rates Endpoint provides access to historical exchange rates dating back to 2019. Users can query the API for historical rates by appending a specific date in the format YYYY-MM-DD. This feature is particularly useful for analysts looking to study price trends over time.
{
"success": true,
"timestamp": 1777421730,
"base": "USD",
"date": "2026-04-29",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"unit": "per troy ounce"
}
Bid And Ask Endpoint
The Bid and Ask Endpoint is a powerful feature that enables users to retrieve real-time Bid and Ask prices for metals. This information is crucial for traders who need to make informed decisions based on current market conditions.
{
"success": true,
"timestamp": 1777508130,
"base": "USD",
"date": "2026-04-30",
"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"
}
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. This feature is particularly useful for applications that require currency conversion for pricing or valuation purposes.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1777508130,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series Endpoint allows users to query the API for daily historical rates between two dates of their choice. This feature is invaluable for conducting detailed analyses of price movements over specific periods.
{
"success": true,
"timeseries": true,
"start_date": "2026-04-23",
"end_date": "2026-04-30",
"base": "USD",
"rates": {
"2026-04-23": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-04-25": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-04-30": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
Using the Fluctuation Endpoint, users can retrieve information about how currencies fluctuate on a day-to-day basis. This feature is essential for understanding market volatility and making informed trading decisions.
{
"success": true,
"fluctuation": true,
"start_date": "2026-04-23",
"end_date": "2026-04-30",
"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"
}
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price Endpoint provides users with the open, high, low, and close prices for a specific time period. This data is crucial for technical analysis and understanding market trends.
{
"success": true,
"timestamp": 1777508130,
"base": "USD",
"date": "2026-04-30",
"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"
}
Historical LME Endpoint
The Historical LME Endpoint provides access to historical rates for LME symbols dating back to 2008. This feature is particularly useful for users interested in the London Metal Exchange pricing data.
API Key and Authentication
To access the Metals-API, users must obtain an API key, which is a unique identifier passed into the API base URL's access_key parameter. This key ensures secure access to the API and helps manage usage limits.
API Response Structure
Exchange rates delivered by the Metals-API are, by default, relative to USD. All data is returned in a structured JSON format, making it easy for developers to parse and utilize the information in their applications.
Practical Use Cases for Metals-API
The versatility of the Metals-API opens up numerous practical use cases for developers and analysts:
Market Analysis and Trading Applications
Developers can create sophisticated trading applications that leverage real-time and historical data to inform trading strategies. By integrating the Latest Rates and Historical Rates endpoints, users can analyze market trends and make data-driven decisions.
Financial Reporting and Analytics
Businesses can utilize the Metals-API to generate financial reports that include historical pricing data for metals. This information can be crucial for investment analysis, portfolio management, and risk assessment.
Educational Tools and Resources
Educators and trainers can develop tools that teach users about the dynamics of precious metal markets. By providing access to real-time data and historical trends, learners can gain a deeper understanding of market behavior.
Conclusion
The Metals-API offers a powerful solution for accessing historical prices of Gold and other precious metals. With its extensive range of features, including real-time data retrieval, historical analysis, and conversion capabilities, the API empowers developers to build innovative applications that meet the demands of today's financial landscape. By leveraging the capabilities of the Metals-API, users can gain valuable insights into market trends, optimize trading strategies, and enhance their financial analyses.
For more information on how to get started with the Metals-API, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols for a comprehensive list of available metals. Embrace the future of metals data with the Metals-API and unlock the potential of real-time financial insights.