Retrieve Gold Continuous Contract (GC00) Historical Prices with this API

Retrieve Gold Continuous Contract (GC00) Historical Prices with 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 Gold Continuous Contract (GC00) is a vital instrument for traders and investors looking to capitalize on fluctuations in gold prices. To effectively retrieve historical prices for this contract, developers can leverage the capabilities of the Metals-API. This powerful API provides a comprehensive suite of tools for accessing real-time and historical data on various metals, including gold, silver, platinum, and palladium.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been regarded as a safe haven asset and a hedge against inflation. In recent years, the digital transformation of precious metals trading has opened new avenues for investors and traders alike. The integration of data analytics and technology into trading strategies has revolutionized how market participants approach gold investments.
With the rise of digital asset solutions, the ability to access real-time market insights has become crucial. The Metals-API provides developers with the tools necessary to harness this data, enabling them to build innovative applications that can analyze market trends, track price movements, and make informed trading decisions. The API's capabilities extend beyond mere price retrieval; it empowers users to discover new opportunities in the gold market through advanced data analytics.
API Description
The Metals-API is designed to provide developers with seamless access to real-time and historical metals data. By utilizing this API, developers can create next-generation applications that leverage the transformative potential of real-time data. The API supports a variety of endpoints, each tailored to meet specific data retrieval needs.
One of the standout features of the Metals-API is its ability to deliver real-time exchange rates for various metals, updated at intervals that depend on the user's subscription plan. This ensures that traders have access to the most current market data, allowing them to make timely decisions. Additionally, the API offers historical rates dating back to 2019, enabling users to analyze past performance and identify trends.
Key Features and Endpoints
The Metals-API boasts a range of features that cater to the diverse needs of developers and traders. Here are some of the key endpoints and their functionalities:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated every 60 minutes, every 10 minutes, or even more frequently, depending on the subscription plan. This feature is essential for traders who require up-to-the-minute pricing information.
- Historical Rates Endpoint: Users can access historical rates for most metals dating back to 2019. By appending a specific date to the API request, developers can retrieve past prices, which is invaluable for trend analysis and backtesting trading strategies.
- Bid And Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices for 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 currency conversion endpoint, enabling users to convert any amount from one metal to another or to/from USD. This is particularly useful for traders dealing with multiple currencies.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two specified dates. This feature is ideal for analyzing price movements over time and identifying patterns.
- Fluctuation Endpoint: Users can track how metal prices fluctuate between two dates. This endpoint provides insights into daily price changes, helping traders understand market volatility.
- Carat Endpoint: This unique feature allows users to retrieve information about gold rates by carat. This is particularly relevant 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 range. This information is crucial for traders looking to identify potential entry points.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides users with the open, high, low, and close prices for a specific date. This data is essential for technical analysis and charting.
- Historical LME Endpoint: For those interested in LME symbols, this endpoint provides historical rates dating back to 2008, allowing for comprehensive analysis of metal prices.
- API Key: Each user is assigned a unique API key, which must be included in the API requests to authenticate access.
- API Response: The Metals-API returns exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The API offers a wide range of 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 users have access to the latest information.
- Gold Price India Endpoint: Users can retrieve the latest gold price in India using this dedicated endpoint, catering to regional market needs.
- News Endpoint: The Metals-API also offers a news endpoint, allowing users to access the latest news articles related to various metals, providing context to market movements.
API Endpoint Examples and Responses
To illustrate the capabilities of the Metals-API, here are some example responses for key endpoints:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1745812966,
"base": "USD",
"date": "2025-04-28",
"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 a successful request, providing the latest exchange rates for various metals, including gold (XAU).
Historical Rates Endpoint
{
"success": true,
"timestamp": 1745726566,
"base": "USD",
"date": "2025-04-27",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example demonstrates how to retrieve historical rates for gold and other metals, allowing users to analyze past performance.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-04-21",
"end_date": "2025-04-28",
"base": "USD",
"rates": {
"2025-04-21": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-04-23": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-04-28": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time series of exchange rates for gold, allowing users to track price movements over a specified period.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1745812966,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This example illustrates how to convert a specified amount from USD to gold (XAU), providing the result in troy ounces.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-04-21",
"end_date": "2025-04-28",
"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 a specified period, highlighting both the absolute and percentage changes.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1745812966,
"base": "USD",
"date": "2025-04-28",
"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 provides essential data for traders, showing the open, high, low, and close prices for gold and other metals, which is critical for technical analysis.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1745812966,
"base": "USD",
"date": "2025-04-28",
"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, allowing traders to assess market conditions and make informed decisions.
Conclusion
The Metals-API is an invaluable resource for developers and traders seeking to access real-time and historical data on precious metals, particularly gold. By utilizing the various endpoints offered by the API, users can retrieve critical information that aids in making informed trading decisions. From real-time rates to historical data and advanced features like bid/ask pricing and fluctuations, the Metals-API empowers users to harness the full potential of the gold market.
As the digital transformation of precious metals continues, the integration of technology and data analytics will play a pivotal role in shaping the future of trading. Developers can leverage the capabilities of the Metals-API to create innovative applications that provide market insights, enhance trading strategies, and ultimately drive success in the competitive world of precious metals trading.
For more information on how to get started with the Metals-API, refer to the Metals-API Documentation and explore the comprehensive list of supported symbols at the Metals-API Supported Symbols page. Embrace the future of trading with the power of real-time metals data at your fingertips.