Retrieve LBMA Silver (LBXAG) Historical Prices via this API

Retrieve LBMA Silver (LBXAG) Historical Prices via this API
In the ever-evolving landscape of precious metals trading, having access to accurate and timely data is crucial for developers and businesses alike. The Metals-API provides a robust solution for retrieving historical prices of silver (XAG), enabling developers to build applications that leverage real-time and historical data for analysis, trading, and decision-making. This blog post delves into the capabilities of the Metals-API, focusing on how to retrieve historical prices for silver and explore its various features.
About Silver (XAG)
Silver, represented by the symbol XAG, is not only a precious metal but also a critical industrial commodity. Its applications span various sectors, including electronics, solar energy, and medical devices. The demand for silver is driven by its unique properties, such as high electrical conductivity and reflectivity, making it indispensable in modern technology.
As industries innovate and adopt smart manufacturing practices, the integration of silver into advanced technologies continues to grow. For instance, the rise of electric vehicles and renewable energy solutions has significantly increased the demand for silver in photovoltaic cells and batteries. This industrial demand, coupled with investment interest, creates a dynamic market for silver, making accurate price tracking essential.
With the digital transformation of the metals market, data analytics plays a pivotal role. Developers can harness the power of real-time data to create applications that analyze market trends, forecast prices, and optimize supply chain management. The Metals-API serves as a gateway to accessing this critical data, empowering developers to build next-generation applications that can adapt to the fast-paced changes in the metals market.
API Description
The Metals-API is designed to provide developers with comprehensive access to metals pricing data, including historical rates, real-time updates, and conversion capabilities. This API is a game-changer for those looking to integrate metals data into their applications. With its user-friendly interface and extensive documentation, developers can quickly implement features that require accurate metals pricing.
One of the standout features of the Metals-API is its ability to deliver real-time and historical data for various metals, including silver. The API supports multiple endpoints that cater to different data needs, from the latest rates to historical trends. This flexibility allows developers to create tailored solutions that meet specific business requirements.
Key Features and Endpoints
The Metals-API offers a variety of endpoints, each designed to provide specific functionalities that enhance the user experience. Here’s a closer look at some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for silver and other metals. Depending on your subscription plan, the API can return updates every 60 minutes or even more frequently. This feature is essential for applications that require up-to-the-minute pricing information.
- Historical Rates Endpoint: Developers can access historical rates for silver dating back to 2019. By appending a specific date to the API request, users can retrieve historical pricing data, which is invaluable for trend analysis and forecasting.
- Bid and Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices for silver. Understanding the bid-ask spread is crucial for traders and investors looking to make informed decisions in the market.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint that enables users to convert amounts from one metal to another or to/from USD. This feature is particularly useful for businesses operating in multiple currencies.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two specified dates. It’s an excellent tool for analyzing price movements over time and identifying patterns.
- Fluctuation Endpoint: Users can track how silver prices fluctuate between two dates, providing insights into market volatility and helping traders make strategic decisions.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides detailed OHLC data for silver, allowing users to analyze price movements within a specific time frame. Understanding these metrics is crucial for technical analysis.
- Lowest/Highest Price Endpoint: Developers can query the API to retrieve the lowest and highest prices for silver over a specified period, aiding in market analysis and investment strategies.
- Historical LME Endpoint: For those interested in LME symbols, this endpoint provides historical rates dating back to 2008, offering a broader perspective on market trends.
- API Key: Access to the Metals-API requires an API key, which is passed into the base URL's access_key parameter. This key ensures secure access to the API's features.
- API Response: The API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format, making it easy to integrate into applications.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available metal symbols, ensuring developers have access to the latest information.
- News Endpoint: Users can retrieve the latest news articles related to various metals, keeping them informed about market developments and trends.
API Endpoint Examples and Responses
To illustrate the capabilities of the Metals-API, let’s explore some example responses for key endpoints:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1750230018,
"base": "USD",
"date": "2025-06-18",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
This response shows the latest exchange rates for various metals, including silver (XAG). The data is structured to provide clarity on the base currency (USD) and the unit of measurement.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1750143618,
"base": "USD",
"date": "2025-06-17",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example demonstrates how to retrieve historical rates for silver. Developers can specify the date to access past pricing data, which is crucial for analysis.
Time-Series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-06-11",
"end_date": "2025-06-18",
"base": "USD",
"rates": {
"2025-06-11": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-06-13": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-06-18": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
The time-series endpoint provides a comprehensive view of silver prices over a specified period, allowing developers to analyze trends and fluctuations effectively.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1750230018,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response illustrates how to convert an amount from USD to silver (XAU). The API provides the conversion rate and the resulting amount in troy ounces.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-06-11",
"end_date": "2025-06-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"
}
The fluctuation endpoint provides insights into how silver prices have changed over a specified period, offering valuable information for traders and analysts.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1750230018,
"base": "USD",
"date": "2025-06-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"
}
This endpoint provides detailed OHLC data, which is essential for conducting technical analysis and understanding market behavior.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1750230018,
"base": "USD",
"date": "2025-06-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"
}
The bid/ask endpoint provides current bid and ask prices for silver, which are crucial for traders looking to execute orders at the best possible prices.
Conclusion
The Metals-API is an invaluable resource for developers seeking to integrate silver pricing data into their applications. With its extensive range of endpoints, including the latest rates, historical data, and conversion capabilities, the API empowers users to make informed decisions based on accurate and timely information.
As the demand for silver continues to grow in various industries, having access to reliable data becomes increasingly important. The Metals-API not only provides real-time updates but also historical insights that are essential for market analysis and forecasting. By leveraging this API, developers can create innovative applications that enhance trading strategies, optimize supply chain management, and drive business growth.
For a complete list of supported symbols, refer to the Metals-API Supported Symbols page. Whether you are a trader, analyst, or developer, the Metals-API offers the tools you need to stay ahead in the dynamic world of precious metals.