Retrieve SPDR Gold MiniShares (GLDM) Historical Prices through this API

Retrieve SPDR Gold MiniShares (GLDM) Historical Prices through this API
In the ever-evolving landscape of financial markets, the demand for accurate and timely data is paramount, especially when it comes to precious metals like gold. The SPDR Gold MiniShares (GLDM) is an investment vehicle that allows investors to gain exposure to gold prices without the complexities of physical ownership. To effectively track and analyze the historical prices of GLDM, developers can leverage the capabilities of the Metals-API, a robust tool designed for accessing real-time and historical metals data.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a cornerstone of wealth preservation and investment. As the world transitions into a digital economy, the integration of technology in trading and investment strategies has become increasingly vital. The digital transformation in precious metals trading is not just about convenience; it’s about harnessing data analytics to derive market insights that can inform investment decisions.
With the rise of digital asset solutions, investors are now able to access real-time data and analytics that were previously reserved for institutional players. The Metals-API plays a crucial role in this transformation by providing developers with the tools necessary to build next-generation applications that can analyze gold price trends, perform historical comparisons, and even forecast future movements based on past data.
API Description
The Metals-API is a powerful JSON API that offers a wide range of functionalities for accessing metals prices and performing currency conversions. It empowers developers to create applications that can provide real-time insights into the metals market, including gold, silver, platinum, and palladium. The API’s capabilities extend beyond mere price retrieval; it allows for comprehensive data analysis, which is essential for making informed trading decisions.
One of the standout features of the Metals-API is its ability to deliver real-time data updates. Depending on your subscription plan, the API can provide exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently. This level of granularity is crucial for traders who rely on timely information to make split-second decisions in volatile markets.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different data needs. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for various metals, allowing developers to access the most current prices. For instance, a request to this endpoint might return the latest gold price in USD, enabling applications to display up-to-date market information.
- Historical Rates Endpoint: Historical rates are available for most currencies dating back to 2019. By appending a specific date to the API request, developers can retrieve past gold prices, which is essential for trend analysis and backtesting trading strategies.
- Bid And Ask Endpoint: This feature allows users to retrieve real-time bid and ask prices for gold and other metals. Understanding the bid-ask spread is crucial for traders looking to optimize their entry and exit points.
- Convert Endpoint: The Metals-API includes a conversion feature that enables users to convert amounts between different metals or from/to USD. This is particularly useful for investors who want 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. This feature is invaluable for conducting detailed analyses over specific time frames.
- Fluctuation Endpoint: Users can track how metal prices fluctuate over time, providing insights into market volatility and helping traders make informed decisions based on historical price movements.
- Carat Endpoint: This endpoint provides information about gold rates by carat, which is essential for jewelers and consumers interested in the value of gold jewelry.
- Lowest/Highest Price Endpoint: This feature allows users to query the API for the lowest and highest prices of gold over a specified period, helping traders identify potential entry points.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides the open, high, low, and close prices for gold, which are critical for technical analysis.
- Historical LME Endpoint: For those interested in London Metal Exchange (LME) symbols, this endpoint provides historical rates dating back to 2008.
- API Key: To access the Metals-API, users must include their unique API key in the request. This key is essential for authentication and tracking usage.
- API Response: The API returns exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API features multiple endpoints, each designed to fulfill specific data retrieval needs.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available metal symbols, ensuring developers can access the most current data.
- Gold Price India Endpoint: For users interested in the Indian market, this endpoint retrieves the latest gold prices in India.
- News Endpoint: The Metals-API also offers a news feature that provides the latest articles related to various metals, keeping users informed about market trends and developments.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for developers. Below are examples of how to utilize various endpoints effectively:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1748624416,
"base": "USD",
"date": "2025-05-30",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
This response indicates the latest prices for various metals, including gold (XAU), which is essential for real-time trading applications.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1748538016,
"base": "USD",
"date": "2025-05-29",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows how to retrieve historical prices for gold, which can be used for analysis and reporting.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-05-23",
"end_date": "2025-05-30",
"base": "USD",
"rates": {
"2025-05-23": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-05-25": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-05-30": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time-series view of gold prices, allowing for detailed trend analysis over the specified period.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1748624416,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This example illustrates how to convert a monetary amount into gold ounces, which is useful for investors assessing their holdings.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-23",
"end_date": "2025-05-30",
"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 metal prices fluctuate over time, which is critical for traders looking to capitalize on market movements.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1748624416,
"base": "USD",
"date": "2025-05-30",
"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 is essential for traders who rely on technical analysis, providing the necessary data to identify trends and reversals.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1748624416,
"base": "USD",
"date": "2025-05-30",
"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 current bid and ask prices for gold, which is crucial for executing trades at optimal prices.
Conclusion
The Metals-API is an invaluable resource for developers looking to integrate precious metals data into their applications. By providing access to real-time and historical prices, as well as a suite of powerful endpoints, the API enables the creation of sophisticated trading tools and analytics platforms. Whether you are tracking the SPDR Gold MiniShares (GLDM) or analyzing market trends, the Metals-API offers the data and flexibility needed to succeed in today's fast-paced financial environment.
For more information on how to get started with the Metals-API, be sure to check out the Metals-API Documentation and explore the comprehensive Metals-API Supported Symbols list. With the right tools and data at your fingertips, you can unlock the full potential of precious metals trading.