Access iShares Gold Trust (IAU) Historical Prices with Metals-API

Access iShares Gold Trust (IAU) Historical Prices with Metals-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 how to access historical prices of gold and other precious metals using the Metals-API, exploring its features, capabilities, and practical applications.
Metals-API Information
Metals-API is a powerful tool designed for developers seeking real-time and historical data on precious metals. With a focus on innovation and technological advancement, this API provides a seamless way to integrate metals data into applications, enabling users to make informed decisions based on accurate and timely information.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been regarded as a safe-haven asset and a hedge against inflation. In recent years, the digital transformation in precious metals has opened new avenues for data analytics and market insights. The integration of technology in trading has revolutionized how investors access and analyze gold prices.
With the rise of digital asset solutions, the demand for accurate and real-time data has never been higher. The Metals-API empowers developers to build next-generation applications that leverage this data for innovative price discovery and trading strategies. By utilizing the API, developers can access a wealth of information, including historical prices, fluctuations, and conversion rates, all of which are crucial for making informed investment decisions.
API Description
The Metals-API is designed to provide developers with comprehensive access to metals pricing data. It offers a variety of endpoints that cater to different needs, from retrieving the latest rates to accessing historical data dating back to 2019. The API's capabilities extend beyond mere data retrieval; it allows for the integration of real-time data into applications, enabling users to track market trends and make data-driven decisions.
For more detailed information, you can refer to the Metals-API Documentation, which outlines the various features and functionalities available through the API.
Key Features and Endpoints
The Metals-API provides several key features that enhance its usability and functionality:
- 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 to stay updated on the latest market movements.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. By appending a specific date to your query, you can retrieve historical data that is vital for trend analysis and forecasting.
- Bid And Ask Endpoint: This powerful feature enables you to retrieve real-time bid and ask prices, allowing traders to make informed decisions based on current market conditions.
- Convert Endpoint: The API includes a currency conversion endpoint, which can be used to convert any amount from one currency to another, facilitating seamless transactions across different currencies.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, providing a comprehensive view of price movements over time.
- Fluctuation Endpoint: Retrieve information about how currencies fluctuate on a day-to-day basis, which is crucial for understanding market volatility.
- Carat Endpoint: This endpoint allows you to retrieve information about gold rates by carat, catering to jewelers and consumers interested in specific gold qualities.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specified date, which is useful for identifying price extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is beneficial for those tracking industrial metals.
- API Key: Your API Key is essential for accessing the API and is passed into the base URL's access_key parameter.
- API Response: Exchange rates delivered by the Metals-API are by default relative to USD, ensuring consistency across data retrieval.
- Available Endpoints: The API comes with a constantly updated endpoint returning all available currencies, making it easy to find the data you need.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, catering to a specific market.
- News Endpoint: Stay updated with the latest news articles related to various metals, providing context to 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
Understanding the API's response structure is crucial for effective implementation. Below are examples of various endpoints and their corresponding JSON responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1742429425,
"base": "USD",
"date": "2025-03-20",
"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"
}
This response provides real-time exchange rates for various metals, with XAU representing gold. The "rates" object contains the current price per troy ounce for each metal.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1742343025,
"base": "USD",
"date": "2025-03-19",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This endpoint allows users to access historical exchange rates for a specific date, enabling trend analysis and historical comparisons.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-03-13",
"end_date": "2025-03-20",
"base": "USD",
"rates": {
"2025-03-13": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-03-15": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-03-20": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
The time-series endpoint provides a range of historical rates between two specified dates, allowing for detailed analysis of price movements over time.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1742429425,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This endpoint allows users to convert a specified amount from one metal to another or to/from USD, providing flexibility in transactions.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-03-13",
"end_date": "2025-03-20",
"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 a specified period, which is essential for understanding market dynamics.
OHLC (Open/High/Low/Close) Endpoint
{
"success": true,
"timestamp": 1742429425,
"base": "USD",
"date": "2025-03-20",
"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 technical analysis, as it provides the open, high, low, and close prices for a specific date.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1742429425,
"base": "USD",
"date": "2025-03-20",
"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 endpoint provides current bid and ask prices, which are essential for traders looking to execute orders at the best possible prices.
Conclusion
Accessing historical prices of the iShares Gold Trust (IAU) and other precious metals has never been easier, thanks to the Metals-API. With its comprehensive suite of endpoints, developers can retrieve real-time and historical data, enabling them to build sophisticated applications that leverage this information for trading, analysis, and decision-making.
By understanding the capabilities of the Metals-API, developers can harness the power of real-time metals data to create innovative solutions that meet the demands of today's fast-paced financial markets. For more information on how to get started, visit the Metals-API Website and explore the extensive Metals-API Documentation for detailed guidance on implementation and usage.