How to Get Real-Time Surat Gold (XAU-SURA) Prices with Metals-API in Python

How to Get Real-Time Surat Gold (XAU-SURA) Prices with Metals-API in Python
In today's fast-paced financial landscape, accessing real-time market data is crucial for traders and investors. This blog post will guide you through the process of obtaining real-time Surat Gold (XAU-SURA) prices using the Metals-API. We will explore the capabilities of this powerful API, delve into its features, and provide step-by-step instructions on how to implement it in your Python applications.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a cornerstone of wealth and investment. As a precious metal, it plays a vital role in the global economy, serving as a hedge against inflation and currency fluctuations. The digital transformation in precious metals trading has opened new avenues for data analytics and market insights, allowing traders to make informed decisions based on real-time data.
With the integration of technology in trading, the ability to access real-time gold prices has become essential. The Metals-API empowers developers to build next-generation applications that leverage real-time metals data, enhancing the price discovery process and providing innovative digital asset solutions.
API Description
The Metals-API is a comprehensive JSON API that provides access to real-time and historical prices for various metals, including gold, silver, platinum, and palladium. It offers a range of endpoints that cater to different needs, from retrieving the latest rates to accessing historical data and fluctuations. The API is designed to be user-friendly, making it easy for developers to integrate into their applications.
One of the standout features of the Metals-API is its ability to deliver real-time exchange rate data, updated frequently based on your subscription plan. This ensures that you have the most accurate and timely information at your fingertips, which is crucial for making trading decisions.
Key Features and Endpoints
The Metals-API offers a variety of endpoints, each designed to fulfill specific requirements. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated every 60 minutes, every 10 minutes, or even more frequently, depending on your subscription plan. This allows traders to stay informed about the current market conditions.
- Historical Rates Endpoint: Access historical rates dating back to 2019. You can query the API for specific dates to analyze past trends and make informed predictions about future movements.
- Bid and Ask Endpoint: Retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: This feature allows you to convert any amount from one metal to another or to/from USD, facilitating seamless transactions across different currencies.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, enabling detailed analysis of price movements over time.
- Fluctuation Endpoint: Track how currencies fluctuate on a day-to-day basis, providing insights into market volatility.
- Carat Endpoint: Retrieve information about gold rates by carat, which is particularly useful for jewelers and consumers looking to buy or sell gold jewelry.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specified date, helping traders identify potential entry and exit points.
- Open/High/Low/Close (OHLC) Price Endpoint: Access open, high, low, and close prices for a specific time period, essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, useful for those trading industrial metals.
- API Key: Your unique API key is required to access the API, ensuring secure and authorized usage.
- API Response: The API delivers exchange rates relative to USD, with all data returned in a structured JSON format.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available currencies and metals, ensuring you have the latest information.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, catering to regional market needs.
- News Endpoint: Stay updated with the latest news articles related to various metals, providing context to market movements.
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.
API Endpoint Examples and Responses
Understanding the API's response structure is crucial for effective integration. Below are examples of various endpoints and their corresponding JSON responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1760054720,
"base": "USD",
"date": "2025-10-10",
"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"
}
The response indicates a successful request, providing the current exchange rates for various metals, including gold (XAU). The rates are expressed per troy ounce, which is the standard measurement for precious metals.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1759968320,
"base": "USD",
"date": "2025-10-09",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response provides historical rates for a specific date, allowing users to analyze past market behavior and trends.
Time-Series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-10-03",
"end_date": "2025-10-10",
"base": "USD",
"rates": {
"2025-10-03": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-10-05": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-10-10": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This endpoint allows users to retrieve exchange rates for a specific time period, making it easier to visualize trends and fluctuations over time.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1760054720,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
The Convert Endpoint allows you to convert amounts between different metals or currencies. In this example, 1000 USD is converted to 0.482 troy ounces of gold (XAU).
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-10-03",
"end_date": "2025-10-10",
"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 endpoint provides insights into how metal prices fluctuate over a specified period, which is essential for traders looking to capitalize on market movements.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1760054720,
"base": "USD",
"date": "2025-10-10",
"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"
}
The OHLC endpoint is crucial for technical analysis, providing traders with the necessary data to make informed decisions based on price movements throughout the trading day.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1760054720,
"base": "USD",
"date": "2025-10-10",
"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 endpoint provides the current bid and ask prices for metals, which is essential for traders to understand market liquidity and pricing dynamics.
Conclusion
In conclusion, the Metals-API offers a robust solution for accessing real-time Surat Gold (XAU-SURA) prices and other precious metals data. By leveraging its various endpoints, developers can build applications that provide valuable insights into market trends and fluctuations. The API's capabilities, such as real-time rates, historical data, and conversion features, empower traders to make informed decisions in a rapidly changing market.
For more information on how to implement these features in your applications, refer to the Metals-API Documentation. Additionally, explore the Metals-API Supported Symbols page to familiarize yourself with the available metal symbols and their specifications.
By integrating the Metals-API into your trading strategies, you can harness the power of real-time data to enhance your decision-making process and stay ahead in the competitive world of precious metals trading.