Fetch daily GraniteShares Gold Trust (BAR) prices using this API

Fetch Daily GraniteShares Gold Trust (BAR) Prices Using This API
GraniteShares Gold Trust (BAR) is a popular investment vehicle for those looking to gain exposure to gold without the complexities of physical ownership. To effectively track the performance of BAR and other precious metals, developers can leverage the Metals-API, a powerful tool designed to provide real-time and historical data on various metals, including gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD).
Metals-API Information
Metals-API is a comprehensive solution that empowers developers to build applications that require accurate and timely metals pricing data. With its robust features, the API enables users to integrate real-time market insights into their applications, facilitating informed decision-making in trading and investment strategies.
About Gold (XAU)
API Description
Key Features and Endpoints
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently. This ensures that users have access to the most current pricing information.
- Historical Rates Endpoint: Users can access historical rates for most currencies dating back to 2019. By appending a specific date to the API call, developers can retrieve past pricing data, which is essential for trend analysis and forecasting.
- Bid And Ask Endpoint: This powerful feature allows 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 feature, enabling users to convert any amount from one metal to another or to/from USD. This is particularly useful for traders operating in multiple currencies.
- Time-Series Endpoint: Developers can query the API for daily historical rates between two dates of their choice, allowing for in-depth analysis of price movements over time.
- Fluctuation Endpoint: This endpoint provides information about how metals fluctuate on a day-to-day basis, helping traders understand market volatility.
- Carat Endpoint: Users can retrieve information about gold rates by carat, which is essential for jewelers and those involved in the jewelry market.
- Lowest/Highest Price Endpoint: This feature allows users to query the API to get the lowest and highest price for a specified date range, providing insights into market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific time period, which is crucial for technical analysis.
- Historical LME Endpoint: Users can access historical rates for LME symbols dating back to 2008, which is beneficial for those trading in industrial metals.
- API Key: Each user is provided with a unique API key that must be included in API requests to authenticate access.
- 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 constantly updated endpoint returns all available currencies, allowing developers to stay informed about the latest offerings.
- Gold Price India Endpoint: Users can retrieve the latest gold price in India using this dedicated endpoint, catering to regional market needs.
- News Endpoint: The API allows users to retrieve the latest news articles related to various metals, keeping traders informed about market developments.
API Endpoint Examples and Responses
Latest Rates Endpoint
{
"success": true,
"timestamp": 1753416064,
"base": "USD",
"date": "2025-07-25",
"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
{
"success": true,
"timestamp": 1753329664,
"base": "USD",
"date": "2025-07-24",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-Series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-07-18",
"end_date": "2025-07-25",
"base": "USD",
"rates": {
"2025-07-18": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-07-20": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-07-25": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1753416064,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-07-18",
"end_date": "2025-07-25",
"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
{
"success": true,
"timestamp": 1753416064,
"base": "USD",
"date": "2025-07-25",
"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
{
"success": true,
"timestamp": 1753416064,
"base": "USD",
"date": "2025-07-25",
"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
Metals-API is an invaluable resource for developers seeking to integrate real-time metals pricing into their applications. With its extensive features, including the latest rates, historical data, and various endpoints, the API empowers users to make informed trading decisions based on accurate and timely information.
Metals-API Documentation and explore the Metals-API Supported Symbols to understand the full range of available data. Embrace the future of trading with the Metals-API and unlock the potential of real-time metals data.