How to Get Real-Time Gold UAE 22 k (XAUUAE22) Prices with Metals-API

Introduction
Metals-API offers a robust solution for obtaining real-time gold prices in the UAE, specifically for 22k gold (XAUUAE22). This blog post will guide you through the process of accessing these real-time prices using the Metals-API, providing step-by-step instructions, detailed explanations of the API's capabilities, and practical examples of API calls.
Understanding Gold (XAU)
Metals-API Overview
Metals-API Website provides a comprehensive platform for accessing real-time and historical data for various metals, including gold, silver, platinum, and palladium. The API offers multiple endpoints that cater to different data needs, making it a versatile tool for developers and traders alike.
Metals-API Documentation, which outlines the various features and endpoints available.
Key Features of Metals-API
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated based on your subscription plan. You can receive updates every 60 minutes, every 10 minutes, or even more frequently, depending on your needs.
- Historical Rates Endpoint: Access historical rates dating back to 2019, allowing you to analyze trends over time. You can query specific dates to retrieve past rates.
- Bid and Ask Endpoint: Retrieve real-time bid and ask prices for metals, which is essential for traders looking to make informed buying and selling decisions.
- Convert Endpoint: Easily convert amounts between different metals or to/from USD, facilitating seamless transactions.
- Time-Series Endpoint: Query daily historical rates between two dates of your choice, enabling detailed analysis of price movements over time.
- Fluctuation Endpoint: Track how metal prices fluctuate on a day-to-day basis, providing insights into market volatility.
- Carat Endpoint: Access gold rates by carat, which is particularly useful for jewelers and consumers interested in specific gold purities.
- Lowest/Highest Price Endpoint: Retrieve the lowest and highest prices for a specific date, helping you understand market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: Get OHLC data for a specific time period, which is crucial for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, useful for comprehensive market analysis.
- API Key: Your unique API key is required for authentication and is passed into the API base URL's access_key parameter.
- API Response: The API delivers exchange rates relative to USD, ensuring consistency in data interpretation.
- Supported Symbols Endpoint: Retrieve a constantly updated list of all available currencies and metals.
- Gold Price India Endpoint: Specifically designed to retrieve the latest gold prices in India.
- News Endpoint: Access the latest news articles related to various metals, keeping you informed about market developments.
Accessing Real-Time Gold Prices
Step 1: Sign Up for Metals-API
Metals-API Website. After registration, you will receive an API key that will be used to authenticate your requests.
Step 2: Choose Your Subscription Plan
Step 3: Make Your First API Call
GET https://metals-api.com/api/latest?access_key=YOUR_API_KEY&base=USD&symbols=XAU
YOUR_API_KEY with your actual API key. This call will return the latest gold price in USD per troy ounce.
Step 4: Understanding the API Response
{
"success": true,
"timestamp": 1755129996,
"base": "USD",
"date": "2025-08-14",
"rates": {
"XAU": 0.000482
},
"unit": "per troy ounce"
}
- success: Indicates whether the API call was successful.
- timestamp: The time at which the data was retrieved.
- base: The base currency for the exchange rate (USD in this case).
- date: The date of the exchange rate.
- rates: An object containing the exchange rates for the requested symbols.
- unit: The unit of measurement for the rates (per troy ounce).
Exploring Additional Endpoints
Historical Rates Endpoint
GET https://metals-api.com/api/historical?access_key=YOUR_API_KEY&date=2025-08-13&base=USD&symbols=XAU
Time-Series Endpoint
GET https://metals-api.com/api/timeseries?access_key=YOUR_API_KEY&start_date=2025-08-07&end_date=2025-08-14&base=USD&symbols=XAU
Bid and Ask Endpoint
GET https://metals-api.com/api/bidask?access_key=YOUR_API_KEY&base=USD&symbols=XAU
Convert Endpoint
GET https://metals-api.com/api/convert?access_key=YOUR_API_KEY&from=XAU&to=USD&amount=1000
Fluctuation Endpoint
GET https://metals-api.com/api/fluctuation?access_key=YOUR_API_KEY&start_date=2025-08-07&end_date=2025-08-14&base=USD&symbols=XAU
Open/High/Low/Close (OHLC) Price Endpoint
GET https://metals-api.com/api/open-high-low-close?access_key=YOUR_API_KEY&date=2025-08-14&base=USD&symbols=XAU
Security and Best Practices
- Keep your API key confidential and do not expose it in public repositories.
- Implement rate limiting to avoid exceeding your subscription plan's limits.
- Handle errors gracefully and implement retry logic for failed requests.
- Validate and sanitize all inputs to prevent injection attacks.
Conclusion
Metals-API Documentation and discover the full range of capabilities available to you.