Learn to access DB Gold Short ETN (DGZ) prices via this API
Learn to Access DB Gold Short ETN (DGZ) Prices via this API
In the rapidly evolving world of finance, accessing real-time data is crucial for making informed decisions. The DB Gold Short ETN (DGZ) is a financial instrument that allows investors to gain exposure to the price movements of gold without directly owning the physical asset. To effectively track and analyze the prices of DGZ, developers can utilize the Metals-API, a powerful tool that provides real-time and historical data on various metals, including gold.
Metals-API Information
The Metals-API is designed to empower developers with access to comprehensive data on precious metals. This API not only facilitates the retrieval of current prices but also offers historical data, bid and ask prices, and various conversion functionalities. By integrating this API into applications, developers can create innovative solutions that enhance trading strategies and market analysis.
About Gold (XAU)
Gold, represented by the symbol XAU, has long been considered a safe-haven asset and a hedge against inflation. In recent years, the digital transformation in precious metals has opened new avenues for data analytics and market insights. The integration of technology in trading has revolutionized how investors access and interpret market data. With the rise of digital asset solutions, gold trading has become more accessible, allowing for innovative price discovery methods.
As the demand for real-time data grows, the Metals-API stands out by providing developers with the tools necessary to build next-generation applications. This API enables users to access up-to-date information on gold prices, historical trends, and market fluctuations, making it an invaluable resource for traders and analysts alike.
API Description
The Metals-API is a robust platform that offers a variety of endpoints to cater to different data needs. With a focus on innovation and technological advancement, this API allows developers to harness the transformative potential of real-time metals data. By utilizing the API, developers can create applications that provide users with insights into market trends, price fluctuations, and historical data.
For comprehensive details on how to implement the API, developers can refer to the Metals-API Documentation, which outlines the various endpoints, their functionalities, and usage examples.
Key Features and Endpoints
The Metals-API offers a wide range of features that cater to the diverse needs of developers:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated based on your subscription plan. Developers can access the latest prices for gold, silver, and other metals, allowing for timely decision-making.
- Historical Rates Endpoint: Users can retrieve historical rates dating back to 2019, enabling them to analyze trends over time. By appending a specific date to the API request, developers can access past price data for various metals.
- Bid and Ask Endpoint: This feature allows developers to obtain real-time bid and ask prices for metals, facilitating better trading strategies and market analysis.
- Convert Endpoint: The API includes a currency conversion feature, allowing users to convert amounts between different metals or to/from USD. This is particularly useful for traders who operate in multiple currencies.
- Time-Series Endpoint: Developers can query the API for daily historical rates between two specified dates, providing insights into price movements over time.
- Fluctuation Endpoint: This endpoint tracks how metal prices fluctuate on a day-to-day basis, offering valuable information for traders looking to capitalize on market movements.
- Carat Endpoint: Users can retrieve gold rates by carat, which is essential for jewelers and those in the jewelry industry.
- Lowest/Highest Price Endpoint: This feature allows developers to query the API for the lowest and highest prices of metals over a specified period, aiding in market analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: Developers can access OHLC data for specific time periods, providing a comprehensive view of market performance.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols, dating back to 2008, which is crucial for those analyzing long-term trends.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate access to the API.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The API features 14 different endpoints, each designed to provide specific functionalities tailored to user needs.
- Supported Symbols Endpoint: This endpoint returns a constantly updated list of all available currencies and metals, ensuring developers have access to the latest information.
- News Endpoint: Users can retrieve the latest news articles related to various metals, keeping them 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
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1769559147,
"base": "USD",
"date": "2026-01-28",
"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": 1769472747,
"base": "USD",
"date": "2026-01-27",
"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-01-21",
"end_date": "2026-01-28",
"base": "USD",
"rates": {
"2026-01-21": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-01-23": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-01-28": {
"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": 1769559147,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2026-01-21",
"end_date": "2026-01-28",
"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": 1769559147,
"base": "USD",
"date": "2026-01-28",
"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": 1769559147,
"base": "USD",
"date": "2026-01-28",
"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
In conclusion, the Metals-API is an essential tool for developers looking to access real-time and historical data on precious metals, including gold. By leveraging the various endpoints offered by the API, developers can create innovative applications that enhance trading strategies and market analysis. The ability to retrieve real-time rates, historical data, and bid/ask prices empowers users to make informed decisions in a fast-paced market environment.
For more information on how to utilize the API effectively, developers are encouraged to explore the Metals-API Documentation and familiarize themselves with the Metals-API Supported Symbols. By integrating this API into their applications, developers can unlock the full potential of precious metals trading and analysis.