Query Dehradun Gold 18k (DEHR-18k) prices via this API
Introduction
In the ever-evolving landscape of precious metals trading, the ability to query real-time data is paramount. For developers and traders alike, accessing accurate and timely information about gold prices, specifically the 18k gold (symbol: XAU), is crucial for making informed decisions. This blog post delves into the capabilities of the Metals-API, a powerful tool that provides access to real-time and historical data for various metals, including gold. We will explore how this API works, its key features, and how it can be leveraged to enhance trading strategies and market insights.
Metals-API Information
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a symbol of wealth and stability. In recent years, the digital transformation in precious metals has opened new avenues for trading and investment. The integration of data analytics and technology into trading platforms has revolutionized how traders access market insights. With the rise of digital asset solutions, understanding the dynamics of gold pricing has never been more critical.
The Metals-API plays a pivotal role in this transformation by providing developers with the tools necessary to build next-generation applications that can analyze and respond to market changes in real-time. By harnessing the power of data, traders can innovate their price discovery processes and make more informed decisions.
API Description
The Metals-API is designed to empower developers by offering a comprehensive suite of features that facilitate the retrieval of real-time metals data. This API is not just about accessing prices; it represents a technological advancement that allows for the creation of applications capable of analyzing trends, forecasting prices, and optimizing trading strategies.
With the Metals-API, developers can access a wide range of endpoints that provide various functionalities, including real-time rates, historical data, and conversion capabilities. This flexibility enables the development of applications that can cater to diverse trading needs, whether for individual investors or large financial institutions.
Key Features and Endpoints
The Metals-API offers several key features that enhance its usability and functionality:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data for metals, updated every 60 minutes, every 10 minutes, or even more frequently. This allows traders to stay informed about 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 past prices, which is essential for trend analysis and forecasting.
- Bid And Ask Endpoint: This powerful feature enables you to retrieve real-time bid and ask prices for metals, allowing traders to make quick decisions based on current market conditions.
- Convert Endpoint: The conversion endpoint allows users to convert any amount from one metal to another or to/from USD. This is particularly useful for traders dealing with multiple currencies.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice. This feature is invaluable for analyzing price movements over specific periods.
- Fluctuation Endpoint: Retrieve information about how currencies fluctuate on a day-to-day basis. This endpoint provides insights into market volatility, helping traders manage risk effectively.
- Carat Endpoint: Access information about gold rates by carat. This is particularly useful for jewelers and consumers interested in specific gold purity levels.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest prices for a specified date range, which can aid in identifying market trends.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific time period, allowing traders to analyze market performance comprehensively.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is crucial for traders focusing on industrial metals.
- API Key: Your unique API key is essential for accessing the API's features and must be included in your requests.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API offers 14 endpoints, each providing different functionalities tailored to various trading needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies, ensuring that developers have access to the most up-to-date information.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping traders 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 the API's response structure is crucial for effective implementation. Below are examples of responses from various endpoints:
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1771373388,
"base": "USD",
"date": "2026-02-18",
"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": 1771286988,
"base": "USD",
"date": "2026-02-17",
"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": "2026-02-11",
"end_date": "2026-02-18",
"base": "USD",
"rates": {
"2026-02-11": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-02-13": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-02-18": {
"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": 1771373388,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2026-02-11",
"end_date": "2026-02-18",
"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": 1771373388,
"base": "USD",
"date": "2026-02-18",
"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": 1771373388,
"base": "USD",
"date": "2026-02-18",
"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
The Metals-API is an invaluable resource for developers and traders looking to access real-time and historical data for precious metals, particularly gold. By leveraging the various endpoints offered by the API, users can gain insights into market trends, perform conversions, and analyze fluctuations, all of which are essential for making informed trading decisions.
As the market for precious metals continues to evolve, the integration of technology and data analytics will play a crucial role in shaping the future of trading. The Metals-API stands at the forefront of this transformation, providing the tools necessary for developers to create innovative applications that can adapt to the dynamic nature of the market.
For more information on how to get started with the Metals-API, visit the Metals-API Website and explore the Metals-API Documentation for detailed guidance on implementation. Don't forget to check the Metals-API Supported Symbols page to familiarize yourself with the available metal symbols.