Get Delhi Gold 22k (DELH-22k) Historical Prices for Specific Dates using this API

Metals-API 6 min read
Get Delhi Gold 22k (DELH-22k) Historical Prices for Specific Dates using this API

Introduction

In the ever-evolving landscape of financial technology, the demand for precise and real-time data has never been higher, especially in the realm of precious metals trading. For developers and traders alike, having access to historical prices for gold, specifically 22k gold (DELH-22k), is crucial for making informed decisions. This blog post delves into how to obtain historical prices using the Metals-API, a powerful tool that provides comprehensive data on various metals, including gold (XAU). We will explore the API's capabilities, its innovative features, and how it can transform the way you interact with precious metals data.

About Gold (XAU)

Gold has long been a symbol of wealth and a reliable store of value. In recent years, the digital transformation in precious metals has opened new avenues for trading and investment. The integration of data analytics and market insights has enabled traders to make more informed decisions based on historical trends and real-time data. With the rise of technology in trading, the process of price discovery has become more efficient, allowing for better transparency and accessibility.

As a digital asset, gold is not just a physical commodity; it has become a part of the digital economy. The advent of APIs like Metals-API has revolutionized how traders and developers access and utilize gold price data. By leveraging advanced technology, users can gain insights into market fluctuations, historical trends, and even perform currency conversions seamlessly.

Metals-API Overview

The Metals-API is designed to provide developers with real-time and historical data on various metals, including gold, silver, platinum, and palladium. It offers a suite of endpoints that allow users to access the latest rates, historical prices, bid and ask prices, and much more. This API is particularly beneficial for those looking to build applications that require accurate and timely metals data.

One of the standout features of Metals-API is its ability to deliver data in a user-friendly JSON format, making it easy for developers to integrate into their applications. The API supports a wide range of functionalities, including:

  • Real-time exchange rates
  • Historical rates dating back to 2019
  • Bid and ask prices for metals
  • Currency conversion capabilities
  • Time-series data for specific periods
  • Fluctuation tracking between dates
  • Open, high, low, and close (OHLC) price data

Key Features and Endpoints

Understanding the various endpoints of the Metals-API is essential for effectively utilizing its capabilities. Here’s a breakdown of some of the most important features:

Latest Rates Endpoint

The Latest Rates Endpoint provides real-time exchange rate data for all available metals. Depending on your subscription plan, the API can return updates every 60 minutes, every 10 minutes, or even more frequently. This feature is vital for traders who need to stay updated on market movements.

{
"success": true,
"timestamp": 1765764111,
"base": "USD",
"date": "2025-12-15",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}

Historical Rates Endpoint

Accessing historical rates is crucial for analyzing trends and making predictions. The Historical Rates Endpoint allows users to retrieve exchange rates for any date since 1999. This is particularly useful for back-testing trading strategies or analyzing market behavior over time.

{
"success": true,
"timestamp": 1765677711,
"base": "USD",
"date": "2025-12-14",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"unit": "per troy ounce"
}

Time-Series Endpoint

The Time-Series Endpoint allows users to query the API for daily historical rates between two specified dates. This feature is particularly useful for analyzing price movements over a defined period.

{
"success": true,
"timeseries": true,
"start_date": "2025-12-08",
"end_date": "2025-12-15",
"base": "USD",
"rates": {
"2025-12-08": {
"XAU": 0.000485,
"XAG": 0.03825
},
"2025-12-10": {
"XAU": 0.000483,
"XAG": 0.0382
},
"2025-12-15": {
"XAU": 0.000482,
"XAG": 0.03815
}
},
"unit": "per troy ounce"
}

Convert Endpoint

The Convert Endpoint enables users to convert any amount from one metal to another or to/from USD. This functionality is essential for traders who need to quickly assess the value of their holdings in different currencies.

{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1765764111,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}

Fluctuation Endpoint

The Fluctuation Endpoint allows users to track rate fluctuations between two dates. This feature is particularly useful for understanding market volatility and making informed trading decisions.

{
"success": true,
"fluctuation": true,
"start_date": "2025-12-08",
"end_date": "2025-12-15",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
}
},
"unit": "per troy ounce"
}

Open/High/Low/Close (OHLC) Price Endpoint

The OHLC Price Endpoint provides open, high, low, and close prices for a specific time period. This data is crucial for traders looking to analyze price trends and make strategic decisions.

{
"success": true,
"timestamp": 1765764111,
"base": "USD",
"date": "2025-12-15",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
}
},
"unit": "per troy ounce"
}

Bid/Ask Endpoint

The Bid/Ask Endpoint provides current bid and ask prices for metals. This information is essential for traders looking to execute trades at the best possible prices.

{
"success": true,
"timestamp": 1765764111,
"base": "USD",
"date": "2025-12-15",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
}
},
"unit": "per troy ounce"
}

Authentication and API Key

To access the Metals-API, you will need an API key, which is a unique identifier passed into the API base URL's access_key parameter. This key is essential for authenticating your requests and ensuring that you have the appropriate permissions to access the data.

Performance Considerations

When working with the Metals-API, it is important to consider performance optimization strategies. This includes understanding rate limits and quota management to avoid exceeding your usage limits. Additionally, implementing caching strategies can help improve response times and reduce the load on the API.

Security Best Practices

Security is paramount when dealing with financial data. Ensure that your API key is kept confidential and not exposed in public repositories. Implementing HTTPS for all API requests will help protect data in transit. Additionally, consider using environment variables to store sensitive information securely.

Common Pitfalls and Troubleshooting

While using the Metals-API, developers may encounter common issues such as rate limiting, incorrect API key usage, or malformed requests. Always refer to the Metals-API Documentation for guidance on error handling and recovery strategies.

Conclusion

The Metals-API is a powerful tool for developers looking to access real-time and historical data on precious metals like gold. By leveraging its various endpoints, users can gain valuable insights into market trends, perform currency conversions, and track fluctuations over time. With its user-friendly JSON format and comprehensive documentation, integrating the Metals-API into your applications is straightforward and efficient.

As the digital landscape continues to evolve, the importance of accurate and timely data in trading cannot be overstated. By utilizing the Metals-API, developers can create innovative applications that enhance the trading experience and empower users with the information they need to make informed decisions.

For more information on the available symbols, visit the Metals-API Supported Symbols page. To get started with the API, check out the Metals-API Documentation for detailed implementation guidance.