Access GraniteShares Gold Trust (BAR) Exchange Rates for API Performance Monitoring in JSON Format
Access GraniteShares Gold Trust (BAR) Exchange Rates for API Performance Monitoring in JSON Format
In the ever-evolving landscape of financial technology, the ability to access real-time exchange rates for precious metals is crucial for developers and traders alike. The GraniteShares Gold Trust (BAR) is a popular investment vehicle that allows investors to gain exposure to gold without the complexities of physical ownership. By leveraging the Metals-API, developers can seamlessly integrate exchange rate data for BAR and other metals into their applications, enhancing performance monitoring and decision-making processes.
Metals-API Information
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a cornerstone of financial markets. As digital transformation reshapes the landscape of precious metals trading, the integration of data analytics and market insights becomes increasingly vital. The Metals-API provides developers with the tools to harness technology for innovative price discovery and trading strategies. By utilizing real-time data, developers can create applications that offer digital asset solutions, enabling investors to make informed decisions based on accurate market information.
API Description
The Metals-API is a powerful tool that offers real-time and historical data for various metals, including gold, silver, platinum, and palladium. With its robust capabilities, the API empowers developers to build next-generation applications that can monitor market trends, analyze fluctuations, and provide insights into precious metals trading. The API's transformative potential lies in its ability to deliver real-time data, allowing users to stay ahead in a fast-paced market environment.
For detailed information on how to get started, refer to the Metals-API Documentation, which outlines the various endpoints and their functionalities.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs, ensuring that developers have access to comprehensive data for their applications. Here are some key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently, depending on your subscription plan. This feature is essential for applications that require up-to-the-minute pricing information.
- Historical Rates Endpoint: Developers can access historical rates dating back to 2019 by appending a specific date (YYYY-MM-DD) to the API call. This functionality is crucial for analyzing market trends over time.
- Bid And Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices, which are essential for traders looking to execute orders at optimal prices.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, enabling users to convert amounts between different metals or to/from USD. This is particularly useful for applications that require multi-currency support.
- Time-Series Endpoint: This endpoint allows users to query daily historical rates between two specified dates, providing insights into price movements over time.
- Fluctuation Endpoint: Users can track how currencies fluctuate on a day-to-day basis, which is vital for understanding market volatility.
- Carat Endpoint: This feature provides information about gold rates by carat, allowing for precise calculations in jewelry and other applications.
- Lowest/Highest Price Endpoint: Developers can query the API to find the lowest and highest prices for a specified date, which is useful for identifying market 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 users interested in long-term trends.
- API Key: Each user is assigned a unique API key that must be included in the API requests to authenticate access.
- API Response: The Metals-API returns exchange rates relative to USD by default, ensuring consistency in data presentation.
- Available Endpoints: With 14 different API endpoints, developers have a wide range of functionalities at their disposal.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, allowing developers to stay informed about the latest offerings.
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
To retrieve real-time exchange rates for all available metals, you can use the Latest Rates Endpoint. Here’s an example of a typical response:
{
"success": true,
"timestamp": 1783048065,
"base": "USD",
"date": "2026-07-03",
"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"
}
In this response, the "rates" object contains the exchange rates for various metals against the base currency (USD). Each metal is represented by its symbol, and the value indicates the rate per troy ounce.
Historical Rates Endpoint
Accessing historical exchange rates is straightforward. Here’s an example response for a specific date:
{
"success": true,
"timestamp": 1782961665,
"base": "USD",
"date": "2026-07-02",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response provides historical rates for gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD) for the specified date, allowing for effective market analysis.
Time-series Endpoint
The Time-series Endpoint allows users to get exchange rates for a specific time period. Here’s an example:
{
"success": true,
"timeseries": true,
"start_date": "2026-06-26",
"end_date": "2026-07-03",
"base": "USD",
"rates": {
"2026-06-26": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-06-28": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-07-03": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time series of exchange rates for the specified period, allowing developers to analyze trends and fluctuations over time.
Convert Endpoint
The Convert Endpoint is useful for converting amounts between different metals or to/from USD. Here’s an example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1783048065,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response indicates that 1000 USD is equivalent to 0.482 troy ounces of gold (XAU) based on the current exchange rate.
Fluctuation Endpoint
Tracking rate fluctuations is essential for understanding market dynamics. Here’s an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2026-06-26",
"end_date": "2026-07-03",
"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"
}
This response provides insights into how the rates for gold, silver, and platinum have changed over the specified period, including both absolute and percentage changes.
OHLC (Open/High/Low/Close) Price Endpoint
For technical analysis, the OHLC Price Endpoint provides essential data. Here’s an example:
{
"success": true,
"timestamp": 1783048065,
"base": "USD",
"date": "2026-07-03",
"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 response provides the opening, highest, lowest, and closing prices for gold, silver, and platinum, which are critical for traders looking to make informed decisions based on market movements.
Bid/Ask Endpoint
Finally, the Bid/Ask Endpoint provides current bid and ask prices for metals. Here’s an example response:
{
"success": true,
"timestamp": 1783048065,
"base": "USD",
"date": "2026-07-03",
"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 response provides the bid and ask prices for gold, silver, and platinum, along with the spread, which is essential for traders looking to execute trades efficiently.
Conclusion
Accessing exchange rates for the GraniteShares Gold Trust (BAR) through the Metals-API offers developers a powerful tool for performance monitoring and market analysis. With a comprehensive suite of endpoints, including the Latest Rates, Historical Rates, and Bid/Ask features, developers can create applications that provide real-time insights into precious metals trading. By leveraging this API, developers can enhance their applications with accurate data, enabling users to make informed investment decisions.
For more information on how to implement these features, visit the Metals-API Documentation and explore the Metals-API Supported Symbols page for a complete list of available symbols. By integrating these capabilities into your applications, you can stay ahead in the competitive landscape of precious metals trading.