Get Gold UAE 22 k (XAUUAE22) - Per Gram Historical Prices for Financial Modeling using this API

Introduction
In the ever-evolving landscape of financial modeling, the ability to access accurate and timely data is paramount. One of the most sought-after commodities in this realm is gold, represented by the symbol XAU. For developers and analysts looking to harness historical prices for gold in the UAE, the Metals-API provides a robust solution. This blog post will delve into the intricacies of obtaining historical prices for gold (XAUUAE22) using the Metals-API, exploring its features, capabilities, and the transformative potential of real-time metals data.
About Gold (XAU)
Gold has long been regarded as a safe haven asset, a hedge against inflation, and a symbol of wealth. In recent years, the digital transformation in precious metals has opened new avenues for trading and investment. The integration of technology in trading platforms has enabled investors to access real-time data, analyze market trends, and make informed decisions. With the rise of data analytics, market insights derived from historical price data have become invaluable for financial modeling.
The Metals-API stands at the forefront of this digital transformation, providing developers with the tools necessary to build next-generation applications that leverage real-time metals data. By utilizing the Metals-API, developers can create innovative solutions that enhance price discovery and offer digital asset solutions tailored to the needs of modern investors.
Digital Transformation in Precious Metals
The digital transformation in the precious metals market has led to a significant shift in how investors interact with gold and other metals. With the advent of APIs like Metals-API, users can access a wealth of information at their fingertips. This transformation is characterized by:
- Real-Time Data Access: The ability to retrieve up-to-the-minute prices and historical data allows traders to make swift decisions based on current market conditions.
- Data Analytics: Advanced analytics tools can process vast amounts of data to uncover trends and insights that were previously difficult to discern.
- Integration of Technology: The seamless integration of trading platforms with APIs enables automated trading strategies and enhances user experience.
API Description
The Metals-API is a powerful tool designed to provide developers with access to real-time and historical data for various metals, including gold. Its capabilities empower users to build applications that can analyze market trends, track price fluctuations, and convert between different currencies. The API's innovative features include:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data updated every 60 minutes or more frequently. This feature is essential for traders who need immediate access to current prices.
- 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 past prices, which are crucial for financial modeling and analysis.
- Bid and Ask Endpoint: This endpoint provides real-time bid and ask prices, allowing traders to gauge market sentiment and make informed decisions.
- Convert Endpoint: The API includes a currency conversion feature that enables users to convert amounts from one currency to another, facilitating transactions across different markets.
- Time-Series Endpoint: This feature allows users to query daily historical rates between two specified dates, providing a comprehensive view of price movements over time.
- Fluctuation Endpoint: Users can track how prices fluctuate on a day-to-day basis, offering insights into market volatility and trends.
- Carat Endpoint: This endpoint provides information about gold rates by carat, catering to jewelers and consumers interested in specific gold qualities.
- Lowest/Highest Price Endpoint: Users can query the API to obtain the lowest and highest prices for a given date, which is vital for understanding market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint delivers open, high, low, and close prices for a specific date, essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a long-term perspective on metal prices.
- API Key: Each user is assigned a unique API key, which is required for authentication and access to the API's features.
- API Response: The API delivers exchange rates relative to USD, ensuring consistency and ease of use.
- Available Endpoints: The Metals-API offers a comprehensive list of endpoints, each designed to fulfill specific data retrieval needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies, allowing users to explore the full range of options.
- Gold Price India Endpoint: Retrieve the latest gold price in India, catering to a specific market segment.
- News Endpoint: Stay updated with the latest news articles related to various metals, providing context to market movements.
Key Features and Endpoints
Understanding the various endpoints and their functionalities is crucial for developers looking to leverage the Metals-API effectively. Below, we explore some of the key features in detail:
Latest Rates Endpoint
The Latest Rates Endpoint is designed to provide real-time exchange rates for all available metals. Depending on your subscription plan, the API can return data updated every 60 minutes, every 10 minutes, or even more frequently. This feature is particularly useful for traders who require immediate access to current market conditions.
{
"success": true,
"timestamp": 1749974413,
"base": "USD",
"date": "2025-06-15",
"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, the rates object contains the current exchange rates for various metals, with gold (XAU) priced at 0.000482 per troy ounce.
Historical Rates Endpoint
The Historical Rates Endpoint allows users to access historical exchange rates for any date since 1999. By appending a specific date to the API request, developers can retrieve past prices, which are essential for financial modeling and analysis.
{
"success": true,
"timestamp": 1749888013,
"base": "USD",
"date": "2025-06-14",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response provides the historical rates for gold and other metals on a specific date, allowing users to analyze price trends over time.
Time-Series Endpoint
The Time-Series Endpoint enables users to query the API for daily historical rates between two dates of their choice. This feature is particularly useful for analyzing trends and patterns over a specified period.
{
"success": true,
"timeseries": true,
"start_date": "2025-06-08",
"end_date": "2025-06-15",
"base": "USD",
"rates": {
"2025-06-08": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-06-10": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-06-15": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time series of gold prices over a specified period, allowing for in-depth analysis of price movements.
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. This feature is particularly useful for traders and investors who need to quickly assess the value of their holdings in different currencies.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1749974413,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
In this response, the result field indicates that 1000 USD is equivalent to 0.482 troy ounces of gold, providing valuable information for traders.
Fluctuation Endpoint
The Fluctuation Endpoint allows users to track rate fluctuations between two dates. This feature is essential for understanding market volatility and making informed trading decisions.
{
"success": true,
"fluctuation": true,
"start_date": "2025-06-08",
"end_date": "2025-06-15",
"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 detailed information about the fluctuations in gold prices over the specified period, including percentage changes.
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price Endpoint provides open, high, low, and close prices for a specific time period. This data is crucial for technical analysis and helps traders identify trends and potential entry and exit points.
{
"success": true,
"timestamp": 1749974413,
"base": "USD",
"date": "2025-06-15",
"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 provides a comprehensive view of gold's price action over the specified period, allowing traders to make informed decisions based on historical performance.
Bid/Ask Endpoint
The Bid/Ask Endpoint provides current bid and ask prices for metals, enabling traders to gauge market sentiment and make informed decisions. This feature is essential for understanding the spread between buying and selling prices.
{
"success": true,
"timestamp": 1749974413,
"base": "USD",
"date": "2025-06-15",
"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 the current bid and ask prices for gold, silver, and platinum, allowing traders to assess market conditions effectively.
Common Developer Questions
As developers begin to integrate the Metals-API into their applications, they may encounter common questions and challenges. Here are some frequently asked questions:
How do I authenticate with the Metals-API?
Authentication is achieved by including your unique API key in the access_key parameter of your API requests. This key is essential for accessing the API's features and ensuring secure communication.
What are the rate limits for API requests?
Rate limits vary based on your subscription plan. It's important to review the documentation to understand the specific limits and ensure your application adheres to them to avoid throttling.
How can I handle errors in API responses?
API responses include a success field that indicates whether the request was successful. In the event of an error, the response will contain an error message detailing the issue. Implementing robust error handling in your application will enhance user experience and reliability.
Conclusion
The Metals-API offers a comprehensive solution for developers seeking to access historical prices for gold (XAU) and other metals. By leveraging its extensive features, including real-time rates, historical data, and advanced analytics, developers can create innovative applications that cater to the needs of modern investors. The digital transformation in precious metals trading, driven by technology integration and data analytics, has opened new avenues for financial modeling and investment strategies.
For those looking to explore the capabilities of the Metals-API further, be sure to check out the Metals-API Documentation for detailed information on endpoints and usage. Additionally, the Metals-API Supported Symbols page provides a comprehensive list of available metal symbols, ensuring you have all the information you need to make informed decisions.
In conclusion, the Metals-API is not just a tool; it is a gateway to understanding the dynamics of precious metals in today's digital economy. By harnessing its capabilities, developers can unlock the potential of real-time metals data and drive innovation in financial modeling.