Retrieve SPDR Gold Shares (GLD) Historical Prices with this API

Retrieve SPDR Gold Shares (GLD) Historical Prices with this API
In the world of finance, the ability to access and analyze historical prices of assets is crucial for making informed investment decisions. One of the most sought-after assets is gold, represented by the SPDR Gold Shares (GLD). With the rise of digital transformation in precious metals trading, developers now have access to powerful tools that can provide real-time and historical data. One such tool is the Metals-API, which offers a comprehensive solution for retrieving historical prices and other valuable insights related to gold and other metals.
About Gold (XAU)
Gold, denoted by the symbol XAU, has long been a symbol of wealth and a safe haven asset during times of economic uncertainty. As the digital landscape evolves, the integration of technology in trading has transformed how investors interact with this precious metal. The digital transformation in precious metals has led to enhanced data analytics and market insights, allowing traders to make more informed decisions based on real-time data.
With the advent of APIs like Metals-API, developers can harness the power of technology to innovate in price discovery and create digital asset solutions that cater to the needs of modern investors. The ability to access historical prices, analyze trends, and integrate this data into trading platforms has revolutionized the way gold is traded and valued.
API Description
The Metals-API is a robust API that provides developers with access to real-time and historical data for various metals, including gold, silver, platinum, and palladium. This API empowers developers to build next-generation applications that can leverage real-time metals data for trading, analysis, and reporting. With its innovative features and capabilities, Metals-API stands out as a leader in the field of metals data.
One of the key advantages of using Metals-API is its ability to deliver real-time exchange rate data updated at varying intervals, depending on the subscription plan. This means that developers can access the latest market rates for gold and other metals, ensuring that their applications are always up-to-date with the most accurate information.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs when it comes to accessing metals data. Here are some of the most notable features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated every 60 minutes, every 10 minutes, or even more frequently, depending on the subscription plan. This feature is essential for traders who need to make quick decisions based on the latest market conditions.
- Historical Rates Endpoint: Developers can access historical rates for most currencies dating back to 2019. By appending a specific date to the API request, users can retrieve historical prices for gold and other metals, 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 Metals-API includes a currency conversion endpoint, allowing users to convert any amount from one metal to another or to/from USD. This feature is particularly useful for traders who operate in multiple currencies.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two dates of their choice. This is invaluable for conducting trend analysis and understanding price movements over specific periods.
- Fluctuation Endpoint: Users can track how metals fluctuate on a day-to-day basis using this endpoint, which provides detailed information about rate changes over specified periods.
- Carat Endpoint: This unique feature allows users to retrieve information about gold rates by carat, catering to jewelers and consumers 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 metals over a specified period, providing insights into market volatility.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can access OHLC data for a specific time period, which is essential for technical analysis and understanding market trends.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, allowing for comprehensive analysis of historical market data.
- API Key: Each user is assigned a unique API key that must be included in API requests to authenticate and authorize access to the data.
- API Response: The Metals-API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format for easy integration into applications.
- Available Endpoints: The API offers a wide range of endpoints, each providing different functionalities to cater to various user needs.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies and metals, ensuring users have access to the latest symbols.
- Gold Price India Endpoint: Users can retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for investors in the Indian market.
- News Endpoint: The Metals-API includes a news endpoint that allows users to retrieve the latest news articles related to various metals, keeping them informed about market developments.
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. This resource is invaluable for developers looking to integrate specific metals into their applications.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for developers. Below are examples of various endpoints and their JSON responses, which illustrate the data structure and the information provided.
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1747440328,
"base": "USD",
"date": "2025-05-17",
"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
Access historical exchange rates for any date since 1999.
{
"success": true,
"timestamp": 1747353928,
"base": "USD",
"date": "2025-05-16",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-series Endpoint
Get exchange rates for a specific time period.
{
"success": true,
"timeseries": true,
"start_date": "2025-05-10",
"end_date": "2025-05-17",
"base": "USD",
"rates": {
"2025-05-10": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-05-12": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-05-17": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Convert Endpoint
Convert any amount from one metal to another or to/from USD.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1747440328,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-10",
"end_date": "2025-05-17",
"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) Endpoint
Get OHLC data for a specific time period.
{
"success": true,
"timestamp": 1747440328,
"base": "USD",
"date": "2025-05-17",
"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
Get current bid and ask prices for metals.
{
"success": true,
"timestamp": 1747440328,
"base": "USD",
"date": "2025-05-17",
"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
In conclusion, the ability to retrieve historical prices for SPDR Gold Shares (GLD) using the Metals-API opens up a world of possibilities for developers and traders alike. With its comprehensive suite of features, including real-time rates, historical data, and advanced endpoints for analysis, Metals-API is an invaluable resource for anyone looking to integrate precious metals data into their applications.
As the landscape of precious metals trading continues to evolve, leveraging APIs like Metals-API will be essential for staying ahead of market trends and making informed investment decisions. Whether you are a developer building a trading platform or an investor seeking insights into gold prices, the Metals-API provides the tools necessary to succeed in this dynamic market.
For more information on how to get started, refer to the Metals-API Documentation and explore the extensive capabilities of this powerful API. With the right tools and data at your fingertips, you can unlock the potential of precious metals trading and make data-driven decisions that enhance your investment strategies.