Get Delhi Gold (XAU-DELH) Historical Prices using this API

Get Delhi Gold (XAU-DELH) Historical Prices using this API
In the ever-evolving landscape of precious metals trading, the demand for accurate and timely data has never been greater. For developers and traders alike, accessing historical prices for gold, specifically the XAU symbol, is crucial for making informed decisions. This blog post will explore how to retrieve historical prices using the Metals-API, a powerful tool that provides real-time and historical data for various metals, including gold.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a cornerstone of wealth and investment. As a digital transformation sweeps across the financial sector, the integration of technology into precious metals trading is reshaping how investors and developers interact with this valuable asset. The rise of data analytics and market insights has empowered traders to make data-driven decisions, while innovations in price discovery are enhancing transparency in the market.
With the advent of digital asset solutions, gold is no longer just a physical commodity; it has become a digital asset that can be traded and analyzed in real-time. This transformation is not just about convenience; itβs about leveraging technology to unlock new opportunities in trading and investment. The Metals-API plays a pivotal role in this ecosystem by providing developers with the tools they need to build next-generation applications that can access and analyze gold prices efficiently.
API Description
The Metals-API is designed to provide developers with comprehensive access to metals data, including gold, silver, platinum, and palladium. This API is a game-changer for those looking to integrate real-time and historical metals data into their applications. With its robust capabilities, the Metals-API empowers developers to create innovative solutions that can analyze market trends, track price fluctuations, and provide insights into the precious metals market.
One of the standout features of the Metals-API is its ability to deliver real-time exchange rate data, updated at intervals depending on the subscription plan. This means that whether you need the latest rates or historical data dating back to 2019, the Metals-API has you covered. The API's endpoints are designed to be intuitive and easy to use, making it accessible for developers of all skill levels.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs, allowing users to access a wealth of information about precious metals. Here are some of the key features:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint provides real-time exchange rate data for metals, updated every 60 minutes, every 10 minutes, or even more frequently. This is essential for traders who need to stay updated on 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 past prices for gold and other metals, enabling you to analyze trends over time.
- Bid And Ask Endpoint: This powerful feature allows you to retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing dynamics.
- 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 is particularly useful for traders operating in multiple currencies.
- Time-Series Endpoint: This endpoint allows you to query the API for daily historical rates between two dates of your choice, making it easy to analyze price movements over specific periods.
- Fluctuation Endpoint: Retrieve information about how currencies fluctuate on a day-to-day basis, which is crucial for understanding market volatility.
- Carat Endpoint: Get information about gold rates by carat, which is essential for jewelers and those in the jewelry industry.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price of gold over a specified period, helping traders identify market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific time period, allowing for detailed technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is invaluable for those trading in industrial metals.
- API Key: Your unique API key is required to access the API, ensuring secure and authenticated requests.
- API Response: The Metals-API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format.
- Available Endpoints: The API comes with numerous endpoints, each providing different functionalities tailored to various user needs.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies and metal symbols, 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 traders in the Indian market.
- News Endpoint: Get the latest news articles related to various metals, keeping you informed about market developments.
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 how to utilize the Metals-API effectively requires familiarity with its response structure. Below are examples of various endpoints, showcasing their functionality and the type of data returned.
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1745726498,
"base": "USD",
"date": "2025-04-27",
"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"
}
Historical Rates Endpoint
Access historical exchange rates for any date since 1999.
{
"success": true,
"timestamp": 1745640098,
"base": "USD",
"date": "2025-04-26",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-series Endpoint
Get exchange rates for a specific time period.
{
"success": true,
"timeseries": true,
"start_date": "2025-04-20",
"end_date": "2025-04-27",
"base": "USD",
"rates": {
"2025-04-20": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-04-22": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-04-27": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Convert Endpoint
Convert any amount from one metal to another or to/from USD.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1745726498,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2025-04-20",
"end_date": "2025-04-27",
"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"
}
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period.
{
"success": true,
"timestamp": 1745726498,
"base": "USD",
"date": "2025-04-27",
"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
Get current bid and ask prices for metals.
{
"success": true,
"timestamp": 1745726498,
"base": "USD",
"date": "2025-04-27",
"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"
}
Conclusion
In conclusion, the Metals-API provides a comprehensive suite of tools for developers looking to access historical prices for gold and other precious metals. With its robust features, including real-time rates, historical data, and various endpoints tailored to different needs, this API is an invaluable resource for anyone involved in metals trading.
By leveraging the capabilities of the Metals-API, developers can create innovative applications that enhance trading strategies, provide market insights, and facilitate better decision-making. Whether you are a seasoned trader or a developer looking to integrate metals data into your applications, the Metals-API offers the tools you need to succeed in the dynamic world of precious metals.
For more information, be sure to check out the Metals-API Documentation for detailed guidance on implementation, as well as the Metals-API Supported Symbols page for a complete list of available symbols. Embrace the future of precious metals trading with the power of real-time data at your fingertips.