Step-by-step guide to get Sprott ESG Gold ETF (SESG) prices with this API
Step-by-step guide to get Sprott ESG Gold ETF (SESG) prices with this API
In the world of finance, the ability to access real-time data is crucial for making informed decisions. This is especially true for precious metals like gold, which have long been considered a safe haven for investors. In this blog post, we will explore the Sprott ESG Gold ETF (SESG) and how you can leverage the Metals-API to obtain accurate and timely prices for gold and other precious metals.
Metals-API Information
The Metals-API is a powerful tool that provides developers with access to real-time and historical data for various metals, including gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD). This API is designed to facilitate the integration of metal price data into applications, enabling developers to create innovative solutions for trading, investment analysis, and market insights.
About Gold (XAU)
Gold has always held a significant place in the financial markets. With the digital transformation of trading and investment strategies, the demand for real-time data analytics has surged. The Metals-API empowers developers to harness the power of technology to gain insights into gold prices and market trends. By integrating this API, developers can create applications that not only track current prices but also analyze historical data to identify patterns and make predictions.
Moreover, the API facilitates innovation in price discovery, allowing users to access various endpoints that provide detailed information about gold prices, fluctuations, and market trends. This level of access enables traders and investors to make data-driven decisions, optimizing their strategies in a rapidly changing market environment.
API Description
The Metals-API offers a range of capabilities that are essential for developers looking to build next-generation applications. With its real-time data delivery and comprehensive historical data, the API provides a robust foundation for any application that requires accurate metal pricing information.
For more information on how to get started, you can refer to the Metals-API Documentation, which outlines the various features and endpoints available.
Key Features and Endpoints
The Metals-API includes several key features that enhance its functionality:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated every 60 minutes or more frequently depending on your subscription plan. This feature is essential for traders who need to stay updated on the latest market conditions.
- Historical Rates Endpoint: Access historical rates dating back to 2019. By appending a specific date to your query, you can retrieve past prices, which is invaluable for trend analysis and forecasting.
- Bid And Ask Endpoint: This feature allows you to retrieve real-time bid and ask prices for metals, providing insight into market liquidity and pricing dynamics.
- Convert Endpoint: Easily convert amounts from one metal to another or to/from USD. This endpoint simplifies transactions and calculations for users dealing with multiple currencies.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice. This is particularly useful for analyzing price movements over specific periods.
- Fluctuation Endpoint: Retrieve information about how metal prices fluctuate on a day-to-day basis. This feature helps users understand market volatility and make informed trading decisions.
- Carat Endpoint: Get information about gold rates by carat, which is essential for jewelers and consumers interested in purchasing gold jewelry.
- Lowest/Highest Price Endpoint: Query the API to find the lowest and highest prices for a specific metal over a given period, aiding in market analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: Access detailed price data, including open, high, low, and close prices for a specific date, which is crucial for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a comprehensive view of market trends.
- API Key: Your unique API key is essential for accessing the API and must be included in your requests.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: With 14 different endpoints, the Metals-API offers a wide range of functionalities to meet various user needs.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available currencies and metals, ensuring users have access to the latest information.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping users informed about market developments.
For a complete list of supported symbols, refer to the Metals-API Supported Symbols page.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for effective implementation. Below are examples of various API endpoints and their responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1767658169,
"base": "USD",
"date": "2026-01-06",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
This response indicates the current exchange rates for gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD) relative to USD.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1767571769,
"base": "USD",
"date": "2026-01-05",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This endpoint allows users to access historical rates for specific dates, which is essential for analyzing price trends over time.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-12-30",
"end_date": "2026-01-06",
"base": "USD",
"rates": {
"2025-12-30": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-01-01": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-01-06": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily rates for a specified time period, allowing users to analyze trends and fluctuations in metal prices.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1767658169,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This endpoint allows users to convert amounts between different metals and currencies, facilitating transactions and calculations.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-12-30",
"end_date": "2026-01-06",
"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 metal prices fluctuate over a specified period, which is crucial for understanding market volatility.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1767658169,
"base": "USD",
"date": "2026-01-06",
"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 detailed price data for a specific date, which is essential for traders conducting technical analysis.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1767658169,
"base": "USD",
"date": "2026-01-06",
"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 current bid and ask prices for metals, which is essential for understanding market liquidity and making informed trading decisions.
Conclusion
The Metals-API is an invaluable resource for developers looking to integrate real-time and historical metal price data into their applications. By leveraging the various endpoints available, developers can create innovative solutions that enhance trading strategies, provide market insights, and facilitate transactions. Whether you are interested in gold, silver, platinum, or palladium, the Metals-API offers comprehensive data that can empower your trading decisions.
For further exploration, visit the Metals-API Website to learn more about the features and capabilities of this powerful API. Additionally, the Metals-API Documentation provides detailed guidance on how to effectively utilize the API for your specific needs. Don't forget to check the Metals-API Supported Symbols page for a complete list of available metals and currencies.