How to retrieve Zinc (ZNC) prices using this API for your application
Introduction
In the rapidly evolving landscape of financial technology, the ability to access real-time data is paramount for developers building applications that cater to the metal markets. One such metal is Zinc (symbol: XZN), a critical component in various industries, including construction and manufacturing. This blog post will explore how to retrieve Zinc (ZNC) prices using the Metals-API, a powerful tool that provides comprehensive data on metal prices and market trends. We will delve into the features of the API, its endpoints, and how it can be leveraged to enhance your applications.
Metals-API Information
About Zinc (XZN)
Zinc is a versatile metal that plays a crucial role in various industrial applications. Its digital transformation in the metal markets is driven by technological innovations and advancements that allow for more efficient data analytics and insights. The integration of smart technology into the metal trading ecosystem has opened up new avenues for developers and businesses alike. As we look to the future, the possibilities for Zinc and other metals are vast, with trends indicating a growing reliance on real-time data to inform trading decisions.
API Description
The Metals-API is designed to empower developers by providing access to real-time metals data, enabling the creation of next-generation applications. With its robust capabilities, the API allows users to retrieve current and historical prices, track fluctuations, and convert between different metal currencies. This transformative potential is crucial for developers looking to build applications that require accurate and timely data.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different data needs. Depending on your subscription plan, you can access real-time exchange rate data through the Latest Rates Endpoint, which updates every 60 minutes or more frequently. This endpoint is essential for applications that require up-to-the-minute pricing information.
For those interested in historical data, the Historical Rates Endpoint provides access to rates dating back to 2019. By appending a specific date to your query, you can retrieve historical prices for Zinc and other metals, allowing for in-depth analysis and trend identification.
The Bid and Ask Endpoint is another powerful feature, enabling developers to retrieve real-time bid and ask prices for metals. This information is vital for traders looking to make informed decisions based on current market conditions.
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. This functionality is particularly useful for applications that require currency conversion as part of their operations.
The Time-Series Endpoint enables users to query daily historical rates between two dates of their choice, providing insights into price movements over time. Similarly, the Fluctuation Endpoint allows for tracking rate fluctuations between two dates, giving developers the tools to analyze market volatility.
For those interested in detailed price analysis, the Open/High/Low/Close (OHLC) Price Endpoint provides essential data for understanding market trends. This endpoint allows users to query for the open, high, low, and close prices for a specific time period, which is crucial for technical analysis.
The Metals-API also includes a Lowest/Highest Price Endpoint, which allows users to query for the lowest and highest prices within a specified date range. This feature is particularly useful for identifying price extremes and making strategic trading decisions.
Additionally, the API provides a Carat Endpoint for retrieving information about Gold rates by Carat, and a Historical LME Endpoint for accessing historical rates for LME symbols dating back to 2008. These endpoints enhance the API's versatility and usability for various applications.
To get started with the Metals-API, developers need an API Key, which is passed into the API base URL's access_key parameter. The API response delivers exchange rates relative to USD by default, ensuring consistency across data retrieval.
For a complete list of supported symbols, including Zinc, developers can refer to the Metals-API Supported Symbols page. This resource is invaluable for understanding the range of metals available through the API.
API Endpoint Examples and Responses
To illustrate the capabilities of the Metals-API, let’s explore some example responses from various endpoints.
Latest Rates Endpoint
The Latest Rates Endpoint provides real-time exchange rates for all available metals. Here’s an example response:
{
"success": true,
"timestamp": 1765940467,
"base": "USD",
"date": "2025-12-17",
"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 for various metals are provided, including Zinc (XZN), which is priced at 0.344828 per troy ounce.
Historical Rates Endpoint
The Historical Rates Endpoint allows access to historical exchange rates for any date since 1999. Here’s an example response:
{
"success": true,
"timestamp": 1765854067,
"base": "USD",
"date": "2025-12-16",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response shows the historical rates for various metals on a specific date, allowing developers to analyze past market conditions.
Time-series Endpoint
The Time-Series Endpoint provides exchange rates for a specific time period. Here’s an example response:
{
"success": true,
"timeseries": true,
"start_date": "2025-12-10",
"end_date": "2025-12-17",
"base": "USD",
"rates": {
"2025-12-10": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-12-12": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-12-17": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily rates for a specified period, enabling developers to track price movements over time.
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. Here’s an example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1765940467,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows the conversion of 1000 USD to Gold (XAU), providing the resulting amount in troy ounces.
Fluctuation Endpoint
The Fluctuation Endpoint tracks rate fluctuations between two dates. Here’s an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2025-12-10",
"end_date": "2025-12-17",
"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 detailed information about the fluctuations in rates for various metals over the specified period.
OHLC (Open/High/Low/Close) Endpoint
The OHLC Price Endpoint provides essential data for understanding market trends. Here’s an example response:
{
"success": true,
"timestamp": 1765940467,
"base": "USD",
"date": "2025-12-17",
"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 response provides the open, high, low, and close prices for various metals, which is crucial for technical analysis and trading strategies.
Bid/Ask Endpoint
The Bid/Ask Endpoint provides current bid and ask prices for metals. Here’s an example response:
{
"success": true,
"timestamp": 1765940467,
"base": "USD",
"date": "2025-12-17",
"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"
}
This response provides the current bid and ask prices for various metals, which is essential for traders looking to make informed decisions.
Conclusion
The Metals-API is an invaluable resource for developers looking to integrate real-time metals data into their applications. With its extensive range of endpoints, including the Latest Rates, Historical Rates, and various conversion and fluctuation features, the API provides the tools necessary for comprehensive market analysis and decision-making. By leveraging the capabilities of the Metals-API, developers can create innovative applications that meet the demands of the modern metal markets.
For more information on how to get started, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols page for a complete list of available metals. Embrace the future of metal trading with the power of real-time data at your fingertips.