How to Get Real-Time Zinc - LME 3-month (ZNC3M) - Per Troy Ounce Prices with Metals-API

How to Get Real-Time Zinc - LME 3-month (ZNC3M) - Per Troy Ounce Prices with Metals-API
Accessing real-time market prices for metals, such as Zinc (symbol: XZN), has become increasingly essential for developers and businesses in the financial sector. With the rise of digital transformation in metal markets, the need for accurate and timely data has never been more critical. The Metals-API provides a robust solution for obtaining real-time Zinc prices and other metal data, empowering developers to create innovative applications that leverage this information. In this blog post, we will explore how to access real-time Zinc market prices using Metals-API, including step-by-step instructions and example API calls.
About Zinc (XZN)
Zinc is a vital metal used in various industries, including construction, automotive, and electronics. Its demand is driven by technological advancements and innovations that require high-performance materials. As the world moves towards smart technology integration, the need for real-time data analytics and insights into metal prices becomes paramount. The Metals-API offers a comprehensive solution for accessing this data, enabling developers to build applications that can analyze trends, forecast prices, and make informed decisions based on real-time information.
With the Metals-API, you can access a wide range of endpoints that provide different functionalities, including the latest rates, historical data, and conversion capabilities. This API not only supports Zinc but also a variety of other metals, allowing for a holistic view of the market. As we delve deeper into the API's features, we will highlight how these capabilities can transform the way businesses interact with metal markets.
API Description
The Metals-API is designed to provide developers with easy access to real-time metal prices and historical data. Its capabilities include:
- Latest Rates Endpoint: Retrieve real-time exchange rate data for metals, updated based on your subscription plan.
- Historical Rates Endpoint: Access historical rates dating back to 2019, allowing for in-depth analysis of price trends.
- Bid and Ask Endpoint: Get real-time bid and ask prices for metals, crucial for trading applications.
- Convert Endpoint: Convert amounts between different metals or currencies, facilitating seamless transactions.
- Time-Series Endpoint: Query daily historical rates between two dates, enabling trend analysis over time.
- Fluctuation Endpoint: Track how metal prices fluctuate on a day-to-day basis, providing insights into market volatility.
- Open/High/Low/Close (OHLC) Price Endpoint: Obtain detailed price information for specific time periods.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008.
- API Key: Use your unique API key to authenticate requests and access the data.
- API Response: Receive exchange rates relative to USD, with all data returned in a structured format.
- Supported Symbols Endpoint: Retrieve a list of all available metal symbols.
- News Endpoint: Get the latest news articles related to various metals, keeping you informed about market developments.
For a complete list of supported symbols, refer to the Metals-API Supported Symbols page.
Accessing Real-Time Zinc Prices
To access real-time Zinc prices, you will primarily use the Latest Rates Endpoint. This endpoint allows you to retrieve the current market price of Zinc per troy ounce. Below is a step-by-step guide on how to make a request to this endpoint:
- Obtain Your API Key: Sign up on the Metals-API Website and obtain your unique API key.
- Construct Your API Request: Use the following URL format to access the Latest Rates Endpoint:
https://metals-api.com/api/latest?access_key=YOUR_API_KEY&base=USD&symbols=XZN
Replace YOUR_API_KEY
with your actual API key. This request will return the latest price of Zinc in USD.
Example API Call and Response
Here’s an example of what a successful API response might look like when querying the Latest Rates Endpoint:
{
"success": true,
"timestamp": 1757386841,
"base": "USD",
"date": "2025-09-09",
"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 Zinc (XZN), which is priced at 0.344828 per troy ounce.
Exploring Historical Data
To analyze trends over time, you can utilize the Historical Rates Endpoint. This allows you to access historical prices for Zinc and other metals. The request format is as follows:
https://metals-api.com/api/historical?access_key=YOUR_API_KEY&base=USD&symbols=XZN&date=YYYY-MM-DD
Replace YYYY-MM-DD
with the desired date to retrieve historical data for that specific day. Here’s an example response:
{
"success": true,
"timestamp": 1757300441,
"base": "USD",
"date": "2025-09-08",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response provides the historical prices for various metals on the specified date, allowing you to analyze price movements and trends.
Utilizing the Time-Series Endpoint
The Time-Series Endpoint is particularly useful for developers looking to analyze price trends over a specific period. The request format is as follows:
https://metals-api.com/api/timeseries?access_key=YOUR_API_KEY&base=USD&symbols=XZN&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
By specifying a start and end date, you can retrieve daily historical rates for Zinc. Here’s an example response:
{
"success": true,
"timeseries": true,
"start_date": "2025-09-02",
"end_date": "2025-09-09",
"base": "USD",
"rates": {
"2025-09-02": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-09-04": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-09-09": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily rates for the specified period, enabling developers to conduct thorough analyses of price fluctuations.
Bid and Ask Prices
For trading applications, the Bid and Ask Endpoint is crucial. This endpoint allows you to retrieve the current bid and ask prices for Zinc. The request format is:
https://metals-api.com/api/bidask?access_key=YOUR_API_KEY&base=USD&symbols=XZN
Here’s an example of a typical response:
{
"success": true,
"timestamp": 1757386841,
"base": "USD",
"date": "2025-09-09",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
},
"XAG": {
"bid": 0.0381,
"ask": 0.0382,
"spread": 0.0001
},
"XZN": {
"bid": 0.3445,
"ask": 0.3450,
"spread": 0.0005
}
},
"unit": "per troy ounce"
}
This response provides the bid and ask prices for Zinc, which are essential for traders looking to make informed decisions.
Conversion Capabilities
The Convert Endpoint allows you to convert amounts between different metals or currencies. The request format is:
https://metals-api.com/api/convert?access_key=YOUR_API_KEY&from=XZN&to=USD&amount=100
Here’s an example response:
{
"success": true,
"query": {
"from": "XZN",
"to": "USD",
"amount": 100
},
"info": {
"timestamp": 1757386841,
"rate": 0.344828
},
"result": 34.4828,
"unit": "USD"
}
This response indicates the conversion of 100 units of Zinc to USD, providing valuable information for financial transactions.
Fluctuation Tracking
The Fluctuation Endpoint allows you to track price fluctuations between two dates. The request format is:
https://metals-api.com/api/fluctuation?access_key=YOUR_API_KEY&base=USD&symbols=XZN&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Here’s an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2025-09-02",
"end_date": "2025-09-09",
"base": "USD",
"rates": {
"XZN": {
"start_rate": 0.3445,
"end_rate": 0.3448,
"change": 0.0003,
"change_pct": 0.087
}
},
"unit": "per troy ounce"
}
This response provides insights into how Zinc prices have changed over the specified period, allowing for better market predictions.
Open/High/Low/Close (OHLC) Data
The OHLC Endpoint provides detailed price information for a specific time period. The request format is:
https://metals-api.com/api/ohlc?access_key=YOUR_API_KEY&base=USD&symbols=XZN&date=YYYY-MM-DD
Here’s an example response:
{
"success": true,
"timestamp": 1757386841,
"base": "USD",
"date": "2025-09-09",
"rates": {
"XZN": {
"open": 0.3445,
"high": 0.3450,
"low": 0.3440,
"close": 0.3448
}
},
"unit": "per troy ounce"
}
This response provides the open, high, low, and close prices for Zinc, which are essential for traders and analysts.
Security and Best Practices
When using the Metals-API, it is crucial to follow best practices for security and performance. Here are some recommendations:
- Authentication: Always use your API key in requests to authenticate and authorize access.
- Rate Limiting: Be aware of your subscription plan's rate limits to avoid exceeding your quota.
- Error Handling: Implement error handling in your application to manage API response errors gracefully.
- Data Validation: Validate and sanitize all input data to prevent injection attacks and ensure data integrity.
- Performance Optimization: Cache frequently accessed data to reduce API calls and improve application performance.
Conclusion
Accessing real-time Zinc prices and other metal data through the Metals-API opens up a world of possibilities for developers and businesses alike. By leveraging the various endpoints available, you can create applications that provide valuable insights into market trends, facilitate trading, and enhance decision-making processes. The API's capabilities, including real-time rates, historical data, and conversion features, empower you to build next-generation applications that can adapt to the rapidly changing landscape of metal markets.
For more information on how to get started, refer to the Metals-API Documentation and explore the full range of features available. By integrating real-time data into your applications, you can stay ahead of the curve in the ever-evolving world of metals trading.