Retrieve Special Drawing Rights (XDR) Historical Prices through this API
Introduction
In the ever-evolving landscape of global finance, the need for accurate and timely data is paramount. One of the critical components of this data is the Special Drawing Rights (XDR), an international reserve asset created by the International Monetary Fund (IMF) to supplement its member countries' official reserves. With the advent of advanced APIs like Metals-API, developers can now retrieve historical prices of XDR and other metals with unprecedented ease and precision. This blog post will delve into the capabilities of the Metals-API, exploring how it can be utilized to access historical prices, understand market trends, and integrate this data into applications effectively.
About Special Drawing Rights (XDR)
Special Drawing Rights (XDR) are not a currency but rather a potential claim on the freely usable currencies of IMF member countries. The value of XDR is based on a basket of five major currencies: the US dollar, euro, Chinese yuan, Japanese yen, and British pound. As the global economy continues to undergo digital transformation, the role of XDR is becoming increasingly significant, particularly in the context of international trade and finance.
Technological innovation and advancement in data analytics have made it possible to track and analyze the performance of XDR in real-time. By integrating smart technology into financial applications, developers can harness the power of data to gain insights into market trends and make informed decisions. The future of XDR and its implications for global finance are vast, with possibilities for enhanced liquidity and stability in international markets.
API Description
The Metals-API is a powerful tool that provides real-time and historical data on metal prices, including XDR. This API is designed to empower developers to build next-generation applications that require accurate and timely metals data. With its robust capabilities, the Metals-API allows users to access a wide range of endpoints, each tailored to meet specific data needs.
For instance, the API offers a Latest Rates Endpoint that provides real-time exchange rate data, updated at intervals depending on the subscription plan. This feature is crucial for applications that require up-to-the-minute pricing information. Additionally, the Historical Rates Endpoint allows users to query historical rates dating back to 2019, making it an invaluable resource for trend analysis and forecasting.
Moreover, the API's Bid and Ask Endpoint provides real-time bid and ask prices, enabling traders to make informed decisions based on current market conditions. The Convert Endpoint facilitates currency conversion, allowing users to convert amounts between different currencies seamlessly. Each of these endpoints is designed with the developer in mind, providing comprehensive data that can be easily integrated into various applications.
Key Features and Endpoints
The Metals-API boasts a variety of features that cater to the diverse needs of developers. Below are some of the key endpoints and their functionalities:
Latest Rates Endpoint
The Latest Rates Endpoint is a cornerstone of the Metals-API, providing real-time exchange rate data for various metals, including XDR. Depending on your subscription plan, this endpoint can return data updated every 60 minutes or even every 10 minutes. This feature is particularly useful for applications that require the latest pricing information for trading or investment purposes.
{
"success": true,
"timestamp": 1787876079,
"base": "USD",
"date": "2026-08-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
The Historical Rates Endpoint allows users to access historical exchange rates for most currencies dating back to 2019. This feature is essential for developers looking to analyze trends over time or to backtest trading strategies. By appending a specific date to the API request, users can retrieve historical data for any given day.
{
"success": true,
"timestamp": 1787789679,
"base": "USD",
"date": "2026-08-27",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Bid And Ask Endpoint
The Bid and Ask Endpoint is a powerful feature that enables developers to retrieve real-time bid and ask prices for various metals. This information is crucial for traders who need to make quick decisions based on current market conditions. The bid price represents the maximum price that a buyer is willing to pay for a metal, while the ask price is the minimum price that a seller is willing to accept.
{
"success": true,
"timestamp": 1787876079,
"base": "USD",
"date": "2026-08-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"
}
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one currency to another, including conversions to and from USD. This feature is particularly useful for applications that require currency conversion for transactions or reporting purposes. By specifying the amount and the currencies involved, developers can easily integrate this functionality into their applications.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1787876079,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series Endpoint allows users to query the API for daily historical rates between two dates of their choice. This feature is invaluable for developers looking to analyze trends over specific time periods or to visualize data for reporting purposes. By specifying the start and end dates, users can retrieve a comprehensive dataset for their analysis.
{
"success": true,
"timeseries": true,
"start_date": "2026-08-21",
"end_date": "2026-08-28",
"base": "USD",
"rates": {
"2026-08-21": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-08-23": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-08-28": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation Endpoint provides information about how currencies fluctuate on a day-to-day basis. This feature is particularly useful for traders and analysts who need to track price movements and volatility over time. By specifying a date range, users can retrieve detailed information about the fluctuations of various metals.
{
"success": true,
"fluctuation": true,
"start_date": "2026-08-21",
"end_date": "2026-08-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"
}
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price Endpoint allows users to query the API for open, high, low, and close prices for a specific time period. This data is essential for traders who analyze price movements and make trading decisions based on historical performance. By retrieving OHLC data, developers can build applications that provide insights into market trends and price behavior.
{
"success": true,
"timestamp": 1787876079,
"base": "USD",
"date": "2026-08-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"
}
Historical LME Endpoint
The Historical LME Endpoint provides access to historical rates for LME symbols dating back to 2008. This endpoint is particularly useful for developers working with metals traded on the London Metal Exchange, allowing them to retrieve historical price data for analysis and reporting.
API Key and Authentication
To access the Metals-API, users must obtain an API key, which is a unique identifier passed into the API base URL's access_key parameter. This key is essential for authentication and authorization, ensuring that only authorized users can access the data. Developers should keep their API keys secure and avoid exposing them in public repositories.
API Response and Data Structure
The API responses are structured in JSON format, providing a clear and concise representation of the requested data. Each response includes fields such as success, timestamp, base currency, date, rates, and unit. Understanding the significance of each field is crucial for developers to effectively utilize the data in their applications.
Common Use Cases
There are numerous use cases for the Metals-API, ranging from financial applications to market analysis tools. For instance, developers can create trading platforms that leverage real-time data to execute trades based on current market conditions. Additionally, analysts can use historical data to identify trends and make predictions about future price movements.
Conclusion
The Metals-API offers a comprehensive solution for developers seeking to retrieve historical prices of Special Drawing Rights (XDR) and other metals. With its robust features, including real-time rates, historical data, and various endpoints, the API empowers developers to build innovative applications that harness the power of metals data. By integrating this API into their projects, developers can gain valuable insights into market trends, optimize trading strategies, and enhance decision-making processes.
For more information on how to get started with the Metals-API, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols for a complete list of available currencies. The future of financial data integration is here, and with the Metals-API, developers are well-equipped to navigate this dynamic landscape.