Get Invesco DB Precious Metals Fund (DBP) Historical Prices through this API Endpoint

Introduction
The Invesco DB Precious Metals Fund (DBP) is a popular investment vehicle for those looking to gain exposure to precious metals such as gold and silver. For developers and analysts interested in tracking the historical prices of DBP, the Metals-API offers a robust solution. This API provides real-time and historical data on various metals, enabling users to integrate this information into their applications seamlessly. In this blog post, we will explore the capabilities of the Metals-API, focusing on how to retrieve historical prices for DBP and other precious metals.
Metals-API Information
The Metals-API is a powerful tool designed for developers who need access to real-time and historical data on precious metals. It allows users to obtain exchange rates, historical prices, and other valuable insights that can be integrated into applications for trading, analysis, and reporting. The API is built with modern technology, ensuring that it can handle large volumes of requests efficiently while providing accurate and timely data.
About Neodymium (ND)
While Neodymium is not a precious metal in the traditional sense, its significance in the digital transformation of metal markets cannot be overlooked. Neodymium is a rare earth element used in various high-tech applications, including magnets for electric vehicles and wind turbines. The integration of smart technology and data analytics in the metal markets is transforming how metals are traded and valued.
Technological advancements have enabled better tracking and analysis of metal prices, allowing for more informed decision-making. As the demand for sustainable energy solutions grows, the role of metals like Neodymium will become increasingly critical. The Metals-API can provide insights into these trends, helping developers create applications that respond to market changes in real-time.
API Description
The Metals-API is designed to empower developers by providing access to a wide range of features that facilitate the retrieval of metal prices and related data. Its capabilities include real-time exchange rates, historical data, and various endpoints that cater to different needs. The API is built on a robust infrastructure, ensuring reliability and speed.
For more information, you can visit the Metals-API Website or check the Metals-API Documentation for detailed guidance on how to use the API effectively.
Key Features and Endpoints
The Metals-API offers several key features that developers can leverage to build applications that require metal price data. Here are some of the most important endpoints:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for various metals. Depending on your subscription plan, you can receive updates every 60 minutes, every 10 minutes, or even more frequently. This feature is essential for applications that require up-to-the-minute pricing information.
- Historical Rates Endpoint: Users can access historical rates dating back to 2019 by appending a specific date to the API request. This feature is particularly useful for analysts and traders who need to study price trends over time.
- Bid And Ask Endpoint: This powerful feature allows you to retrieve real-time bid and ask prices for metals, which is crucial for trading applications that require precise pricing information.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint that allows users to convert amounts from one metal to another or to/from USD. This feature is beneficial for applications that deal with multiple currencies.
- Time-Series Endpoint: This endpoint enables users to query the API for daily historical rates between two specified dates, making it easier to analyze price movements over time.
- Fluctuation Endpoint: Users can track how metal prices fluctuate on a day-to-day basis, providing insights into market volatility.
- Carat Endpoint: This endpoint allows users to retrieve information about gold rates by carat, which is useful for jewelers and consumers interested in gold pricing.
- Lowest/Highest Price Endpoint: This feature enables 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 open, high, low, and close prices for a specific date, which is essential for technical analysis.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, allowing users to analyze 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 returns exchange rates relative to USD by default, ensuring consistency in data presentation.
- Available Endpoints: The Metals-API offers a comprehensive list of endpoints, each designed for specific functionalities.
- Supported Symbols Endpoint: This endpoint returns a constantly updated list of all available metal symbols, ensuring users have access to the latest information.
- Gold Price India Endpoint: Users can retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for regional traders.
- News Endpoint: The Metals-API provides access to the latest news articles related to various metals, keeping users 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 responses is crucial for effective integration. Below are examples of various endpoints and their corresponding JSON responses:
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1747638095,
"base": "USD",
"date": "2025-05-19",
"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": 1747551695,
"base": "USD",
"date": "2025-05-18",
"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": "2025-05-12",
"end_date": "2025-05-19",
"base": "USD",
"rates": {
"2025-05-12": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-05-14": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-05-19": {
"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": 1747638095,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-12",
"end_date": "2025-05-19",
"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": 1747638095,
"base": "USD",
"date": "2025-05-19",
"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": 1747638095,
"base": "USD",
"date": "2025-05-19",
"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 looking to integrate precious metals data into their applications. With its extensive range of endpoints, including real-time rates, historical data, and various conversion options, the API provides the tools necessary to build sophisticated applications that can analyze and respond to market trends. By leveraging the capabilities of the Metals-API, developers can create solutions that not only meet the needs of their users but also adapt to the rapidly changing landscape of the metals market.
For more information on how to get started with the Metals-API, visit the Metals-API Documentation and explore the Metals-API Supported Symbols for a complete list of available metal symbols. The potential applications of this API are vast, and with the right implementation, it can significantly enhance the functionality of your applications.