How to Get Real-Time Surat Gold 22k (SURA-22k) Prices Using JavaScript with Metals-API
How to Get Real-Time Surat Gold 22k (SURA-22k) Prices Using JavaScript with Metals-API
In the ever-evolving world of precious metals trading, having access to real-time data is crucial for making informed decisions. This blog post will guide you through the process of accessing real-time Gold (XAU) market prices using the Metals-API. We will explore the capabilities of this powerful API, its various endpoints, and how you can leverage it to get the latest Surat Gold 22k (SURA-22k) prices.
Metals-API Information
The Metals-API is a robust platform that provides real-time and historical data for various metals, including gold, silver, platinum, and palladium. It empowers developers to build next-generation applications by offering a comprehensive suite of endpoints that deliver accurate and timely market information. With the rise of digital transformation in precious metals trading, the Metals-API stands out as a vital tool for data analytics and market insights.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a safe haven for investors and a critical component of the global economy. The digital transformation in precious metals has opened new avenues for trading and investment. By integrating technology into trading practices, investors can now access real-time data, enabling them to make informed decisions based on market trends and fluctuations.
Data analytics plays a significant role in understanding market dynamics. With the Metals-API, developers can harness the power of data to gain insights into gold prices, track historical trends, and analyze market behavior. This technological integration not only enhances trading strategies but also fosters innovation in price discovery and digital asset solutions.
API Description
The Metals-API offers a wide range of capabilities that cater to the needs of developers and traders alike. With its user-friendly interface and comprehensive documentation, you can quickly get started with accessing real-time gold prices. The API allows you to retrieve data on various metals, including their latest rates, historical prices, and even conversion rates between different currencies.
For detailed information on how to use the API, refer to the Metals-API Documentation. This resource provides step-by-step instructions on how to authenticate your requests, utilize different endpoints, and interpret the API responses.
Key Features and Endpoints
The Metals-API boasts several key features that enhance its functionality:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for various metals, updated every 60 minutes or more frequently based on your subscription plan. For example, you can retrieve the latest gold price in USD and other currencies.
- Historical Rates Endpoint: Access historical rates dating back to 2019. By appending a specific date to your request, you can analyze past market trends and make informed predictions.
- Bid And Ask Endpoint: This feature allows you to retrieve real-time bid and ask prices for metals, which is essential for traders looking to execute buy or sell orders at optimal prices.
- Convert Endpoint: Easily convert any amount from one metal to another or to/from USD. This is particularly useful for traders dealing in multiple currencies.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, enabling you to analyze trends over specific periods.
- Fluctuation Endpoint: Track how metal prices fluctuate on a day-to-day basis, providing insights into market volatility.
- Carat Endpoint: Retrieve information about gold rates by carat, which is essential for jewelers and consumers interested in specific gold qualities.
- Lowest/Highest Price Endpoint: Get the lowest and highest prices for a specified date, helping you understand market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: Access detailed OHLC data for a specific time period, which is crucial for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, useful for those tracking industrial metal prices.
- API Key: Your unique API key is required for authentication and is passed into the API base URL's access_key parameter.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API includes 14 endpoints, each serving a different function, allowing for extensive data retrieval.
- Supported Symbols Endpoint: Access a constantly updated list of all available currencies and metals supported by the API.
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.
API Endpoint Examples and Responses
Latest Rates Endpoint
To get real-time exchange rates for all available metals, you can use the Latest Rates Endpoint. Here’s an example response:
{
"success": true,
"timestamp": 1783297214,
"base": "USD",
"date": "2026-07-06",
"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"
}
In this response, the "rates" object contains the latest prices for various metals, including gold (XAU). The "unit" indicates that the prices are per troy ounce.
Historical Rates Endpoint
Access historical exchange rates for any date since 1999 using the Historical Rates Endpoint. Here’s an example response:
{
"success": true,
"timestamp": 1783210814,
"base": "USD",
"date": "2026-07-05",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response provides historical rates for gold and other metals, allowing you to analyze past performance and trends.
Time-series Endpoint
The Time-series Endpoint allows you to get exchange rates for a specific time period. Here’s an example response:
{
"success": true,
"timeseries": true,
"start_date": "2026-06-29",
"end_date": "2026-07-06",
"base": "USD",
"rates": {
"2026-06-29": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-07-01": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-07-06": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily rates for the specified period, allowing for detailed trend analysis.
Convert Endpoint
The Convert Endpoint allows you to convert any amount from one metal to another or to/from USD. Here’s an example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1783297214,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows the conversion of 1000 USD to gold (XAU), providing both the conversion rate and the result in troy ounces.
Fluctuation Endpoint
Track rate fluctuations between two dates using the Fluctuation Endpoint. Here’s an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2026-06-29",
"end_date": "2026-07-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 prices have changed over the specified period, which is essential for traders looking to capitalize on market movements.
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period using the OHLC Price Endpoint. Here’s an example response:
{
"success": true,
"timestamp": 1783297214,
"base": "USD",
"date": "2026-07-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 response provides a comprehensive view of the price movements for gold and other metals, which is crucial for technical analysis and trading strategies.
Bid/Ask Endpoint
Get current bid and ask prices for metals using the Bid/Ask Endpoint. Here’s an example response:
{
"success": true,
"timestamp": 1783297214,
"base": "USD",
"date": "2026-07-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 the current bid and ask prices, which are essential for executing trades at the best possible prices.
Conclusion
Accessing real-time Surat Gold 22k (SURA-22k) prices using the Metals-API is a straightforward process that can significantly enhance your trading strategies. By leveraging the various endpoints offered by the API, you can retrieve the latest rates, historical data, and conversion rates, all of which are crucial for making informed investment decisions.
The Metals-API not only empowers developers with real-time data but also fosters innovation in the precious metals market. By integrating this API into your applications, you can provide users with valuable insights and tools for navigating the complexities of metal trading.
For more information on how to get started, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols page for a complete list of available metals. With the right tools and data at your fingertips, you can stay ahead in the dynamic world of precious metals trading.