Get iShares Gold Trust (IAU) Historical Prices using this API

Get iShares Gold Trust (IAU) Historical Prices using this API
In the world of finance, particularly in precious metals trading, having access to accurate and timely data is crucial for making informed decisions. One of the most sought-after assets is gold, represented by the symbol XAU. For developers looking to integrate gold price data into their applications, the Metals-API offers a robust solution. This blog post will explore how to retrieve historical prices for the iShares Gold Trust (IAU) using the Metals-API, focusing on its capabilities, features, and practical applications.
Metals-API Information
The Metals-API is a powerful tool that provides real-time and historical data for various metals, including gold, silver, platinum, and palladium. It is designed to empower developers to build next-generation applications that require precise metals data. With the rise of digital transformation in the precious metals market, the Metals-API stands out by offering innovative data analytics and market insights that can significantly enhance trading strategies.
About Gold (XAU)
Gold has long been a symbol of wealth and stability. In recent years, the digital transformation in precious metals has led to the integration of advanced technologies in trading. The Metals-API plays a pivotal role in this transformation by providing developers with the tools needed to access real-time and historical gold prices. By leveraging data analytics, traders can gain valuable market insights, enabling them to make informed decisions based on historical trends and current market conditions.
Moreover, the integration of technology in trading has revolutionized price discovery. The Metals-API allows developers to access various endpoints that provide detailed information about gold prices, including fluctuations, historical rates, and even conversion rates between different currencies. This level of detail is essential for traders who need to stay ahead in a competitive market.
API Description
The Metals-API is designed to provide developers with a comprehensive suite of tools for accessing metals data. Its capabilities include real-time exchange rates, historical data retrieval, and various endpoints that cater to different needs. The API empowers developers to create applications that can analyze trends, track fluctuations, and convert currencies seamlessly.
For more detailed information, you can refer to the Metals-API Documentation, which outlines all available features and endpoints. Additionally, a complete list of supported symbols can be found on the Metals-API Supported Symbols page.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different data needs. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated every 60 minutes, 10 minutes, or even more frequently, depending on your subscription plan. This feature is essential for traders who need to make quick decisions based on the latest market conditions.
- 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 and other metals, allowing for in-depth analysis of price trends over time.
- Bid And Ask Endpoint: This powerful feature enables users to retrieve real-time bid and ask prices for metals. Understanding the bid-ask spread is crucial for traders looking to optimize their trading strategies.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, allowing users to convert any amount from one metal to another or to/from USD. This feature is particularly useful for traders dealing with multiple currencies.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two dates of their choice. It is invaluable for analyzing trends and making predictions based on historical data.
- Fluctuation Endpoint: Users can track how metal prices fluctuate on a day-to-day basis. This endpoint provides insights into market volatility, helping traders make informed decisions.
- Carat Endpoint: This feature allows users to retrieve information about gold rates by carat. It is particularly useful for jewelers and traders dealing with different purities of gold.
- Lowest/Highest Price Endpoint: This endpoint allows users to query the API to get the lowest and highest price for a specified date, providing insights into market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can retrieve open, high, low, and close prices for a specific date, which is essential for technical analysis.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, allowing for comprehensive analysis of market trends.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate and authorize access to the API.
- API Response: The Metals-API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The API offers a wide range of endpoints, each designed to provide specific functionalities, ensuring that developers have access to the data they need.
- Gold Price India Endpoint: This dedicated endpoint allows users to retrieve the latest gold price in India, catering to a specific market segment.
- News Endpoint: Users can access the latest news articles related to various metals, keeping them informed about market developments.
API Endpoint Examples and Responses
Understanding the API responses is crucial for developers looking to integrate the Metals-API into their applications. Below are examples of various endpoints and their corresponding JSON responses.
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1748426417,
"base": "USD",
"date": "2025-05-28",
"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": 1748340017,
"base": "USD",
"date": "2025-05-27",
"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-21",
"end_date": "2025-05-28",
"base": "USD",
"rates": {
"2025-05-21": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-05-23": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-05-28": {
"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": 1748426417,
"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-21",
"end_date": "2025-05-28",
"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) Price Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1748426417,
"base": "USD",
"date": "2025-05-28",
"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": 1748426417,
"base": "USD",
"date": "2025-05-28",
"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
In conclusion, the Metals-API provides a comprehensive solution for developers looking to access historical prices for the iShares Gold Trust (IAU) and other precious metals. With its wide range of endpoints, including the latest rates, historical rates, and fluctuation tracking, developers can build powerful applications that leverage real-time and historical data. The API's capabilities not only enhance trading strategies but also facilitate better decision-making through data analytics and market insights.
For those interested in integrating this powerful API into their applications, the Metals-API Documentation is an invaluable resource. Additionally, the Metals-API Supported Symbols page provides a comprehensive list of available symbols, ensuring that developers have all the information they need at their fingertips. By harnessing the transformative potential of real-time metals data, developers can create innovative solutions that meet the demands of today's dynamic market.