Get Surat Gold (XAU-SURA) Historical Prices in Custom Time Range using this API
Get Surat Gold (XAU-SURA) Historical Prices in Custom Time Range using this API
In today's digital age, the demand for real-time data and analytics in the precious metals market has surged. One of the most sought-after commodities is gold, represented by the symbol XAU. With the rise of technology and data analytics, developers now have the tools to access historical prices and market insights through APIs. One such powerful tool is the Metals-API, which provides comprehensive data on various metals, including gold. This blog post will explore how to retrieve historical prices for Surat Gold (XAU-SURA) using the Metals-API, along with a deep dive into the API's capabilities, features, and practical applications.
Metals-API Information
The Metals-API is a robust platform that offers real-time and historical data for precious metals. It empowers developers to create applications that can analyze market trends, track price fluctuations, and provide insights into the precious metals market. The API is designed with innovation in mind, allowing for seamless integration into various applications, whether for trading platforms, financial analysis tools, or investment tracking systems.
About Gold (XAU)
Gold has long been considered a safe haven asset, especially during times of economic uncertainty. Its value is influenced by various factors, including market demand, geopolitical events, and currency fluctuations. The digital transformation in the precious metals sector has led to the integration of advanced data analytics, enabling traders and investors to make informed decisions based on real-time data.
With the Metals-API, developers can access a wealth of information about gold prices, including historical data dating back to 2019. This capability allows for in-depth market analysis and the ability to identify trends over time. The API's technology integration facilitates innovation in price discovery, enabling users to leverage data for strategic trading decisions.
API Description
The Metals-API is designed to provide developers with the tools necessary to access and manipulate metals data effectively. It offers a variety of endpoints that cater to different needs, from retrieving the latest rates to accessing historical data. The API's capabilities include:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data, updated based on your subscription plan. Users can receive updates every 60 minutes, every 10 minutes, or even more frequently, depending on their needs.
- Historical Rates Endpoint: Users can access historical rates for most currencies dating back to 2019. By appending a specific date to the API request, developers can retrieve past prices for analysis.
- Bid And Ask Endpoint: This feature allows users to retrieve real-time bid and ask prices, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The API includes a currency conversion feature, enabling users to convert amounts between different metals or from/to USD.
- Time-Series Endpoint: This endpoint allows for querying daily historical rates between two selected dates, making it ideal for trend analysis.
- Fluctuation Endpoint: Users can track how prices fluctuate over a specified period, providing insights into market volatility.
- Carat Endpoint: This feature allows users to retrieve gold rates based on carat measurements, catering to jewelers and traders.
- Lowest/Highest Price Endpoint: Users can query the API to find the lowest and highest prices for a specified date range.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides detailed price information, including opening, high, low, and closing prices for a specific date.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, useful for comprehensive market analysis.
- API Key: Each user is assigned a unique API key, which must be included in requests to authenticate access.
- API Response: The API delivers exchange rates relative to USD, with all data returned in a structured JSON format.
- Available Endpoints: The Metals-API includes 14 different endpoints, each offering unique functionalities to cater to diverse user needs.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available metal symbols, ensuring users have access to the latest data.
- News Endpoint: Users can retrieve the latest news articles related to various metals, keeping them informed about market developments.
Key Features and Endpoints
The Metals-API is equipped with numerous features that enhance its usability and functionality. Here are some of the key endpoints and their applications:
Latest Rates Endpoint
The Latest Rates Endpoint provides real-time exchange rates for all available metals. This is crucial for traders who need up-to-the-minute data to make informed decisions. The response includes a timestamp, base currency, and rates for various metals.
{
"success": true,
"timestamp": 1770336975,
"base": "USD",
"date": "2026-02-06",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
This endpoint allows users to access historical exchange rates for any date since 1999. This is particularly useful for analyzing trends over time and making predictions based on historical data.
{
"success": true,
"timestamp": 1770250575,
"base": "USD",
"date": "2026-02-05",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-Series Endpoint
The Time-Series Endpoint enables users to query the API for daily historical rates between two chosen dates. This is particularly useful for identifying trends and patterns in price movements.
{
"success": true,
"timeseries": true,
"start_date": "2026-01-30",
"end_date": "2026-02-06",
"base": "USD",
"rates": {
"2026-01-30": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-02-01": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-02-06": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"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 is essential for traders who need to assess the value of their holdings in different currencies.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1770336975,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
The Fluctuation Endpoint provides insights into how prices fluctuate between two dates. This is particularly useful for traders looking to understand market volatility and make informed decisions.
{
"success": true,
"fluctuation": true,
"start_date": "2026-01-30",
"end_date": "2026-02-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"
}
Open/High/Low/Close (OHLC) Price Endpoint
This endpoint provides detailed price information, including the opening, high, low, and closing prices for a specific date. This is crucial for traders who rely on technical analysis to make decisions.
{
"success": true,
"timestamp": 1770336975,
"base": "USD",
"date": "2026-02-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"
}
Bid/Ask Endpoint
The Bid/Ask Endpoint provides current bid and ask prices for metals, giving traders insights into market liquidity and pricing dynamics.
{
"success": true,
"timestamp": 1770336975,
"base": "USD",
"date": "2026-02-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"
}
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. This resource is invaluable for developers looking to integrate specific metals into their applications.
Conclusion
In conclusion, the Metals-API offers a powerful suite of tools for accessing historical prices and real-time data for precious metals like gold (XAU). By leveraging this API, developers can create innovative applications that provide market insights, track price fluctuations, and facilitate trading strategies. The extensive documentation available at the Metals-API Documentation ensures that developers have the resources they need to implement these features effectively.
As the digital landscape continues to evolve, the integration of advanced data analytics and real-time information will play a crucial role in the precious metals market. By utilizing the Metals-API, developers can stay ahead of the curve and provide valuable solutions to traders and investors alike.