Retrieve iShares Gold Strategy ETF (IAUF) Daily Closing Prices using Metals-API

Retrieve iShares Gold Strategy ETF (IAUF) Daily Closing Prices using Metals-API
In the world of finance and investment, the ability to access accurate and timely data is crucial. For those interested in precious metals, particularly gold, the iShares Gold Strategy ETF (IAUF) offers a unique opportunity to invest in gold without the complexities of physical ownership. This blog post will delve into how to retrieve historical prices for IAUF using the Metals-API, a powerful tool that provides real-time and historical data on various metals, including gold.
Metals-API Information
The Metals-API is a robust platform that allows developers to access a wealth of information regarding precious metals. With its innovative approach to data analytics and market insights, it empowers users to make informed decisions based on real-time data. The API is designed to integrate seamlessly into applications, providing developers with the tools they need to create next-generation financial solutions.
About Gold (XAU)
Gold, represented by the symbol XAU, has been a cornerstone of wealth and value for centuries. In recent years, the digital transformation in precious metals has revolutionized how investors interact with this timeless asset. The integration of technology in trading has opened new avenues for data analytics, allowing for deeper market insights and more informed decision-making.
As the market for gold evolves, so does the innovation in price discovery. Digital asset solutions are now available, enabling investors to track gold prices in real-time and analyze historical trends with unprecedented accuracy. The Metals-API plays a pivotal role in this transformation, offering a comprehensive suite of endpoints that cater to various needs, from retrieving the latest rates to accessing historical data.
API Description
The Metals-API is designed to provide developers with a straightforward way to access metals data. Its capabilities include real-time exchange rates, historical data, and various endpoints that facilitate different functionalities. The API is built with a focus on innovation and technological advancement, making it an essential tool for anyone looking to leverage real-time metals data in their applications.
For detailed documentation on how to use the API, visit the Metals-API Documentation. Here, you will find comprehensive guides on how to implement various features and endpoints effectively.
Key Features and Endpoints
The Metals-API offers a range of endpoints that cater to different needs. Here are some of the key features:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data updated every 60 minutes or every 10 minutes. This feature is essential for traders who need the most current pricing information.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. By appending a specific date to your query, you can retrieve past prices for analysis and reporting.
- Bid And Ask Endpoint: This powerful feature allows you to retrieve real-time Bid and Ask prices, providing insight into market liquidity and pricing dynamics.
- Convert Endpoint: Easily convert any amount from one currency to another, facilitating transactions and calculations across different metal values.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, enabling trend analysis and forecasting.
- Fluctuation Endpoint: Retrieve information about how currencies fluctuate on a day-to-day basis, which is crucial for understanding market volatility.
- Carat Endpoint: Get information about gold rates by carat, allowing for precise calculations in jewelry and investment contexts.
- Lowest/Highest Price Endpoint: Query the API to find the lowest and highest prices for a specified date range, which can aid in market analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: Access detailed price data for a specific time period, including open, high, low, and close prices, which are vital for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a long-term view of market trends.
- API Key: Your unique API key is required to access the API, ensuring secure and authorized usage.
- API Response: The API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format.
- Available Endpoints: The API features multiple endpoints, each providing different functionalities tailored to various user needs.
- Supported Symbols Endpoint: Access a constantly updated endpoint that returns all available currencies and their specifications.
- Gold Price India Endpoint: Retrieve the latest gold price in India using a dedicated endpoint, which is particularly useful for regional investors.
- News Endpoint: Stay updated with the latest news articles related to various metals, helping you stay informed about market developments.
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 invaluable for developers looking to integrate specific metal data into their applications.
API Endpoint Examples and Responses
Understanding the API responses is crucial for effective implementation. Below are examples of various endpoints and their corresponding JSON responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1743735673,
"base": "USD",
"date": "2025-04-04",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
This response indicates a successful query, providing the latest exchange rates for various metals, including gold (XAU).
Historical Rates Endpoint
{
"success": true,
"timestamp": 1743649273,
"base": "USD",
"date": "2025-04-03",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows how to access historical rates, allowing users to analyze past performance and trends.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-03-28",
"end_date": "2025-04-04",
"base": "USD",
"rates": {
"2025-03-28": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-03-30": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-04-04": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
The time-series endpoint is particularly useful for tracking price movements over a specified period, enabling trend analysis and forecasting.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1743735673,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response illustrates how to convert a specified amount from one currency to another, providing the result in troy ounces.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-03-28",
"end_date": "2025-04-04",
"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 prices change over time, which is essential for understanding market dynamics.
OHLC (Open/High/Low/Close) Endpoint
{
"success": true,
"timestamp": 1743735673,
"base": "USD",
"date": "2025-04-04",
"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 is crucial for traders who rely on open, high, low, and close prices for technical analysis and decision-making.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1743735673,
"base": "USD",
"date": "2025-04-04",
"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 essential information for traders looking to understand market liquidity and pricing dynamics.
Conclusion
In conclusion, the Metals-API is an invaluable resource for developers and investors interested in precious metals, particularly gold. With its comprehensive suite of endpoints, users can access real-time and historical data, enabling informed decision-making and strategic investment. By leveraging the capabilities of the Metals-API, developers can create innovative applications that harness the power of real-time metals data.
For further exploration of the API's features, be sure to check out the Metals-API Documentation for detailed implementation guides, and refer to the Metals-API Supported Symbols page for a complete list of available metal symbols. The Metals-API Website also offers additional resources and insights into the world of precious metals.