Get Gold UAE 22 k (XAUUAE22) - Per Gram Historical Data with this API

Get Gold UAE 22 k (XAUUAE22) - Per Gram Historical Data with this API
In the ever-evolving landscape of precious metals trading, the demand for accurate and timely data has never been greater. For developers and traders alike, having access to real-time and historical data on gold prices is crucial for making informed decisions. This is where the Metals-API comes into play, offering a robust solution for retrieving historical prices of gold, specifically the 22 karat gold (XAUUAE22) in the UAE market. In this blog post, we will explore the capabilities of the Metals-API, focusing on how to obtain historical prices and the innovative features that make it a powerful tool for developers.
About Gold (XAU)
Gold has long been regarded as a safe haven asset, particularly during times of economic uncertainty. Its value is influenced by various factors, including market demand, geopolitical events, and currency fluctuations. The digital transformation in precious metals trading has opened new avenues for data analytics and market insights. With the integration of technology in trading, developers can leverage real-time data to enhance their applications and provide users with innovative solutions for price discovery and investment strategies.
The Metals-API provides a comprehensive suite of tools that empower developers to access gold price data efficiently. By utilizing this API, you can gain insights into market trends, analyze historical data, and even integrate gold pricing into your applications seamlessly. The API supports various endpoints that cater to different needs, from retrieving the latest rates to accessing historical data dating back to 2019.
API Description
The Metals-API is designed to provide developers with a powerful and flexible way to access metals pricing data. Its capabilities include real-time updates, historical data retrieval, and various endpoints that cater to different use cases. The API is built with innovation in mind, allowing developers to create next-generation applications that can analyze and visualize precious metals data effectively.
One of the standout features of the Metals-API is its ability to deliver real-time exchange rate data. Depending on your subscription plan, the API can return updates every 60 minutes or even every 10 minutes, ensuring that you have the most current information at your fingertips. This is particularly important for traders who need to make quick decisions based on market movements.
For those interested in historical data, the Metals-API offers a dedicated endpoint that allows you to query historical rates by appending a specific date. This feature is invaluable for analyzing trends over time and making informed investment decisions. Additionally, the API provides a fluctuation endpoint that tracks how prices change day-to-day, giving you insights into market volatility.
With the Metals-API Documentation, developers can easily navigate through the various endpoints and understand how to implement them effectively. The documentation provides comprehensive details on each endpoint's functionality, parameters, and example responses, making it easier for developers to integrate the API into their applications.
Key Features and Endpoints
The Metals-API offers a wide range of features that cater to different aspects of metals trading. Here are some of the key endpoints and their potential applications:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for various metals, including gold. Depending on your subscription plan, you can receive updates every 60 minutes or more frequently. This is essential for traders who need to stay informed about the latest market prices.
- Historical Rates Endpoint: Access historical exchange rates for any date since 2019. This endpoint allows you to analyze past price movements and trends, which can be crucial for making informed trading decisions. For example, you can query the API for historical rates by appending a specific date to the endpoint.
- Bid And Ask Endpoint: This powerful feature enables you to retrieve real-time bid and ask prices for metals. Understanding the bid-ask spread is vital for traders looking to optimize their entry and exit points in the market.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, allowing you to convert any amount from one metal to another or to/from USD. This is particularly useful for traders dealing in multiple currencies.
- Time-Series Endpoint: This endpoint allows you to query the API for daily historical rates between two dates of your choice. This feature is beneficial for analyzing trends over specific periods and making data-driven decisions.
- Fluctuation Endpoint: With this endpoint, you can track how prices fluctuate between two dates. This information is crucial for understanding market volatility and making strategic trading decisions.
- Carat Endpoint: This endpoint provides information about gold rates by carat. It allows you to retrieve specific pricing data based on the purity of gold, which is essential for jewelers and traders in the jewelry market.
- Lowest/Highest Price Endpoint: This feature allows you to query the API to get the lowest and highest price for a specific date. This information is valuable for traders looking to identify price extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, giving traders a comprehensive view of price movements throughout the trading day.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008. This endpoint is particularly useful for those interested in industrial metals.
- API Key: Your unique API key is essential for accessing the Metals-API. It must be included in the API base URL's access_key parameter to authenticate your requests.
- API Response: The exchange rates delivered by the Metals-API are by default relative to USD. Understanding the structure of the API response is crucial for developers to effectively utilize the data.
- Available Endpoints: The Metals-API comes with multiple endpoints, each providing different functionalities. Familiarizing yourself with these endpoints will enable you to maximize the API's potential.
- Supported Symbols Endpoint: This endpoint returns all available currencies and metals, ensuring that you have access to the most up-to-date information on supported symbols.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for traders operating in the Indian market.
- News Endpoint: The Metals-API allows you to retrieve the latest news articles related to various metals, keeping you informed about market developments.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for effective implementation. Below are examples of various API endpoints along with their expected JSON responses.
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1747634560,
"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": 1747548160,
"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": 1747634560,
"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) Price Endpoint
Get OHLC data for a specific time period.
{
"success": true,
"timestamp": 1747634560,
"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": 1747634560,
"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 a powerful tool for developers looking to access real-time and historical data on precious metals, particularly gold. With its comprehensive suite of endpoints, developers can build applications that provide valuable insights into market trends, price fluctuations, and investment opportunities. By leveraging the capabilities of the Metals-API, you can enhance your trading strategies and make informed decisions based on accurate data.
For more information on how to implement the Metals-API in your applications, refer to the Metals-API Documentation. To explore the full range of supported symbols, visit the Metals-API Supported Symbols page. The Metals-API Website also provides additional resources and support for developers looking to integrate metals data into their projects.