Obtain abrdn Physical Gold Shares ETF (SGOL) Historical Prices via this API

Obtain abrdn Physical Gold Shares ETF (SGOL) Historical Prices via this API
In the ever-evolving landscape of financial technology, the demand for real-time data and analytics has never been greater, especially in the realm of precious metals. One of the most sought-after assets in this category is gold, represented by the symbol XAU. For developers and financial analysts looking to obtain historical prices for the abrdn Physical Gold Shares ETF (SGOL), the Metals-API offers a robust solution. This blog post will delve into the capabilities of the Metals-API, focusing on how to access historical prices and explore the transformative potential of real-time metals data.
Metals-API Information
The Metals-API is a powerful tool designed for developers who require accurate and timely data on precious metals. It provides a comprehensive suite of endpoints that allow users to access real-time and historical data, making it an invaluable resource for anyone involved in trading or analyzing metals. The API is built with innovation in mind, integrating advanced technology to deliver market insights that can drive decision-making processes.
About Gold (XAU)
Gold has long been considered a safe haven asset, especially during times of economic uncertainty. Its value is influenced by various factors, including market demand, geopolitical events, and currency fluctuations. The digital transformation in precious metals trading has opened new avenues for investors and developers alike. With the integration of data analytics and technology, traders can now leverage real-time insights to make informed decisions.
One of the key innovations in this space is the use of APIs to access market data. The Metals-API allows developers to build applications that can analyze gold prices, track trends, and provide insights into market movements. This level of integration not only enhances trading strategies but also empowers users to discover price fluctuations and trends that were previously difficult to track.
API Description
The Metals-API is designed to provide developers with the tools they need to create next-generation applications. It offers a variety of endpoints that cater to different data needs, from real-time rates to historical data. The API's capabilities include:
- 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 feature is crucial for traders who need to stay updated on the latest market conditions.
- Historical Rates Endpoint: Users can access historical rates for most currencies dating back to 2019. By appending a specific date to the API request, developers can retrieve historical price data, which is essential for trend analysis and forecasting.
- Bid And Ask Endpoint: This powerful feature enables users to retrieve real-time bid and ask prices, providing insights into market liquidity and pricing dynamics.
- 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 is particularly useful for traders dealing in multiple currencies.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two dates of their choice, facilitating in-depth analysis of price movements over time.
- Fluctuation Endpoint: Users can track how currencies fluctuate on a day-to-day basis, providing valuable insights into market volatility.
- Carat Endpoint: This feature allows users to retrieve information about gold rates by carat, catering to specific market needs.
- Lowest/Highest Price Endpoint: Users can query the API to get the lowest and highest prices for a specified date, which is crucial for understanding market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, allowing traders to analyze market performance comprehensively.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is essential for users interested in long-term trends.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate access to the API.
- API Response: Exchange rates are delivered relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API offers 14 different endpoints, each providing unique functionalities tailored to various user needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies, ensuring users have access to the latest symbol information.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, catering to regional market needs.
- News Endpoint: Stay updated with the latest news articles related to various metals, providing context to market movements.
Key Features and Endpoints
The Metals-API's endpoints are designed to cater to a wide range of use cases, making it an essential tool for developers. Here are some examples of how these endpoints can be utilized:
Latest Rates Endpoint
The Latest Rates Endpoint provides real-time exchange rates for all available metals. For instance, a typical response might look like this:
{
"success": true,
"timestamp": 1757268081,
"base": "USD",
"date": "2025-09-07",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
This response indicates the current price of gold (XAU) and other metals relative to USD, allowing traders to make quick decisions based on the latest market data.
Historical Rates Endpoint
Accessing historical exchange rates is crucial for trend analysis. The Historical Rates Endpoint allows users to retrieve data for any date since 1999. An example response might be:
{
"success": true,
"timestamp": 1757181681,
"base": "USD",
"date": "2025-09-06",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This data is invaluable for analysts looking to understand how gold prices have changed over time.
Time-Series Endpoint
The Time-Series Endpoint allows users to query the API for daily historical rates between two dates. For example:
{
"success": true,
"timeseries": true,
"start_date": "2025-08-31",
"end_date": "2025-09-07",
"base": "USD",
"rates": {
"2025-08-31": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-09-02": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-09-07": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This endpoint is particularly useful for visualizing trends and making data-driven predictions.
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. For example:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1757268081,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This feature is essential for traders who need to calculate the equivalent value of their investments across different currencies.
Fluctuation Endpoint
The Fluctuation Endpoint tracks rate fluctuations between two dates. An example response might look like this:
{
"success": true,
"fluctuation": true,
"start_date": "2025-08-31",
"end_date": "2025-09-07",
"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 endpoint provides insights into market volatility, helping traders understand price movements over time.
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price Endpoint provides open, high, low, and close prices for a specific date. For example:
{
"success": true,
"timestamp": 1757268081,
"base": "USD",
"date": "2025-09-07",
"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 data is crucial for traders looking to analyze market performance and make informed decisions based on historical data.
Bid/Ask Endpoint
The Bid/Ask Endpoint provides current bid and ask prices for metals. An example response might be:
{
"success": true,
"timestamp": 1757268081,
"base": "USD",
"date": "2025-09-07",
"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 is essential for traders who need to understand market liquidity and pricing dynamics.
Common Developer Questions
As developers begin to integrate the Metals-API into their applications, they may have several common questions:
How do I authenticate my API requests?
Authentication is done using an API key that you receive upon signing up for the Metals-API. This key must be included in the access_key parameter of your API requests.
What are the rate limits for API requests?
Rate limits vary based on your subscription plan. It is important to check the documentation for specific limits to avoid exceeding your quota.
How do I handle errors in API responses?
The Metals-API provides detailed error messages in the response. It is crucial to implement error handling in your application to manage these responses effectively.
Can I cache API responses?
Caching can significantly improve performance, especially for endpoints that do not change frequently. However, ensure that you respect the API's rate limits and update your cache regularly.
Conclusion
The Metals-API is a powerful resource for developers looking to access real-time and historical data on precious metals, particularly gold. With its comprehensive suite of endpoints, users can obtain the information they need to make informed trading decisions. By leveraging the capabilities of the Metals-API, developers can build innovative applications that provide valuable insights into market trends and price movements.
For more information on how to get started with the Metals-API, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols to understand the full range of available data. The transformative potential of real-time metals data is at your fingertips, enabling you to create applications that can redefine how traders interact with the market.