Get {Symbol} prices using this API
Get XAU Prices Using This API
In the world of finance and investment, real-time data is crucial for making informed decisions. For those interested in precious metals, the XAU symbol, representing gold, is of particular significance. The Metals-API provides a powerful solution for accessing real-time and historical data on XAU prices, along with various other metals. This blog post will delve into the capabilities of the Metals-API, its key features, and how developers can leverage it to create innovative applications.
Metals-API Information
API Description
The Metals-API is a comprehensive JSON API that offers real-time and historical data on precious metals. With its advanced capabilities, developers can access up-to-date pricing information, historical trends, and various analytical tools. The API empowers developers to build next-generation applications that require accurate and timely metals data, facilitating better decision-making in trading, investment, and market analysis.
By utilizing the Metals-API, developers can integrate real-time pricing into their applications, enabling users to track fluctuations in the market, analyze trends, and make informed investment choices. The API's innovative design and robust functionality make it an essential tool for anyone working with precious metals.
Key Features and Endpoints
The Metals-API boasts a variety of endpoints that cater to different needs, allowing developers to access a wealth of information about XAU and other metals. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for XAU and other metals, updated every 60 minutes, 10 minutes, or even more frequently, depending on your subscription plan. This feature is essential for traders who need the most current pricing information.
- Historical Rates Endpoint: Access historical rates for XAU dating back to 2019. By appending a specific date to the API request, developers can retrieve past pricing data, which is invaluable for trend analysis and forecasting.
- Bid and Ask Endpoint: This feature allows users to retrieve real-time bid and ask prices for XAU, providing insights into the current market conditions and helping traders make informed decisions.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, enabling users to convert any amount of XAU to other currencies or vice versa. This is particularly useful for international traders and investors.
- Time-Series Endpoint: Developers can query the API for daily historical rates between two specified dates, allowing for detailed analysis of price movements over time.
- Fluctuation Endpoint: This endpoint provides information on how XAU prices fluctuate on a day-to-day basis, helping traders understand market volatility.
- Carat Endpoint: Users can retrieve information about gold rates by carat, which is essential for jewelers and those involved in the jewelry market.
- Lowest/Highest Price Endpoint: This feature allows users to query the API to get the lowest and highest prices of XAU over a specified period, aiding in market analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for XAU, which are crucial for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a broader context for market analysis.
- API Key: Each user is assigned a unique API key, which must be included in the API requests to authenticate and authorize access to the data.
- API Response: The Metals-API delivers exchange rates relative to USD by default, ensuring consistency and ease of use for developers.
- Available Endpoints: The API features 14 different endpoints, each designed to provide specific functionalities tailored to the needs of developers.
- 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: Retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for investors in the Indian market.
- News Endpoint: The Metals-API allows users to retrieve the latest news articles related to various metals, keeping developers and investors informed about market trends and developments.
List of Symbols
The Metals-API provides access to a comprehensive range of metal symbols, including XAU (Gold), XAG (Silver), XPT (Platinum), and XPD (Palladium). For a complete list of all supported symbols and their specifications, refer to the Metals-API Supported Symbols page.
API Endpoint Examples and Responses
To illustrate the functionality of the Metals-API, here are some examples of the API responses for various endpoints:
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1759968069,
"base": "USD",
"date": "2025-10-09",
"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": 1759881669,
"base": "USD",
"date": "2025-10-08",
"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-10-02",
"end_date": "2025-10-09",
"base": "USD",
"rates": {
"2025-10-02": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-10-04": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-10-09": {
"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": 1759968069,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2025-10-02",
"end_date": "2025-10-09",
"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": 1759968069,
"base": "USD",
"date": "2025-10-09",
"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": 1759968069,
"base": "USD",
"date": "2025-10-09",
"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 real-time and historical data on precious metals, particularly XAU. With its extensive range of endpoints, the API provides the necessary tools for building sophisticated applications that can analyze market trends, track price fluctuations, and convert currencies. By leveraging the capabilities of the Metals-API, developers can create innovative solutions that empower users to make informed investment decisions.
For more information on how to implement these features, refer to the Metals-API Documentation. Whether you are a seasoned developer or just starting, the Metals-API offers the resources you need to succeed in the world of precious metals trading.