How to retrieve LME Zinc (LME-ZNC) prices using this API

Introduction
In the ever-evolving landscape of metal markets, the ability to access real-time data is crucial for developers and businesses alike. One of the key players in this domain is LME Zinc, represented by the symbol XZN. This blog post will delve into how to retrieve LME Zinc prices using the Metals-API, exploring its capabilities, features, and the transformative potential of real-time metals data.
Metals-API Information
About Zinc (XZN)
Zinc is a vital metal used in various industries, including construction, automotive, and electronics. As the world embraces digital transformation, the metal markets are also undergoing significant changes. The integration of technological innovations and advancements in data analytics is reshaping how businesses operate. With the rise of smart technology, companies can now leverage real-time data to make informed decisions, optimize operations, and enhance profitability.
As we look to the future, the possibilities for Zinc and other metals are vast. The demand for sustainable practices and the push for greener technologies will likely influence market trends. The ability to access and analyze data in real-time will empower developers to create applications that not only track prices but also predict market movements based on historical data and current trends.
API Description
The Metals-API is a powerful tool that provides developers with access to real-time and historical metal prices, including LME Zinc. This API is designed to facilitate the integration of metals data into applications, enabling developers to build next-generation solutions that can respond to market changes swiftly.
With the Metals-API, developers can access a variety of endpoints that cater to different needs. Whether you are looking for the latest rates, historical data, or specific price fluctuations, the Metals-API has you covered. The API's capabilities extend beyond mere data retrieval; it empowers users to analyze trends, perform conversions, and understand market dynamics.
Key Features and Endpoints
The Metals-API offers a comprehensive suite of features that cater to various use cases. Here are some of the key endpoints and their functionalities:
Latest Rates Endpoint
The Latest Rates endpoint provides real-time exchange rate data for metals, updated based on your subscription plan. Depending on the plan, updates can occur every 60 minutes, every 10 minutes, or even more frequently. This endpoint is essential for applications that require up-to-the-minute pricing information.
{
"success": true,
"timestamp": 1743901283,
"base": "USD",
"date": "2025-04-06",
"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 "rates" object contains the latest prices for various metals, including LME Zinc (XZN). The data is provided in terms of troy ounces, which is the standard measurement for precious metals.
Historical Rates Endpoint
The Historical Rates endpoint allows users to access past exchange rates for metals dating back to 2019. By appending a specific date to the API request, developers can retrieve historical data, which is invaluable for trend analysis and forecasting.
{
"success": true,
"timestamp": 1743814883,
"base": "USD",
"date": "2025-04-05",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This endpoint is particularly useful for developers looking to analyze historical trends and make data-driven decisions based on past performance.
Bid And Ask Endpoint
The Bid and Ask endpoint provides real-time bid and ask prices for metals. This feature is crucial for traders who need to understand the market depth and make informed trading decisions.
{
"success": true,
"timestamp": 1743901283,
"base": "USD",
"date": "2025-04-06",
"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 "spread" indicates the difference between the bid and ask prices, providing insights into market liquidity.
Convert Endpoint
The Convert endpoint allows users to convert amounts from one metal to another or to/from USD. This feature is particularly useful for applications that require currency conversion for pricing or reporting purposes.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1743901283,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows the conversion of 1000 USD to gold (XAU), providing the equivalent amount in troy ounces.
Time-Series Endpoint
The Time-Series endpoint enables users to query the API for daily historical rates between two specified dates. This feature is beneficial for analyzing trends over time and understanding price movements.
{
"success": true,
"timeseries": true,
"start_date": "2025-03-30",
"end_date": "2025-04-06",
"base": "USD",
"rates": {
"2025-03-30": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-04-01": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-04-06": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This endpoint provides a comprehensive view of how prices have changed over a specified period, allowing for detailed analysis.
Fluctuation Endpoint
The Fluctuation endpoint allows users to track rate fluctuations between two dates. This feature is essential for understanding market volatility and making informed trading decisions.
{
"success": true,
"fluctuation": true,
"start_date": "2025-03-30",
"end_date": "2025-04-06",
"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 prices have fluctuated over the specified period, including both absolute and percentage changes.
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price endpoint provides open, high, low, and close prices for a specific time period. This data is crucial for traders who rely on candlestick charts for technical analysis.
{
"success": true,
"timestamp": 1743901283,
"base": "USD",
"date": "2025-04-06",
"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 a snapshot of price movements throughout the day, allowing traders to make informed decisions based on market behavior.
Historical LME Endpoint
The Historical LME endpoint provides access to historical rates for LME symbols, including LME Zinc, dating back to 2008. This endpoint is invaluable for those looking to analyze long-term trends and make strategic decisions based on historical performance.
{
"success": true,
"timestamp": 1743901283,
"base": "USD",
"date": "2025-04-06",
"rates": {
"XZN": {
"date": "2025-04-06",
"price": 0.344828
}
},
"unit": "per troy ounce"
}
This response provides historical pricing data for LME Zinc, allowing users to track its performance over time.
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. This resource is essential for developers looking to integrate various metals into their applications.
Conclusion
In conclusion, the Metals-API is a powerful tool for developers seeking to access real-time and historical data for metals, including LME Zinc (XZN). With its extensive range of endpoints, the API empowers users to build applications that can analyze market trends, perform conversions, and track price fluctuations effectively. As the metal markets continue to evolve, leveraging such innovative technologies will be crucial for staying ahead in this competitive landscape.
For more information on how to utilize the Metals-API, be sure to check out the Metals-API Documentation, which provides comprehensive guidance on all available features and endpoints.