Step-by-Step Guide to Obtain Surat Gold (XAU-SURA) Historical Prices with this API

Step-by-Step Guide to Obtain Surat Gold (XAU-SURA) Historical Prices with this API
About Gold (XAU)
Metals-API Overview
Metals-API Website or check out the Metals-API Documentation for detailed guidance on how to use the API effectively.
Key Features of Metals-API
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently. This feature is essential for traders who need to make quick decisions based on the latest market conditions.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. By appending a specific date to your query, you can retrieve historical prices for Gold and other metals, allowing for in-depth analysis of price trends over time.
- Bid and Ask Endpoint: This powerful feature enables you to retrieve real-time Bid and Ask prices for metals, providing insight into market liquidity and helping traders make informed decisions.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, allowing you to convert any amount from one metal to another or to/from USD. This feature 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. This endpoint is invaluable for analyzing trends over specific periods and understanding market movements.
- Fluctuation Endpoint: Retrieve information about how currencies fluctuate on a day-to-day basis. This endpoint helps traders understand volatility and make better trading decisions.
- Carat Endpoint: Get information about Gold rates by Carat. This feature is particularly useful for jewelers and those in the jewelry industry.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specified date, which can help in identifying market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint allows you to get the open, high, low, and close prices for a specific date, providing a comprehensive view of market activity.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is crucial for those involved in industrial metals trading.
- 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, and all data is returned in a structured JSON format for easy integration.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, ensuring you have the latest information at your fingertips.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for local traders.
- News Endpoint: Stay updated with the latest news articles related to various metals, helping you stay informed about market developments.
Understanding API Responses
Latest Rates Endpoint
{
"success": true,
"timestamp": 1754679620,
"base": "USD",
"date": "2025-08-08",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
{
"success": true,
"timestamp": 1754593220,
"base": "USD",
"date": "2025-08-07",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"unit": "per troy ounce"
}
Time-Series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-08-01",
"end_date": "2025-08-08",
"base": "USD",
"rates": {
"2025-08-01": {
"XAU": 0.000485,
"XAG": 0.03825
},
"2025-08-03": {
"XAU": 0.000483,
"XAG": 0.0382
},
"2025-08-08": {
"XAU": 0.000482,
"XAG": 0.03815
}
},
"unit": "per troy ounce"
}
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1754679620,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-08-01",
"end_date": "2025-08-08",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
}
},
"unit": "per troy ounce"
}
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1754679620,
"base": "USD",
"date": "2025-08-08",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
}
},
"unit": "per troy ounce"
}
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1754679620,
"base": "USD",
"date": "2025-08-08",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
}
},
"unit": "per troy ounce"
}
Common Use Cases for Metals-API
- Trading Applications: Developers can create trading platforms that leverage real-time and historical data to provide users with insights and analytics.
- Market Analysis Tools: By integrating the API, analysts can build tools that track price movements and generate reports based on historical data.
- Investment Portfolio Management: Investors can use the API to monitor their portfolios and make informed decisions based on current and historical metal prices.
- Financial News Aggregators: News applications can incorporate the API to provide users with the latest updates on metal prices and market trends.
Best Practices for Using Metals-API
- Rate Limiting: Be mindful of the API's rate limits based on your subscription plan to avoid exceeding your quota.
- Error Handling: Implement robust error handling to manage API response errors gracefully and provide users with meaningful feedback.
- Data Caching: Consider caching frequently accessed data to reduce API calls and improve application performance.
- Security: Always keep your API Key secure and avoid exposing it in client-side code.
Conclusion
Metals-API Documentation and explore the Metals-API Supported Symbols for a comprehensive list of available metals. With the right tools and knowledge, you can harness the power of real-time metals data to drive your applications forward.