How to Get Refined Gold Futures (FXGL) Historical Prices with an API
Introduction
In the world of trading and investment, understanding how to get refined gold futures (FXGL) historical prices is crucial for making informed decisions. With the rise of digital transformation in the precious metals market, developers now have access to powerful tools that can provide real-time and historical data. One such tool is the Metals-API, which offers comprehensive access to metals data, including gold. This blog post will delve into how to utilize the Metals-API to retrieve historical prices for refined gold futures, exploring its features, capabilities, and practical applications.
Metals-API Information
About Gold (XAU)
Gold, represented by the symbol XAU, is one of the most sought-after precious metals in the world. Its value is influenced by various factors, including market demand, geopolitical stability, and economic indicators. As the market evolves, the integration of technology in trading has become increasingly important. The Metals-API provides developers with the tools necessary to harness data analytics and market insights, allowing for innovative approaches to price discovery and trading strategies.
API Description
The Metals-API is a robust JSON API that provides real-time and historical data for various metals, including gold, silver, platinum, and palladium. This API empowers developers to build next-generation applications that can analyze market trends, track price fluctuations, and convert currencies seamlessly. By leveraging the capabilities of the Metals-API, developers can create applications that offer insights into market dynamics, helping traders make data-driven decisions.
For more detailed information on how to implement the API, refer to the Metals-API Documentation.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs. Here are some of the key features:
Latest Rates Endpoint
The Latest Rates 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. This feature is essential for traders who require up-to-the-minute pricing information to make timely decisions.
{
"success": true,
"timestamp": 1787012048,
"base": "USD",
"date": "2026-08-18",
"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
For those interested in analyzing past performance, the Historical Rates Endpoint allows you to access exchange rates for most currencies dating back to 2019. By appending a specific date in the format YYYY-MM-DD, you can retrieve historical data that is invaluable for trend analysis and forecasting.
{
"success": true,
"timestamp": 1786925648,
"base": "USD",
"date": "2026-08-17",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Bid and Ask Endpoint
The Bid and Ask Endpoint is a powerful feature that enables you to retrieve real-time bid and ask prices for metals. This information is crucial for traders looking to execute buy or sell orders at the best possible prices.
{
"success": true,
"timestamp": 1787012048,
"base": "USD",
"date": "2026-08-18",
"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"
}
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. This feature is particularly useful for traders who need to quickly assess the value of their holdings in different currencies.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1787012048,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series Endpoint allows you to query the API for daily historical rates between two dates of your choice. This is particularly useful for analyzing trends over specific periods, making it easier to identify patterns and make predictions.
{
"success": true,
"timeseries": true,
"start_date": "2026-08-11",
"end_date": "2026-08-18",
"base": "USD",
"rates": {
"2026-08-11": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-08-13": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-08-18": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation Endpoint provides insights into how currencies fluctuate on a day-to-day basis. This feature is essential for traders who want to understand market volatility and make informed decisions based on price movements.
{
"success": true,
"fluctuation": true,
"start_date": "2026-08-11",
"end_date": "2026-08-18",
"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"
}
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price Endpoint allows you to query the API for the open, high, low, and close prices for a specific time period. This data is vital for traders who rely on technical analysis to make trading decisions.
{
"success": true,
"timestamp": 1787012048,
"base": "USD",
"date": "2026-08-18",
"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"
}
Historical LME Endpoint
The Historical LME Endpoint provides access to historical rates for LME symbols dating back to 2008. This endpoint is particularly useful for traders who are interested in the London Metal Exchange prices.
API Key and Authentication
To access the Metals-API, you will need an API Key, which is a unique identifier passed into the API base URL's access_key parameter. This key is essential for authentication and ensures that only authorized users can access the data.
API Response
The exchange rates delivered by the Metals-API are by default relative to USD. All data is returned in a structured JSON format, making it easy to parse and integrate into your applications. Understanding the structure of the API response is crucial for effective data handling.
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.
Conclusion
In conclusion, the Metals-API is a powerful tool for developers looking to access refined gold futures (FXGL) historical prices and other precious metals data. By leveraging its various endpoints, developers can create applications that provide real-time insights, historical analysis, and innovative trading solutions. The API's capabilities, such as the Latest Rates, Historical Rates, and Bid/Ask endpoints, empower traders to make informed decisions based on accurate and timely data. For those interested in exploring the full potential of the Metals-API, be sure to check out the Metals-API Documentation for detailed implementation guidance and best practices.