Access real-time SPDR Gold Shares (GLD) prices using this API

Access Real-Time SPDR Gold Shares (GLD) Prices Using This API
In today's fast-paced financial landscape, the ability to access real-time data is crucial for investors and developers alike. The SPDR Gold Shares (GLD) is a popular exchange-traded fund that tracks the price of gold, making it an essential asset for those looking to invest in precious metals. To facilitate this, the Metals-API provides a powerful solution for accessing real-time gold prices and other metal data. This blog post will delve into the capabilities of the Metals-API, focusing on its features, endpoints, and how it can empower developers to create innovative applications in the realm of precious metals trading.
Metals-API Information
About Gold (XAU)
Gold, represented by the symbol XAU, has long been regarded as a safe haven asset, particularly during times of economic uncertainty. The digital transformation in the precious metals market has led to an increased reliance on data analytics and market insights. With the integration of technology in trading, investors can now leverage real-time data to make informed decisions. The Metals-API plays a pivotal role in this transformation by providing developers with the tools necessary to access and analyze gold prices in real-time.
As the demand for digital asset solutions grows, the importance of innovation in price discovery becomes evident. The Metals-API not only offers real-time pricing but also historical data, allowing users to track trends and fluctuations over time. This capability is essential for traders who need to understand market dynamics and make strategic decisions based on comprehensive data analysis.
API Description
The Metals-API is designed to provide developers with seamless access to real-time metals data, including gold, silver, platinum, and palladium. The API's innovative architecture allows for rapid integration into various applications, enabling users to build next-generation trading platforms and analytical tools. With a focus on technological advancement, the Metals-API empowers developers to harness the power of real-time data to enhance their trading strategies.
One of the key advantages of the Metals-API is its ability to deliver data in a user-friendly JSON format. This makes it easy for developers to parse and utilize the data within their applications. The API supports a wide range of endpoints, each designed to cater to specific needs, from retrieving the latest rates to accessing historical data and fluctuations.
Key Features and Endpoints
The Metals-API offers a variety of endpoints, each with unique functionalities that can be leveraged for different applications. Here are some of the most notable features:
- 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 is crucial for traders who need the most current pricing information.
- Historical Rates Endpoint: Access historical rates dating back to 2019. By appending a specific date to the request, users can retrieve past pricing data, which is essential for trend analysis and forecasting.
- Bid And Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices, providing insights into market liquidity and helping traders make informed decisions.
- Convert Endpoint: The conversion endpoint enables users to convert any amount from one metal to another or to/from USD, facilitating easy calculations for traders dealing with multiple currencies.
- Time-Series Endpoint: Users can query the API for daily historical rates between two dates of their choice, allowing for detailed analysis of price movements over time.
- Fluctuation Endpoint: This endpoint provides information about how currencies fluctuate on a day-to-day basis, helping traders understand market volatility.
- Carat Endpoint: Retrieve information about gold rates by carat, which is particularly useful for jewelers and those in the jewelry industry.
- Lowest/Highest Price Endpoint: Users can query the API to get the lowest and highest prices for a specified date, aiding in market analysis and decision-making.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific time period, which is vital for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is beneficial for users interested in long-term trends.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate access to the API.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API provides a comprehensive list of available endpoints, each designed for specific functionalities.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, ensuring users have access to the latest information.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for regional traders.
- News Endpoint: Stay updated with the latest news articles related to various metals, helping traders stay 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 ensures that developers can easily find the symbols they need for 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, showcasing their functionality and the structure of their responses.
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1747015220,
"base": "USD",
"date": "2025-05-12",
"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"
}
The response includes a success flag, a timestamp, the base currency, the date of the rates, and the rates for each metal. This structure allows developers to easily parse the data and integrate it into their applications.
Historical Rates Endpoint
Access historical exchange rates for any date since 1999.
{
"success": true,
"timestamp": 1746928820,
"base": "USD",
"date": "2025-05-11",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This endpoint is particularly useful for traders looking to analyze historical trends and make predictions based on past performance.
Time-series Endpoint
Get exchange rates for a specific time period.
{
"success": true,
"timeseries": true,
"start_date": "2025-05-05",
"end_date": "2025-05-12",
"base": "USD",
"rates": {
"2025-05-05": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-05-07": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-05-12": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This endpoint allows users to analyze price movements over a specified period, providing valuable insights into market trends.
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": 1747015220,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
The convert endpoint simplifies the process of calculating values across different metals, making it easier for traders to manage their portfolios.
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-05",
"end_date": "2025-05-12",
"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 endpoint is particularly useful for understanding market volatility and making informed trading decisions based on price changes.
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period.
{
"success": true,
"timestamp": 1747015220,
"base": "USD",
"date": "2025-05-12",
"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"
}
OHLC data is essential for technical analysis, allowing traders to assess market trends and make predictions based on historical performance.
Bid/Ask Endpoint
Get current bid and ask prices for metals.
{
"success": true,
"timestamp": 1747015220,
"base": "USD",
"date": "2025-05-12",
"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 endpoint provides critical information for traders looking to execute orders at the best possible prices.
Conclusion
The Metals-API is an invaluable resource for developers and traders looking to access real-time SPDR Gold Shares (GLD) prices and other precious metals data. With its extensive range of endpoints and capabilities, the API empowers users to build sophisticated applications that leverage real-time data for informed decision-making. By integrating the Metals-API into trading platforms, developers can enhance their applications with features such as historical data analysis, price conversion, and fluctuation tracking.
As the market for precious metals continues to evolve, the importance of reliable and accurate data cannot be overstated. The Metals-API stands at the forefront of this digital transformation, providing the tools necessary for developers to create innovative solutions in the world of trading. For more information on how to get started, visit the Metals-API Documentation and explore the full range of features available.