Retrieve iShares Gold Trust (IAU) Historical Prices with this API

Retrieve iShares Gold Trust (IAU) Historical Prices with this API
The iShares Gold Trust (IAU) is a popular investment vehicle for those looking to gain exposure to the price of gold without the complexities of physical ownership. For developers and analysts interested in tracking the historical prices of IAU, the Metals-API offers a robust solution. This blog post will delve into the capabilities of the Metals-API, focusing on how to retrieve historical prices for gold (XAU) and explore the broader implications of digital transformation in the precious metals market.
Metals-API Information
The Metals-API is a powerful tool designed to provide real-time and historical data on various metals, including gold, silver, platinum, and palladium. With its user-friendly interface and comprehensive documentation, developers can easily integrate this API into their applications to access critical market data. The API supports a wide range of functionalities, including retrieving the latest rates, historical prices, and even performing currency conversions.
About Gold (XAU)
Gold has long been considered a safe haven asset, especially during times of economic uncertainty. As the world undergoes digital transformation, the way we trade and analyze precious metals is evolving. The integration of data analytics and technology in trading has opened new avenues for market insights and price discovery. Developers can leverage the Metals-API to access real-time data, enabling them to build innovative applications that provide users with the latest market trends and insights.
One of the most significant advancements in the precious metals market is the use of digital asset solutions. These solutions not only streamline the trading process but also enhance transparency and security. By utilizing the Metals-API, developers can create applications that offer users a seamless experience in tracking gold prices, analyzing historical trends, and making informed investment decisions.
API Description
The Metals-API is designed with innovation in mind, providing developers with the tools necessary to build next-generation applications. It offers a wide array of endpoints that cater to different needs, from retrieving the latest rates to accessing historical data. The API empowers developers to create applications that can analyze market trends, track fluctuations, and provide valuable insights into the precious metals market.
For more information, visit the Metals-API Website or check out the Metals-API Documentation for detailed guidance on implementation.
Key Features and Endpoints
The Metals-API offers several key features that make it an invaluable resource for developers:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint provides real-time exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently. This allows developers to access the most current market data for gold and other metals.
- Historical Rates Endpoint: Historical rates are available for most currencies dating back to 2019. By appending a specific date to the API request, developers can retrieve historical prices for gold (XAU) and analyze trends over time.
- Bid And Ask Endpoint: This powerful feature enables users to retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The API includes a currency conversion endpoint, allowing developers to convert any amount from one currency to another, facilitating transactions and analysis.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two dates of their choice, making it easy to analyze price movements over specific periods.
- Fluctuation Endpoint: Developers can track how currencies fluctuate on a day-to-day basis, providing insights into market volatility and trends.
- Carat Endpoint: This feature allows users to retrieve information about gold rates by carat, which is particularly useful for jewelers and consumers interested in gold jewelry.
- Lowest/Highest Price Endpoint: This endpoint enables users to query the API to get the lowest and highest price for a specified date, helping investors identify market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, allowing for detailed market analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a comprehensive view of market trends.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate access to the API.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API offers a variety of endpoints, each providing different functionalities tailored to user needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies, allowing developers to stay updated on the symbols they can use.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, catering to regional market needs.
- News Endpoint: Stay informed with the latest news articles related to various metals, providing context and insights into market movements.
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.
API Endpoint Examples and Responses
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1748635215,
"base": "USD",
"date": "2025-05-30",
"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"
}
Historical Rates Endpoint
Access historical exchange rates for any date since 1999.
{
"success": true,
"timestamp": 1748548815,
"base": "USD",
"date": "2025-05-29",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-series Endpoint
Get exchange rates for a specific time period.
{
"success": true,
"timeseries": true,
"start_date": "2025-05-23",
"end_date": "2025-05-30",
"base": "USD",
"rates": {
"2025-05-23": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-05-25": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-05-30": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Convert Endpoint
Convert any amount from one metal to another or to/from USD.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1748635215,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-23",
"end_date": "2025-05-30",
"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"
}
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period.
{
"success": true,
"timestamp": 1748635215,
"base": "USD",
"date": "2025-05-30",
"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"
}
Bid/Ask Endpoint
Get current bid and ask prices for metals.
{
"success": true,
"timestamp": 1748635215,
"base": "USD",
"date": "2025-05-30",
"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"
}
Conclusion
The Metals-API provides a comprehensive solution for developers looking to access historical prices and real-time data for precious metals, including gold (XAU). By leveraging the various endpoints offered by the API, developers can create innovative applications that enhance market analysis and investment strategies. The integration of technology in the precious metals market is transforming how traders and investors interact with data, making it essential for developers to stay informed about the latest tools and resources available.
For those interested in exploring the capabilities of the Metals-API further, I encourage you to visit the Metals-API Documentation for detailed guidance on implementation and usage. Additionally, the Metals-API Supported Symbols page provides a comprehensive list of all available symbols, ensuring you have the information needed to make the most of this powerful API.
In conclusion, the ability to retrieve historical prices for the iShares Gold Trust (IAU) through the Metals-API not only empowers developers but also enhances the overall trading experience for users. As the market continues to evolve, embracing these technological advancements will be crucial for success in the precious metals space.