Obtain Franklin Responsibly Sourced Gold ETF (FGDL) prices programmatically using this API
Introduction
The Franklin Responsibly Sourced Gold ETF (FGDL) represents a significant advancement in the investment landscape, allowing investors to gain exposure to gold while ensuring ethical sourcing practices. In this blog post, we will explore how to obtain FGDL prices programmatically using the Metals-API, a powerful tool that provides real-time and historical data on precious metals, including gold. By leveraging this API, developers can create innovative applications that facilitate trading, analysis, and investment in gold and other metals.
Understanding Gold (XAU)
Gold has long been a symbol of wealth and stability, and its role in the financial markets continues to evolve. With the digital transformation of precious metals trading, data analytics and market insights have become crucial for investors. The integration of technology in trading has led to innovative approaches in price discovery, enabling investors to make informed decisions based on real-time data.
As a digital asset, gold is now more accessible than ever, thanks to solutions like the Metals-API. This API empowers developers to build next-generation applications that can analyze market trends, track price fluctuations, and provide insights into gold's performance. By utilizing the Metals-API, developers can tap into a wealth of information that can enhance their trading strategies and investment decisions.
Metals-API Overview
The Metals-API is a comprehensive JSON API that provides access to real-time and historical data for various metals, including gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD). This API is designed for developers looking to integrate metals pricing data into their applications, offering a range of endpoints that cater to different needs.
With the Metals-API, developers can access the latest rates, historical data, bid and ask prices, and much more. The API is built with innovation in mind, allowing for seamless integration and real-time data retrieval, which is essential for making timely trading decisions.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that provide different functionalities, making it a versatile tool for developers. Here are some of the key features:
Latest Rates Endpoint
The Latest Rates endpoint provides real-time exchange rate data for various metals. Depending on your subscription plan, this endpoint can return data updated every 60 minutes, every 10 minutes, or even more frequently. This feature is crucial for traders who need up-to-the-minute pricing information to make informed decisions.
{
"success": true,
"timestamp": 1785024475,
"base": "USD",
"date": "2026-07-26",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
The Historical Rates endpoint allows users to access exchange rates for any date since 1999. This is particularly useful for analyzing trends and making historical comparisons. By appending a specific date to the API request, developers can retrieve valuable historical data.
{
"success": true,
"timestamp": 1784938075,
"base": "USD",
"date": "2026-07-25",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"unit": "per troy ounce"
}
Bid And Ask Endpoint
The Bid and Ask endpoint provides real-time bid and ask prices for metals. This feature is essential for traders looking to understand market dynamics and make informed trading decisions based on current market conditions.
{
"success": true,
"timestamp": 1785024475,
"base": "USD",
"date": "2026-07-26",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
},
"XAG": {
"bid": 0.0381,
"ask": 0.0382,
"spread": 0.0001
}
},
"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 functionality is particularly useful for investors who want to understand the value of their holdings in different currencies or metals.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1785024475,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series endpoint allows users to query the API for daily historical rates between two dates of their choice. This feature is invaluable for analyzing trends over specific periods and making data-driven investment decisions.
{
"success": true,
"timeseries": true,
"start_date": "2026-07-19",
"end_date": "2026-07-26",
"base": "USD",
"rates": {
"2026-07-19": {
"XAU": 0.000485,
"XAG": 0.03825
},
"2026-07-21": {
"XAU": 0.000483,
"XAG": 0.0382
},
"2026-07-26": {
"XAU": 0.000482,
"XAG": 0.03815
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation endpoint provides information about how currencies fluctuate on a day-to-day basis. This feature is essential for traders looking to understand market volatility and make informed decisions based on price movements.
{
"success": true,
"fluctuation": true,
"start_date": "2026-07-19",
"end_date": "2026-07-26",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
}
},
"unit": "per troy ounce"
}
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price endpoint allows users to query the API for the open, high, low, and close prices for a specific time period. This data is crucial for traders who rely on candlestick patterns and other technical analysis methods.
{
"success": true,
"timestamp": 1785024475,
"base": "USD",
"date": "2026-07-26",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
}
},
"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 interested in the London Metal Exchange prices.
{
"success": true,
"timestamp": 1784938075,
"base": "USD",
"date": "2026-07-25",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825
},
"unit": "per troy ounce"
}
API Authentication and Usage
To access the Metals-API, users must obtain an API key, which is a unique identifier that is passed into the API base URL's access_key parameter. This key is essential for authenticating requests and ensuring that users have the appropriate permissions to access the data.
When making requests to the API, it is important to handle errors gracefully. The API provides detailed error messages that can help developers troubleshoot issues. Common errors include invalid API keys, exceeding rate limits, and malformed requests.
Performance Optimization and Best Practices
To ensure optimal performance when using the Metals-API, developers should consider implementing caching strategies to reduce the number of API calls. This can help minimize latency and improve the overall user experience. Additionally, developers should be mindful of rate limits and plan their API usage accordingly to avoid disruptions in service.
Security is also a critical consideration when integrating the Metals-API into applications. Developers should ensure that API keys are stored securely and not exposed in client-side code. Implementing HTTPS for all API requests is essential to protect data in transit.
Conclusion
The Metals-API is a powerful tool for developers looking to obtain real-time and historical data on precious metals, including the Franklin Responsibly Sourced Gold ETF (FGDL). By leveraging the various endpoints offered by the API, developers can create innovative applications that enhance trading strategies and provide valuable market insights. With features like real-time rates, historical data, and conversion capabilities, the Metals-API empowers developers to build next-generation financial applications.
For more information on how to get started with the Metals-API, be sure to check out the Metals-API Documentation and explore the Metals-API Supported Symbols for a comprehensive list of available metals. By utilizing this API, developers can unlock the full potential of precious metals trading and investment.