Retrieve Dehradun Gold 22k (DEHR-22k) Historical Prices via this API

Retrieve Dehradun Gold 22k (DEHR-22k) Historical Prices via this API
In today's digital age, the demand for real-time data has transformed the way we interact with precious metals, particularly gold. For developers and traders alike, accessing historical prices for gold, such as the Dehradun Gold 22k (DEHR-22k), is crucial for making informed decisions. The Metals-API provides a robust platform for retrieving historical prices and other valuable data related to precious metals. This blog post will delve into the capabilities of the Metals-API, focusing on how to effectively retrieve historical prices for gold and explore the broader implications of digital transformation in the precious metals market.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a symbol of wealth and stability. As a precious metal, it plays a vital role in various sectors, including jewelry, investment, and technology. The digital transformation in the precious metals market has led to significant advancements in data analytics and market insights. With the integration of technology in trading, investors can now access real-time data, enabling them to make informed decisions based on current market trends.
One of the most innovative aspects of this transformation is the way price discovery has evolved. Traditional methods of determining gold prices have been supplemented by advanced algorithms and data analytics, allowing for more accurate and timely price assessments. Furthermore, the rise of digital asset solutions has opened new avenues for trading and investing in gold, making it more accessible to a broader audience.
Metals-API Overview
The Metals-API is a powerful tool designed for developers looking to integrate precious metals data into their applications. It offers a wide range of features, including real-time exchange rates, historical data, and various endpoints tailored to meet the needs of different users. The API's capabilities empower developers to build next-generation applications that leverage real-time metals data, enhancing the trading experience.
With the Metals-API, users can access a comprehensive range of endpoints that provide valuable insights into the metals market. From retrieving the latest rates to historical prices, the API is designed to cater to the diverse needs of its users. The API's structure allows for seamless integration into existing systems, making it an ideal choice for developers looking to enhance their applications with precious metals data.
Key Features of Metals-API
The Metals-API offers several key features that make it a valuable resource for developers and traders. Below are some of the most notable endpoints and their functionalities:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data for various metals, updated every 60 minutes, every 10 minutes, or even more frequently. This feature is essential for traders who need up-to-the-minute information to make quick decisions.
- 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 historical prices for gold and other metals, providing valuable insights into market trends over time.
- Bid and Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices for metals. Understanding the bid-ask spread is crucial for traders looking to optimize their trading strategies.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, enabling users to convert any amount from one metal to another or to/from USD. This feature simplifies transactions and enhances the user experience.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two dates of their choice. This is particularly useful for analyzing trends and fluctuations in gold prices over specific periods.
- Fluctuation Endpoint: Users can retrieve information about how metal prices fluctuate on a day-to-day basis. This endpoint provides insights into market volatility, helping traders make informed decisions.
- Carat Endpoint: This feature allows users to retrieve information about gold rates by carat. By appending a base currency, developers can access detailed pricing information based on the purity of gold.
- Lowest/Highest Price Endpoint: This endpoint enables users to query the API to get the lowest and highest prices for a specified date, providing insights into market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can retrieve the open, high, low, and close prices for a specific date, which is essential for technical analysis and trading strategies.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, allowing users to analyze long-term trends in metal prices.
- API Key: The API requires a unique API key for authentication, which is passed into the API base URL's access_key parameter. This ensures secure access to the API's features.
- API Response: Exchange rates delivered by the Metals-API are by default relative to USD, and all data is returned in a structured JSON format, making it easy for developers to parse and utilize the information.
- Available Endpoints: The Metals-API comes with a constantly updated endpoint that returns all available currencies, ensuring users have access to the latest information.
- Gold Price India Endpoint: This dedicated endpoint allows users to retrieve the latest gold price in India, catering to a specific market segment.
- News Endpoint: The Metals-API provides access to the latest news articles related to various metals, keeping users informed about market developments.
API Endpoint Examples and Responses
Understanding the structure of API responses is crucial for developers looking to integrate the Metals-API into their applications. Below are examples of various endpoints and their corresponding JSON responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1749196882,
"base": "USD",
"date": "2025-06-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"
}
This response indicates that the API call was successful and provides the latest exchange rates for various metals, including gold (XAU).
Historical Rates Endpoint
{
"success": true,
"timestamp": 1749110482,
"base": "USD",
"date": "2025-06-05",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example demonstrates how to retrieve historical rates for gold and other metals for a specific date. The response includes the base currency and the rates for each metal.
Time-Series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-05-30",
"end_date": "2025-06-06",
"base": "USD",
"rates": {
"2025-05-30": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-06-01": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-06-06": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time series of exchange rates for gold over a specified period, allowing users to analyze trends and fluctuations.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1749196882,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
The Convert Endpoint allows users to convert a specified amount from one currency to another. In this case, it converts 1000 USD to gold (XAU), resulting in 0.482 troy ounces.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-30",
"end_date": "2025-06-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 gold and other metals fluctuate over a specified period, highlighting the start and end rates, as well as the percentage change.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1749196882,
"base": "USD",
"date": "2025-06-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 example illustrates how to retrieve OHLC data for gold, providing essential information for traders engaged in technical analysis.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1749196882,
"base": "USD",
"date": "2025-06-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 for gold, silver, and platinum, along with the spread, which is critical for traders looking to optimize their entry and exit points.
Conclusion
In conclusion, the Metals-API is an invaluable resource for developers and traders seeking to access historical prices and real-time data for precious metals like gold. With its extensive range of endpoints and capabilities, the API empowers users to build sophisticated applications that leverage real-time market data. By understanding how to effectively utilize the API's features, developers can enhance their trading strategies and make informed decisions based on accurate and timely information.
As the digital transformation in the precious metals market continues to evolve, the importance of data analytics and technology integration cannot be overstated. The Metals-API stands at the forefront of this transformation, providing users with the tools they need to navigate the complexities of the metals market. For more information on how to get started, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols for a comprehensive list of available metals.