Fetch SPDR Gold MiniShares (GLDM) Historical Prices with this API

Fetch SPDR Gold MiniShares (GLDM) Historical Prices with this API
In the ever-evolving landscape of financial technology, the demand for accurate and real-time data has never been more critical, especially in the precious metals market. One of the most sought-after assets is gold, represented by the symbol XAU. For developers looking to integrate historical price data for SPDR Gold MiniShares (GLDM), the Metals-API offers a robust solution. This blog post will delve into the capabilities of the Metals-API, focusing on how to fetch historical prices for gold and explore the innovative features that make this API a powerful tool for developers.
About Gold (XAU)
Gold has long been regarded as 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. As digital transformation sweeps across industries, the precious metals market is also experiencing a shift. The integration of data analytics and technology in trading has revolutionized how investors and developers approach gold trading.
With the rise of digital asset solutions, the ability to access real-time data and historical prices is crucial for making informed decisions. The Metals-API provides developers with the tools needed to harness this data effectively. By leveraging advanced analytics, developers can gain insights into market trends, optimize trading strategies, and enhance price discovery processes.
API Description
The Metals-API is a powerful JSON API that provides real-time and historical data for various metals, including gold, silver, platinum, and palladium. It empowers developers to build next-generation applications that require accurate and timely metals data. The API's capabilities extend beyond mere data retrieval; it offers innovative features that facilitate seamless integration into existing systems.
With the Metals-API, developers can access a wide range of endpoints designed to cater to different needs. Whether you are looking for the latest rates, historical prices, or conversion capabilities, the Metals-API has you covered. The API is designed to be user-friendly, with comprehensive documentation available at the Metals-API Documentation page.
Key Features and Endpoints
The Metals-API boasts several key features that enhance its functionality and usability. Here are some of the most notable endpoints and their applications:
- 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 essential for developers who need up-to-the-minute pricing information to make timely trading decisions.
- Historical Rates Endpoint: Historical rates are available for most currencies dating back to 2019. Developers can query the Metals-API for historical rates by appending a specific date to the endpoint. This is particularly useful for analyzing trends over time and making data-driven investment decisions.
- Bid And Ask Endpoint: This powerful feature enables you to retrieve real-time bid and ask prices for various metals. Depending on your subscription plan, this data can help traders understand market dynamics and make informed decisions.
- 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 invaluable for traders who operate in multiple currencies.
- Time-Series Endpoint: This endpoint allows developers to query the API for daily historical rates between two dates of their choice. It is particularly useful for creating visualizations and reports that require historical data analysis.
- Fluctuation Endpoint: Using this endpoint, developers can retrieve information about how metals fluctuate on a day-to-day basis. This data can help traders identify patterns and make predictions about future price movements.
- Carat Endpoint: This endpoint provides information about gold rates by carat. It is particularly useful for jewelers and traders dealing in different purities of gold.
- Lowest/Highest Price Endpoint: Developers can query the API to get the lowest and highest price for a specified date range. This feature is essential for understanding market volatility and making strategic trading decisions.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint allows users to retrieve the open, high, low, and close prices for a specific time period. It is crucial for technical analysis and understanding market trends.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008. It is particularly useful for developers working with industrial metals.
- API Key: Your API Key is a unique identifier that must be passed into the API base URL's access_key parameter. This key is essential for authenticating requests and ensuring secure access to the API.
- API Response: Exchange rates delivered by the Metals-API are by default relative to USD. All data is returned in a structured JSON format, making it easy to parse and integrate into applications.
- Available Endpoints: The Metals-API offers a variety of endpoints, each providing different functionalities. Developers can explore these endpoints to find the ones that best suit their needs.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies and metals supported by the API. Developers can refer to this list to ensure they are using the correct symbols.
- Gold Price India Endpoint: This dedicated endpoint allows users to retrieve the latest gold price in India, catering to a specific market segment.
- News Endpoint: The Metals-API includes a news endpoint that retrieves the latest articles related to various metals, providing users with valuable insights into market trends and 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 understand the various metals available for trading and analysis.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for developers. Below are examples of various API endpoints, including their expected responses:
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1752055285,
"base": "USD",
"date": "2025-07-09",
"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": 1751968885,
"base": "USD",
"date": "2025-07-08",
"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-07-02",
"end_date": "2025-07-09",
"base": "USD",
"rates": {
"2025-07-02": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-07-04": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-07-09": {
"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": 1752055285,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2025-07-02",
"end_date": "2025-07-09",
"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": 1752055285,
"base": "USD",
"date": "2025-07-09",
"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": 1752055285,
"base": "USD",
"date": "2025-07-09",
"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 Metals-API provides a comprehensive and innovative solution for developers seeking to access historical prices and real-time data for precious metals, particularly gold. By leveraging the various endpoints offered by the API, developers can create powerful applications that enhance trading strategies, optimize decision-making processes, and provide valuable insights into market trends.
As the financial landscape continues to evolve, the importance of accurate and timely data cannot be overstated. The Metals-API stands out as a reliable resource for developers looking to integrate metals data into their applications. For more information, explore the Metals-API Documentation and start building your next project today!