The Easiest Way to Get Gold Feb 2027 (GCG27) Historical Rates Using REST API
The Easiest Way to Get Gold Feb 2027 (GCG27) Historical Rates Using REST API
In the ever-evolving landscape of precious metals trading, having access to accurate and timely data is crucial for making informed decisions. The Metals-API provides a powerful REST API that allows developers to retrieve historical prices for various metals, including gold (XAU). In this blog post, we will explore how to effectively use the Metals-API to obtain historical gold prices, focusing on the capabilities of the API, example endpoints, parameters, and data formats.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a symbol of wealth and stability. In recent years, the digital transformation in precious metals has opened new avenues for trading and investment. With the integration of data analytics and market insights, traders can now leverage technology to enhance their trading strategies. The innovation in price discovery and the emergence of digital asset solutions have made it easier than ever to access real-time data and historical trends.
The Metals-API stands at the forefront of this transformation, empowering developers to build next-generation applications that can analyze and visualize gold price movements. By utilizing the API, developers can create tools that provide insights into market trends, helping traders make data-driven decisions.
API Description
The Metals-API is a comprehensive solution for accessing metals prices and currency conversion data. It offers a range of endpoints that cater to various needs, from retrieving the latest rates to accessing historical data dating back to 2019. The API is designed to be user-friendly, with clear documentation available at the Metals-API Documentation.
One of the standout features of the Metals-API is its ability to provide real-time exchange rate data, which is updated frequently based on the subscription plan. This capability is essential for traders who need to stay informed about market fluctuations. Additionally, the API supports a variety of symbols, including gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD). For a complete list of supported symbols, you can visit the Metals-API Supported Symbols page.
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 all available metals. Depending on your subscription plan, the API can return data updated every 60 minutes or even more frequently.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. You can query the API by appending a specific date to retrieve the historical price of gold.
- Bid And Ask Endpoint: This feature allows you to retrieve real-time bid and ask prices for metals, providing insights into market liquidity.
- Convert Endpoint: The API includes a currency conversion endpoint that enables you to convert any amount from one metal to another or to/from USD.
- Time-Series Endpoint: This endpoint allows you to query the API for daily historical rates between two dates of your choice, making it easier to analyze trends over time.
- Fluctuation Endpoint: Retrieve information about how currencies fluctuate on a day-to-day basis, which is vital for understanding market volatility.
- Carat Endpoint: Get information about gold rates by carat, which is particularly useful for jewelers and traders dealing in different purities of gold.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specific date, helping traders identify price extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is useful for traders focused on industrial metals.
- API Key: Your API key is essential for authentication and must be included in the API requests to access the data.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping you informed about market developments.
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": 1771201447,
"base": "USD",
"date": "2026-02-16",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1771115047,
"base": "USD",
"date": "2026-02-15",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-Series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2026-02-09",
"end_date": "2026-02-16",
"base": "USD",
"rates": {
"2026-02-09": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-02-11": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-02-16": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
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": 1771201447,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2026-02-09",
"end_date": "2026-02-16",
"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
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1771201447,
"base": "USD",
"date": "2026-02-16",
"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
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1771201447,
"base": "USD",
"date": "2026-02-16",
"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
The Metals-API is an invaluable resource for developers looking to access historical gold prices and other metal data. By leveraging the various endpoints, developers can create powerful applications that provide insights into market trends and facilitate informed trading decisions. The API's capabilities, including real-time data, historical rates, and conversion features, make it a versatile tool for anyone involved in precious metals trading.
For more information on how to get started with the Metals-API, visit the Metals-API Website and explore the detailed Metals-API Documentation. With the right tools and data at your fingertips, you can navigate the complexities of the metals market with confidence.