Obtain GraniteShares Gold Trust (BAR) Historical Prices from this API
Introduction
The GraniteShares Gold Trust (BAR) has emerged as a significant player in the realm of gold investment, providing investors with a unique opportunity to gain exposure to the price of gold through a simple and efficient exchange-traded fund (ETF). One of the critical aspects of investing in BAR is understanding its historical price movements, which can be effectively accessed through the Metals-API. This API offers a wealth of data regarding precious metals, including real-time and historical prices, which can empower developers to create innovative applications that analyze market trends and provide valuable insights into gold trading.
Understanding Gold (XAU)
Gold has long been regarded as a safe-haven asset, particularly during times of economic uncertainty. Its value is influenced by various factors, including geopolitical events, inflation rates, and currency fluctuations. In recent years, the digital transformation in precious metals has opened new avenues for investors and traders alike. With the integration of advanced data analytics and technology, market participants can now leverage real-time data to make informed decisions.
As the demand for digital asset solutions grows, the importance of having access to accurate and timely market data cannot be overstated. The Metals-API provides developers with the tools necessary to harness this data, enabling them to build next-generation applications that can enhance trading strategies and improve price discovery.
Metals-API Overview
The Metals-API is a powerful JSON API that provides comprehensive access to metals prices and currency conversion. It is designed to cater to the needs of developers looking to integrate real-time and historical metals data into their applications. With a wide range of endpoints, the API allows users to retrieve various types of data, including the latest rates, historical prices, and fluctuations over time.
One of the standout features of the Metals-API is its ability to deliver real-time exchange rate data, which is updated frequently based on the user's subscription plan. This capability is crucial for traders who need to react quickly to market changes. Additionally, the API supports a variety of metals, including gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD), among others, making it a versatile tool for anyone involved in the precious metals market.
Key Features of Metals-API
The Metals-API offers a variety of endpoints that provide different functionalities, each designed to meet specific needs of developers and traders. Below are some of the key features:
Latest Rates Endpoint
The Latest Rates endpoint is essential for obtaining real-time exchange rate data for various metals. Depending on the subscription plan, users can receive updates every 60 minutes, every 10 minutes, or even more frequently. This endpoint is particularly useful for traders who require up-to-the-minute information to make quick decisions.
{
"success": true,
"timestamp": 1787012244,
"base": "USD",
"date": "2026-08-18",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
For those interested in analyzing past performance, the Historical Rates endpoint allows users to access historical exchange rates for most currencies dating back to 2019. By appending a specific date to the API request, developers can retrieve valuable historical data that can be used for trend analysis and forecasting.
{
"success": true,
"timestamp": 1786925844,
"base": "USD",
"date": "2026-08-17",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"unit": "per troy ounce"
}
Bid And Ask Endpoint
The Bid and Ask endpoint is a powerful feature that enables users to retrieve real-time bid and ask prices for various metals. This information is crucial for traders looking to execute buy or sell orders at the best possible prices. The bid price represents the highest price a buyer is willing to pay, while the ask price is the lowest price a seller is willing to accept.
{
"success": true,
"timestamp": 1787012244,
"base": "USD",
"date": "2026-08-18",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
},
"XAG": {
"bid": 0.0381,
"ask": 0.0382,
"spread": 0.0001
}
},
"unit": "per troy ounce"
}
Convert Endpoint
The Convert endpoint allows users to convert any amount from one metal to another or to/from USD. This feature is particularly useful for traders who need to quickly assess the value of their holdings in different currencies or metals.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1787012244,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series endpoint allows users to query the API for daily historical rates between two dates of their choice. This feature is invaluable for conducting in-depth analyses of price movements over specific periods, enabling traders to identify patterns and make informed decisions based on historical data.
{
"success": true,
"timeseries": true,
"start_date": "2026-08-11",
"end_date": "2026-08-18",
"base": "USD",
"rates": {
"2026-08-11": {
"XAU": 0.000485,
"XAG": 0.03825
},
"2026-08-18": {
"XAU": 0.000482,
"XAG": 0.03815
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation endpoint provides insights into how currencies fluctuate on a day-to-day basis. By tracking rate changes between two dates, traders can better understand market volatility and adjust their strategies accordingly.
{
"success": true,
"fluctuation": true,
"start_date": "2026-08-11",
"end_date": "2026-08-18",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
}
},
"unit": "per troy ounce"
}
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price endpoint allows users to retrieve the open, high, low, and close prices for a specific time period. This data is essential for technical analysis, as it provides a comprehensive view of price movements within a given timeframe.
{
"success": true,
"timestamp": 1787012244,
"base": "USD",
"date": "2026-08-18",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
}
},
"unit": "per troy ounce"
}
Historical LME Endpoint
The Historical LME endpoint provides access to historical rates for LME symbols dating back to 2008. This endpoint is particularly useful for traders interested in the London Metal Exchange prices, allowing them to analyze historical trends and make informed trading decisions.
List of Supported 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 metals into their applications.
API Response Explanation
Understanding the API responses is crucial for developers looking to utilize the Metals-API effectively. Each response contains several fields that provide essential information:
- success: Indicates whether the API request was successful.
- timestamp: The time at which the data was retrieved.
- base: The base currency for the exchange rates.
- date: The date for which the rates are applicable.
- rates: An object containing the exchange rates for various metals.
- unit: The unit of measurement for the rates (typically per troy ounce).
By analyzing these fields, developers can extract valuable insights and integrate them into their applications for enhanced functionality.
Common Use Cases
There are numerous practical applications for the Metals-API, particularly for developers working in finance and trading:
- Market Analysis Tools: Developers can create applications that analyze historical price trends and provide insights into market movements.
- Trading Bots: By integrating real-time data, developers can build automated trading systems that execute trades based on predefined criteria.
- Portfolio Management: Applications can be developed to track the performance of gold investments, helping investors make informed decisions.
Conclusion
In conclusion, the GraniteShares Gold Trust (BAR) presents a compelling opportunity for investors looking to gain exposure to gold. By leveraging the capabilities of the Metals-API, developers can access a wealth of historical and real-time data that can enhance trading strategies and provide valuable market insights. With features such as the Latest Rates, Historical Rates, and Bid and Ask endpoints, the API empowers developers to create innovative applications that can transform the way traders interact with the gold market. As the digital landscape continues to evolve, the integration of advanced data analytics and technology will play a pivotal role in shaping the future of precious metals trading.