Get Copper (NYM $/lbs) Front Month (HG1) Historical Prices using this API

Get Copper (NYM $/lbs) Front Month (HG1) Historical Prices using this API
Copper, represented by the symbol XCU, is one of the most widely used metals in various industries, including construction, electronics, and manufacturing. As a critical component in electrical wiring and plumbing, the demand for copper continues to rise, making it essential for developers and analysts to access accurate historical pricing data. In this blog post, we will explore how to obtain historical prices for copper using the Metals-API, a powerful tool that provides real-time and historical data for various metals.
About Copper (XCU)
Copper is a versatile metal known for its excellent conductivity and malleability. It plays a vital role in the digital transformation of metal markets, where technological innovations and advancements are reshaping how data is collected, analyzed, and utilized. The integration of smart technologies and data analytics has revolutionized the way traders and investors approach the copper market.
As industries increasingly rely on data-driven insights, the demand for real-time pricing information has surged. The Metals-API offers a comprehensive solution for accessing copper prices, enabling developers to build applications that provide users with up-to-date information and historical trends. With the ability to analyze fluctuations and trends, businesses can make informed decisions based on accurate data.
API Description
The Metals-API is designed to empower developers with the tools needed to access real-time and historical metals data. This API provides a range of endpoints that facilitate various functionalities, allowing users to retrieve the latest rates, historical prices, and other essential information about metals like copper.
One of the standout features of the Metals-API is its ability to deliver data in real-time, which is crucial for traders who need to make quick decisions based on market movements. The API's innovative architecture ensures that users can access the information they need without delays, enhancing the overall trading experience.
Key Features and Endpoints
The Metals-API offers several key features that cater to the needs of developers and analysts. Below are some of the most important endpoints and their functionalities:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for copper and other metals. Depending on your subscription plan, the API can return updates every 60 minutes, every 10 minutes, or even more frequently. This feature is essential for traders who need to monitor price changes closely.
- Historical Rates Endpoint: Users can access historical rates for copper dating back to 2019. By appending a specific date to the API request, developers can retrieve historical pricing data, enabling them to analyze trends over time.
- Bid And Ask Endpoint: This feature allows users to retrieve real-time bid and ask prices for copper. Understanding the bid-ask spread is crucial for traders looking to execute trades at optimal prices.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, allowing users to convert amounts from one metal to another or to/from USD. This is particularly useful for businesses operating in multiple currencies.
- Time-Series Endpoint: This endpoint enables users to query the API for daily historical rates between two specified dates. It is an invaluable tool for analysts looking to study price movements over a defined period.
- Fluctuation Endpoint: Users can track how copper prices fluctuate on a day-to-day basis using this endpoint. It provides insights into market volatility and helps traders make informed decisions.
- Lowest/Highest Price Endpoint: This feature allows users to query the API for the lowest and highest prices of copper over a specified time frame, providing valuable insights into market trends.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can access OHLC data for copper, which is essential for technical analysis and understanding market behavior.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols, dating back to 2008. It is particularly useful for users interested in London Metal Exchange data.
- API Key: To access the Metals-API, users must obtain an API key, which is passed into the API 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. Understanding the response structure is crucial for developers to effectively utilize the data.
- Available Endpoints: The Metals-API offers a comprehensive list of endpoints, each providing different functionalities. Developers can explore the Symbols List to find all available currencies and metals.
- 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
Understanding how to interact with the Metals-API is crucial for developers. Below are examples of API responses for various endpoints, showcasing the structure and data provided.
Latest Rates Endpoint
{
"success": true,
"timestamp": 1746687618,
"base": "USD",
"date": "2025-05-08",
"rates": {
"XCU": 0.294118
},
"unit": "per troy ounce"
}
The response above indicates a successful request for the latest copper rates, with the price provided in USD per troy ounce.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1746601218,
"base": "USD",
"date": "2025-05-07",
"rates": {
"XCU": 0.290000
},
"unit": "per troy ounce"
}
This example shows a historical rate for copper on a specific date, allowing users to analyze past pricing trends.
Time-Series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-05-01",
"end_date": "2025-05-08",
"base": "USD",
"rates": {
"2025-05-01": {
"XCU": 0.292000
},
"2025-05-03": {
"XCU": 0.293000
},
"2025-05-08": {
"XCU": 0.294118
}
},
"unit": "per troy ounce"
}
The time-series response provides daily rates for copper over a specified period, enabling users to visualize trends and fluctuations.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XCU",
"amount": 1000
},
"info": {
"timestamp": 1746687618,
"rate": 0.294118
},
"result": 294.118,
"unit": "troy ounces"
}
This response illustrates how to convert an amount from USD to copper, providing the equivalent value in troy ounces.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-01",
"end_date": "2025-05-08",
"base": "USD",
"rates": {
"XCU": {
"start_rate": 0.292000,
"end_rate": 0.294118,
"change": 0.002118,
"change_pct": 0.726
}
},
"unit": "per troy ounce"
}
The fluctuation response provides insights into how copper prices have changed over a specified period, highlighting both absolute and percentage changes.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1746687618,
"base": "USD",
"date": "2025-05-08",
"rates": {
"XCU": {
"open": 0.292000,
"high": 0.295000,
"low": 0.290000,
"close": 0.294118
}
},
"unit": "per troy ounce"
}
This example shows the open, high, low, and close prices for copper on a specific date, which is essential for traders conducting technical analysis.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1746687618,
"base": "USD",
"date": "2025-05-08",
"rates": {
"XCU": {
"bid": 0.293000,
"ask": 0.295000,
"spread": 0.002000
}
},
"unit": "per troy ounce"
}
The bid/ask response provides critical information for traders, including the current bid and ask prices for copper, as well as the spread.
Conclusion
Accessing historical prices for copper is essential for developers and analysts looking to make informed decisions in the metal markets. The Metals-API provides a robust set of features that empower users to retrieve real-time and historical data efficiently. With endpoints designed for various functionalities, developers can build applications that offer valuable insights into copper pricing trends.
By leveraging the capabilities of the Metals-API, businesses can stay ahead of market fluctuations, optimize their trading strategies, and enhance their decision-making processes. Whether you are a trader, analyst, or developer, understanding how to utilize the Metals-API effectively will enable you to harness the power of real-time metals data.
For more information on how to get started, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols for a comprehensive list of available metals and their specifications. Embrace the future of metal trading with the innovative tools provided by the Metals-API.