The Easiest Way to Get SPDR Gold MiniShares (GLDM) Historical Rates Using Financial APIs
The Easiest Way to Get SPDR Gold MiniShares (GLDM) Historical Rates Using Financial APIs
In the world of finance, acquiring accurate historical data for precious metals like gold is crucial for investors, traders, and analysts. One of the most efficient ways to obtain this data is through the Metals-API. This powerful API provides a comprehensive suite of tools to access real-time and historical rates for various metals, including gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD). In this blog post, we will explore how to retrieve historical prices for SPDR Gold MiniShares (GLDM) using the Metals-API, detailing the endpoints, parameters, and data formats involved.
About Gold (XAU)
Gold has always been a symbol of wealth and stability. In recent years, the digital transformation in precious metals has revolutionized how investors access and analyze market data. With the rise of data analytics and technology integration in trading, the landscape of gold investment has evolved significantly. The Metals-API stands at the forefront of this transformation, offering developers the tools to build next-generation applications that leverage real-time metals data.
By utilizing the Metals-API, developers can harness the power of innovation in price discovery and digital asset solutions. This API not only provides access to historical rates but also empowers users to analyze market trends, track fluctuations, and make informed investment decisions. Whether you are a seasoned trader or a newcomer to the market, understanding how to effectively use the Metals-API can enhance your trading strategies and insights.
API Description
The Metals-API is designed to provide developers with seamless access to a wide range of functionalities related to metals pricing. With its robust capabilities, the API allows users to retrieve real-time exchange rates, historical data, and various analytical insights. The API is structured to support multiple endpoints, each catering to specific needs, such as retrieving the latest rates, historical prices, and even bid/ask prices.
For detailed information on how to use the API, you can refer to the Metals-API Documentation. This resource provides comprehensive guidance on authentication, endpoint usage, and response formats, ensuring that developers can effectively integrate the API into their applications.
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 based on your subscription plan. Depending on your plan, you can receive updates every 60 minutes, every 10 minutes, or even more frequently.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. You can query the Metals-API for historical rates by appending a date in the format YYYY-MM-DD.
- Bid And Ask Endpoint: Retrieve real-time bid and ask prices for metals, allowing for precise trading decisions.
- Convert Endpoint: This endpoint enables you to convert any amount from one metal to another or to/from USD, facilitating easy calculations for traders.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, providing a comprehensive view of price movements over time.
- Fluctuation Endpoint: Track how currencies fluctuate on a day-to-day basis, giving you insights into market volatility.
- Carat Endpoint: Retrieve information about gold rates by carat, which is particularly useful for jewelers and consumers.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specific date.
- Open/High/Low/Close (OHLC) Price Endpoint: Get OHLC data for a specific time period, which is essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a long-term perspective on metal prices.
- API Key: Your unique API key is required to access the API, ensuring secure and authorized usage.
- API Response: The API delivers exchange rates relative to USD, with all data returned in a structured JSON format.
- Available Endpoints: The Metals-API includes 14 endpoints, each providing different functionalities tailored to user needs.
- Supported Symbols Endpoint: Access a constantly updated list of all available currencies and symbols.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping you informed about market developments.
List of Symbols
The 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 metal data into their applications.
API Endpoint Examples and Responses
To illustrate the capabilities of the Metals-API, let's explore some example endpoints and their corresponding JSON responses.
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1772680066,
"base": "USD",
"date": "2026-03-05",
"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, with gold priced at 0.000482 per troy ounce.
Historical Rates Endpoint
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1772593666,
"base": "USD",
"date": "2026-03-04",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows the historical rate for gold on March 4, 2026, providing essential data for analysis.
Time-series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2026-02-26",
"end_date": "2026-03-05",
"base": "USD",
"rates": {
"2026-02-26": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-02-28": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-03-05": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time series of gold prices over a specified period, allowing for trend analysis.
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": 1772680066,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This example illustrates how to convert USD to gold, showing that $1000 is equivalent to 0.482 troy ounces of gold.
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2026-02-26",
"end_date": "2026-03-05",
"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 gold prices fluctuated over the specified period, which is essential for traders looking to capitalize on market movements.
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1772680066,
"base": "USD",
"date": "2026-03-05",
"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 particularly useful for technical analysis, providing traders with the necessary data to make informed decisions based on price movements.
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1772680066,
"base": "USD",
"date": "2026-03-05",
"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, silver, and platinum, which are crucial for executing trades at optimal prices.
Conclusion
The Metals-API is an invaluable resource for developers and traders looking to access historical and real-time data for precious metals like gold. By leveraging its various endpoints, users can retrieve a wealth of information that aids in making informed investment decisions. From tracking fluctuations to converting currencies, the API's capabilities are extensive and versatile.
As the financial landscape continues to evolve, integrating advanced technologies and data analytics into trading strategies will be essential for success. The Metals-API not only simplifies access to critical data but also empowers developers to create innovative applications that enhance market insights.
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 implementation. Don't forget to check the Metals-API Supported Symbols page to familiarize yourself with the available metal symbols.