How to Get Real-Time Delhi Gold 18k (DELH-18k) Prices Using Python and Metals-API
Introduction
In today's fast-paced financial landscape, accessing real-time market data is crucial for traders and investors alike. For those interested in precious metals, particularly Gold (XAU), the Metals-API offers a powerful solution. This blog post will guide you through the process of obtaining real-time Delhi Gold 18k (DELH-18k) prices using Python and the Metals-API. We will explore the API's capabilities, endpoints, and provide detailed examples to help you integrate this valuable data into your applications.
Understanding Metals-API
The Metals-API is a comprehensive JSON API that provides real-time and historical data for various metals, including Gold, Silver, Platinum, and Palladium. It empowers developers to create innovative applications that require accurate and timely market insights. With its advanced features, the Metals-API facilitates digital transformation in precious metals trading, allowing for enhanced data analytics and market insights.
About Gold (XAU)
Gold has long been considered a safe-haven asset, especially during times of economic uncertainty. The digital transformation in the precious metals market has made it easier for investors to access real-time data and make informed decisions. By leveraging data analytics, traders can gain insights into market trends, price movements, and fluctuations, ultimately leading to better trading strategies.
Furthermore, technology integration in trading platforms has enabled seamless access to real-time prices, making it easier for investors to react quickly to market changes. The Metals-API plays a pivotal role in this transformation, providing developers with the tools needed to build next-generation applications that can analyze and predict market behavior.
API Description
The Metals-API is designed to provide developers with a wide range of functionalities, allowing them to access real-time and historical metal prices. The API supports various endpoints, each tailored to specific needs, such as retrieving the latest rates, historical data, and even converting between different metals and currencies.
For more detailed information, you can refer to the Metals-API Documentation, which outlines the capabilities and usage of each endpoint.
Key Features and Endpoints
The Metals-API offers a variety of endpoints, each serving a unique purpose:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated based on your subscription plan. Depending on your plan, you can receive updates every 60 minutes or even every 10 minutes.
- Historical Rates Endpoint: Access historical rates dating back to 2019. This endpoint allows you to query for specific dates by appending a date in the format YYYY-MM-DD.
- Bid and Ask Endpoint: Retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing.
- Convert Endpoint: Easily convert any amount from one metal to another or to/from USD, facilitating seamless transactions.
- Time-Series Endpoint: Query for daily historical rates between two dates, allowing for in-depth analysis of price trends over time.
- Fluctuation Endpoint: Track how metal prices fluctuate on a day-to-day basis, providing insights into market volatility.
- Carat Endpoint: Retrieve information about Gold rates by carat, which is particularly useful for jewelers and consumers.
- Lowest/Highest Price Endpoint: Get the lowest and highest prices for a specific date, helping you understand market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: Access OHLC data for a specific time period, essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a broader context for market analysis.
- API Key: Your unique API key is required for authentication and must be included in your requests.
- API Response: All exchange rates are delivered relative to USD, ensuring consistency across your data.
- Available Endpoints: The Metals-API includes 14 endpoints, each designed to provide specific functionalities.
- Supported Symbols Endpoint: Access a constantly updated list of available currencies and metals.
- News Endpoint: Retrieve 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
To illustrate the capabilities of the Metals-API, let's explore some example responses for various endpoints.
Latest Rates Endpoint
The Latest Rates Endpoint allows you to get real-time exchange rates for all available metals. Here’s an example response:
{
"success": true,
"timestamp": 1775780690,
"base": "USD",
"date": "2026-04-10",
"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"
}
In this response, you can see the success status, timestamp, base currency, date, and the rates for various metals. The rates are provided per troy ounce, which is the standard measurement for precious metals.
Historical Rates Endpoint
The Historical Rates Endpoint allows you to access historical exchange rates for any date since 1999. Here’s an example response:
{
"success": true,
"timestamp": 1775694290,
"base": "USD",
"date": "2026-04-09",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response provides historical rates for Gold and other metals, allowing you to analyze past market behavior.
Time-Series Endpoint
The Time-Series Endpoint enables you to get exchange rates for a specific time period. Here’s an example response:
{
"success": true,
"timeseries": true,
"start_date": "2026-04-03",
"end_date": "2026-04-10",
"base": "USD",
"rates": {
"2026-04-03": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-04-05": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-04-10": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily rates for the specified period, allowing for trend analysis and forecasting.
Convert Endpoint
The Convert Endpoint allows you to convert any amount from one metal to another or to/from USD. Here’s an example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1775780690,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows the conversion from USD to Gold, providing the converted amount in troy ounces.
Fluctuation Endpoint
The Fluctuation Endpoint tracks rate fluctuations between two dates. Here’s an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2026-04-03",
"end_date": "2026-04-10",
"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 the prices of metals have changed over the specified period, which is vital for traders looking to capitalize on market movements.
OHLC (Open/High/Low/Close) Endpoint
The OHLC Endpoint provides open, high, low, and close prices for a specific time period. Here’s an example response:
{
"success": true,
"timestamp": 1775780690,
"base": "USD",
"date": "2026-04-10",
"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 response is essential for traders who rely on technical analysis to make informed decisions based on price movements throughout the trading day.
Bid/Ask Endpoint
The Bid/Ask Endpoint provides current bid and ask prices for metals. Here’s an example response:
{
"success": true,
"timestamp": 1775780690,
"base": "USD",
"date": "2026-04-10",
"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 critical information for traders looking to execute buy or sell orders based on current market conditions.
Conclusion
Accessing real-time Delhi Gold 18k (DELH-18k) prices using the Metals-API is a straightforward process that can significantly enhance your trading strategies. By leveraging the various endpoints offered by the API, developers can create applications that provide valuable insights into the precious metals market.
From retrieving the latest rates to analyzing historical data and tracking fluctuations, the Metals-API offers a comprehensive suite of tools for any developer looking to integrate precious metals data into their applications. For more information on how to get started, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols for a complete list of available metals.
As the financial landscape continues to evolve, staying informed and utilizing the right tools will be key to success in trading precious metals. Embrace the power of real-time data and take your trading to the next level with the Metals-API.