Get SPDR Gold Shares (GLD) Historical Prices to Enhance Your Investment Strategies using this API
Get SPDR Gold Shares (GLD) Historical Prices to Enhance Your Investment Strategies using this API
In the world of investment, having access to accurate and timely data is crucial for making informed decisions. For those interested in precious metals, particularly gold, the SPDR Gold Shares (GLD) offers a unique opportunity to invest in gold without the need to physically own the metal. To enhance your investment strategies, obtaining historical prices for GLD is essential, and this is where the Metals-API comes into play. This powerful API provides developers with the tools needed to access real-time and historical data on various metals, including gold, enabling them to build sophisticated applications that can analyze market trends and inform trading strategies.
Metals-API Information
About Gold (XAU)
Gold, represented by the symbol XAU, has long been considered a safe haven asset and a hedge against inflation. As digital transformation continues to reshape the financial landscape, the integration of technology in trading precious metals has become increasingly important. The Metals-API allows developers to harness the power of data analytics and market insights to create innovative solutions for price discovery and investment strategies.
With the rise of digital asset solutions, investors can now access gold prices in real-time, analyze historical trends, and make data-driven decisions. The Metals-API empowers developers to build applications that not only track gold prices but also provide insights into market fluctuations, enabling users to optimize their investment strategies effectively.
API Description
The Metals-API is a comprehensive solution for accessing metals prices and currency conversion data. It offers a wide range of endpoints that cater to various needs, from retrieving the latest rates to accessing historical data. This API is designed with innovation and technological advancement in mind, providing developers with the tools necessary to create next-generation applications that leverage real-time metals data.
For detailed information on how to use the API, developers can refer to the Metals-API Documentation, which outlines the capabilities and functionalities of each endpoint. Additionally, the Metals-API Supported Symbols page provides a comprehensive list of all available metal symbols, including XAU for gold.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that can be utilized for different purposes. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated according to your subscription plan. Depending on the plan, updates can occur every 60 minutes or every 10 minutes, ensuring that users have access to the most current market information.
- 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 for gold, allowing for in-depth analysis of price trends over time.
- Bid And Ask Endpoint: This powerful feature enables 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 endpoint, allowing users to convert amounts from one metal to another or to/from USD. This is particularly useful for investors looking to assess the value of their holdings in different currencies.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two specified dates, making it easier to analyze trends and fluctuations over specific periods.
- Fluctuation Endpoint: Users can track how metal prices fluctuate on a day-to-day basis, providing valuable insights into market volatility and helping investors make informed decisions.
- Carat Endpoint: This feature allows users to retrieve information about gold rates by carat, which is essential for jewelers and investors interested in specific gold purity levels.
- Lowest/Highest Price Endpoint: This endpoint enables users to query the API for the lowest and highest prices of gold over a specified period, helping investors identify potential entry and exit points.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can access open, high, low, and close prices for gold, providing a comprehensive view of market performance over time.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, allowing for extensive analysis of market trends.
- API Key: To access the API, users must obtain a unique API key, which is passed into the API base URL's access_key parameter. This key is essential for authentication and authorization.
- API Response: The Metals-API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format, making it easy for developers to integrate into their applications.
- Available Endpoints: The API features 14 endpoints, each providing different functionalities, ensuring that developers have the tools they need to build comprehensive applications.
- News Endpoint: This endpoint allows users to retrieve the latest news articles related to various metals, keeping investors informed about market developments.
API Endpoint Examples and Responses
Understanding the structure of API responses is crucial for developers. Below are examples of various API endpoints and their corresponding JSON responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1766708056,
"base": "USD",
"date": "2025-12-26",
"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 indicates that the API successfully retrieved the latest rates for various metals, including gold (XAU), which is priced at 0.000482 per troy ounce.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1766621656,
"base": "USD",
"date": "2025-12-25",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows a successful response from the Historical Rates Endpoint, providing the historical price of gold for a specific date.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-12-19",
"end_date": "2025-12-26",
"base": "USD",
"rates": {
"2025-12-19": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-12-21": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-12-26": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
The Time-series Endpoint provides a detailed view of gold prices over a specified period, allowing for trend analysis and forecasting.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1766708056,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response illustrates the conversion of 1000 USD to gold (XAU), resulting in 0.482 troy ounces.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-12-19",
"end_date": "2025-12-26",
"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 gold prices have changed over a specified period, which is essential for understanding market dynamics.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1766708056,
"base": "USD",
"date": "2025-12-26",
"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 provides a comprehensive view of the open, high, low, and close prices for gold, which is critical for traders looking to analyze market performance.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1766708056,
"base": "USD",
"date": "2025-12-26",
"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"
}
The Bid/Ask Endpoint provides current bid and ask prices for metals, which is essential for traders looking to execute orders at the best possible prices.
Conclusion
In conclusion, the Metals-API is an invaluable resource for developers and investors looking to enhance their investment strategies in precious metals, particularly gold. By leveraging the API's extensive features, including real-time and historical data access, developers can create sophisticated applications that provide insights into market trends and price fluctuations. The ability to retrieve data through various endpoints, such as the Latest Rates, Historical Rates, and Fluctuation endpoints, empowers users to make informed decisions based on accurate and timely information.
As the financial landscape continues to evolve with digital transformation, integrating technology into trading strategies is more important than ever. The Metals-API not only facilitates this integration but also opens up new possibilities for innovation in price discovery and market analysis. For more information on how to get started with the Metals-API, visit the Metals-API Website and explore the Metals-API Documentation for detailed guidance on utilizing its features effectively.