Access SPDR Gold MiniShares (GLDM) Historical Prices utilizing this API

Access SPDR Gold MiniShares (GLDM) Historical Prices Utilizing this API
Metals-API. This blog post will delve into the intricacies of accessing historical prices for GLDM using the Metals-API, while also exploring the broader implications of digital transformation in the precious metals market.
Metals-API Information
About Gold (XAU)
API Description
Metals-API Documentation, developers can easily navigate the API's features and implement them in their projects.
Key Features and Endpoints
- Latest Rates Endpoint: This endpoint returns real-time exchange rate data for metals, updated based on your subscription plan. Depending on the plan, updates can occur every 60 minutes, every 10 minutes, or even more frequently. This feature is crucial for traders who need to make quick decisions based on the latest market data.
- 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. Understanding the bid-ask spread is essential for traders looking to optimize their entry and exit points.
- Convert Endpoint: The Metals-API includes a dedicated currency conversion endpoint, allowing users to convert any amount from one metal to another or to/from USD. This feature 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. By analyzing time-series data, developers can identify trends and patterns that inform investment decisions.
- Fluctuation Endpoint: Users can track how metal prices fluctuate on a day-to-day basis using this endpoint. Understanding price fluctuations is vital for traders looking to capitalize on short-term market movements.
- Carat Endpoint: This feature provides information about gold rates by carat, allowing users to assess the value of gold based on its purity. This is particularly relevant for jewelers and investors in the jewelry market.
- Lowest/Highest Price Endpoint: Users can query the API to get the lowest and highest prices for a specified date, providing insights into market volatility and price extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint allows users to retrieve the open, high, low, and close prices for a specific date, which is essential for technical analysis and trading strategies.
- Historical LME Endpoint: For those interested in LME symbols, this endpoint provides historical rates dating back to 2008, offering a wealth of data for analysis.
- API Key: Each user is assigned a unique API key, which must be included in the API requests to authenticate access. This ensures secure and controlled access to the API's features.
- API Response: The Metals-API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format. Understanding the response structure is crucial for developers to effectively parse and utilize the data.
- Available Endpoints: The Metals-API features a comprehensive list of endpoints, each designed to provide specific functionalities. Developers can explore these endpoints to find the ones that best suit their needs.
- Supported Symbols Endpoint: This endpoint returns a constantly updated list of all available metal symbols, ensuring that developers have access to the latest information.
- Gold Price India Endpoint: For those interested in the Indian market, this endpoint retrieves the latest gold price in India, providing localized insights for investors.
- News Endpoint: The Metals-API allows users to retrieve the latest news articles related to various metals, keeping investors informed about market developments.
API Endpoint Examples and Responses
Latest Rates Endpoint
{
"success": true,
"timestamp": 1749099667,
"base": "USD",
"date": "2025-06-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"
}
Historical Rates Endpoint
{
"success": true,
"timestamp": 1749013267,
"base": "USD",
"date": "2025-06-04",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-Series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-05-29",
"end_date": "2025-06-05",
"base": "USD",
"rates": {
"2025-05-29": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-05-31": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-06-05": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1749099667,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-29",
"end_date": "2025-06-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"
}
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1749099667,
"base": "USD",
"date": "2025-06-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"
}
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1749099667,
"base": "USD",
"date": "2025-06-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"
}
Conclusion
Metals-API Documentation for detailed information on each endpoint and its functionalities. Additionally, the Metals-API Supported Symbols page provides a comprehensive list of available metal symbols, ensuring that developers have access to the latest data. By embracing these innovative tools, developers can unlock new opportunities in the precious metals market and contribute to the ongoing evolution of trading technologies.