Get DB Gold Short ETN (DGZ) Historical Prices in JSON Format using this API

Get DB Gold Short ETN (DGZ) Historical Prices in JSON Format using this API
In the world of finance, particularly in precious metals trading, having access to accurate and timely data is crucial. For developers and traders alike, the ability to retrieve historical prices for assets such as the DB Gold Short ETN (DGZ) can provide invaluable insights into market trends and price movements. This blog post will delve into how to obtain historical prices for Gold (XAU) using the Metals-API, a powerful tool designed for real-time and historical metal data retrieval.
Metals-API Information
The Metals-API is a robust platform that provides developers with access to a wide range of metal prices, including Gold, Silver, Platinum, and Palladium. It is designed to facilitate the integration of metal price data into applications, enabling users to make informed trading decisions based on real-time and historical data. The API supports various functionalities, including retrieving the latest rates, historical rates, bid and ask prices, and much more.
About Gold (XAU)
Gold has long been considered a safe haven asset and a hedge against inflation. Its value is influenced by various factors, including geopolitical stability, currency fluctuations, and market demand. In recent years, the digital transformation in precious metals trading has led to the integration of advanced data analytics and technology solutions. This shift has enabled traders to access market insights and make data-driven decisions.
With the rise of digital asset solutions, the trading landscape for Gold has evolved significantly. The Metals-API empowers developers to harness the potential of real-time metals data, allowing for innovative applications that can enhance price discovery and trading strategies. By leveraging the API, developers can create applications that provide users with up-to-date information on Gold prices, historical trends, and market fluctuations.
API Description
The Metals-API offers a comprehensive suite of features that cater to the needs of developers looking to integrate metal price data into their applications. The API is designed with innovation and technological advancement in mind, providing a seamless experience for users. With the ability to access real-time and historical data, developers can build next-generation applications that enhance trading efficiency and decision-making.
For detailed information about the API, including its capabilities and functionalities, you can refer to the Metals-API Documentation. The documentation provides insights into how to effectively utilize the API and its various endpoints.
Key Features and Endpoints
The Metals-API boasts a variety of endpoints that serve different purposes, each designed to provide specific functionalities. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated based on your subscription plan. Depending on the plan, updates can occur every 60 minutes or every 10 minutes, ensuring that users have access to the most current data.
- 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 price data for Gold and other metals.
- Bid And Ask Endpoint: This feature allows users to retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing.
- Convert Endpoint: The API includes a currency conversion feature, enabling users to convert amounts from one metal to another or to/from USD, facilitating seamless transactions.
- Time-Series Endpoint: Developers can query the API for daily historical rates between two specified dates, allowing for in-depth analysis of price trends over time.
- Fluctuation Endpoint: This endpoint provides information on how metal prices fluctuate on a day-to-day basis, helping traders understand market volatility.
- Carat Endpoint: Users can retrieve Gold rates based on carat measurements, which is particularly useful for jewelers and those in the jewelry industry.
- Lowest/Highest Price Endpoint: This feature allows users to query the API for the lowest and highest prices of metals over a specified period.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can access OHLC data for a specific time period, providing a comprehensive view of price movements.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, offering insights into long-term price trends.
- API Key: Each user is assigned a unique API key, which is required to access the API's functionalities. This key must be included in the API request to authenticate the user.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data presentation.
- Available Endpoints: The Metals-API offers a variety of endpoints, each designed to provide specific functionalities tailored to user needs.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available metal symbols, ensuring that users have access to the latest information.
- Gold Price India Endpoint: Users can retrieve the latest Gold price in India using this dedicated endpoint, catering to regional market needs.
- News Endpoint: The API allows users to access 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. This resource is invaluable for developers looking to integrate specific metal data into their applications.
API Endpoint Examples and Responses
Understanding the API's response structure is crucial for effective integration. Below are examples of various API endpoints and their corresponding JSON responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1750845619,
"base": "USD",
"date": "2025-06-25",
"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 request was successful and provides the latest exchange rates for various metals, including Gold (XAU).
Historical Rates Endpoint
{
"success": true,
"timestamp": 1750759219,
"base": "USD",
"date": "2025-06-24",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows how to retrieve historical rates for a specific date, providing insights into past price movements.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-06-18",
"end_date": "2025-06-25",
"base": "USD",
"rates": {
"2025-06-18": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-06-20": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-06-25": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
The time-series endpoint allows users to analyze price trends over a specified period, providing valuable data for forecasting and analysis.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1750845619,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response illustrates how to convert a specified amount from USD to Gold (XAU), showcasing the API's versatility in handling currency conversions.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-06-18",
"end_date": "2025-06-25",
"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 endpoint provides insights into how prices fluctuate over time, enabling traders to gauge market volatility and make informed decisions.
OHLC (Open/High/Low/Close) Endpoint
{
"success": true,
"timestamp": 1750845619,
"base": "USD",
"date": "2025-06-25",
"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"
}
The OHLC endpoint provides a comprehensive view of price movements within a specific time frame, essential for technical analysis and trading strategies.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1750845619,
"base": "USD",
"date": "2025-06-25",
"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 current bid and ask prices for metals, allowing traders to assess market conditions and make timely decisions.
Conclusion
In conclusion, the Metals-API offers a comprehensive and innovative solution for developers looking to access historical prices for Gold (XAU) and other metals. By leveraging the various endpoints available, users can retrieve real-time data, historical trends, and valuable market insights. The API's capabilities empower developers to create applications that enhance trading strategies and decision-making processes.
For further exploration of the API's features and to start integrating it into your applications, visit the Metals-API Website and refer to the Metals-API Documentation for detailed guidance. By utilizing the Metals-API, you can unlock the potential of real-time metals data and stay ahead in the dynamic world of precious metals trading.