Utilize this API to get
Utilize this API to Get Real-Time Metals Data
In today's fast-paced financial landscape, having access to real-time data is crucial for developers and businesses alike. The Metals-API provides a powerful solution for obtaining up-to-date information on various metals, including XAU (Gold), XAG (Silver), XPT (Platinum), and XPD (Palladium). This blog post will delve into the capabilities of the Metals-API, its key features, and how developers can leverage it to build innovative applications that require accurate and timely metals data.
Metals-API Information
API Description
The Metals-API is designed to provide developers with real-time and historical data on metal prices, enabling them to create applications that require precise financial information. With its robust architecture, the API supports a variety of endpoints that cater to different data needs, from the latest exchange rates to historical trends dating back several years. The transformative potential of this API lies in its ability to empower developers to build next-generation applications that can analyze market trends, perform currency conversions, and track fluctuations in metal prices.
For more detailed information, visit the Metals-API Website or check out the Metals-API Documentation.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that serve different purposes, allowing developers to access a wealth of information. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated based on your subscription plan. Depending on your plan, you can receive updates every 60 minutes, every 10 minutes, or even more frequently. This feature is essential for applications that require the most current pricing information.
- Historical Rates Endpoint: Access historical rates for most metals dating back to 2019. By appending a specific date (YYYY-MM-DD) to the endpoint, developers can retrieve past exchange rates, which is invaluable for trend analysis and forecasting.
- Bid and Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices for metals. It is particularly useful for trading applications that need to display current market conditions.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint that enables users to convert any amount from one metal to another or to/from USD. This functionality is crucial for applications that deal with multiple currencies and require seamless conversions.
- Time-Series Endpoint: This endpoint allows developers to query the API for daily historical rates between two specified dates. It is particularly useful for analyzing trends over time and understanding market movements.
- Fluctuation Endpoint: Track how metal prices fluctuate on a day-to-day basis. This endpoint provides insights into market volatility, helping developers build applications that can alert users to significant price changes.
- Carat Endpoint: Retrieve information about Gold rates by Carat. This feature is particularly useful for jewelers and those in the luxury goods market.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest prices for a specified date range. This information is essential for traders looking to make informed decisions based on historical price extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, which is crucial for technical analysis in trading.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008. This endpoint is particularly useful for those involved in the trading of metals on the London Metal Exchange.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate access to the API.
- API Response: The Metals-API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: With 14 different API endpoints, developers have a wide range of functionalities at their disposal.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available metal symbols, allowing developers to stay informed about the latest offerings.
- News Endpoint: Retrieve the latest news articles related to various metals, providing context and insights into market movements.
List of Symbols
The Metals-API provides access to a comprehensive range of metal symbols. For a complete list of all supported symbols and their specifications, refer to the Metals-API Supported Symbols page.
API Endpoint Examples and Responses
Understanding the API responses is crucial for effective integration. Here are examples of responses from various endpoints:
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1772842341,
"base": "USD",
"date": "2026-03-07",
"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"
}
This response indicates a successful request, providing the latest rates for various metals relative to USD.
Historical Rates Endpoint
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1772755941,
"base": "USD",
"date": "2026-03-06",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response shows the historical rates for a specific date, allowing developers to analyze past market conditions.
Time-series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2026-02-28",
"end_date": "2026-03-07",
"base": "USD",
"rates": {
"2026-02-28": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-03-02": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-03-07": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time series of rates, allowing developers to visualize trends over a specified period.
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": 1772842341,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows the conversion of 1000 USD to its equivalent in Gold (XAU), providing both the rate and the result.
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2026-02-28",
"end_date": "2026-03-07",
"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 insights into how metal prices have changed over a specified period, highlighting both the absolute and percentage changes.
OHLC (Open/High/Low/Close) Price Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1772842341,
"base": "USD",
"date": "2026-03-07",
"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 the open, high, low, and close prices for metals, which are essential for traders performing technical analysis.
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1772842341,
"base": "USD",
"date": "2026-03-07",
"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, along with the spread, which is crucial for traders looking to make informed decisions.
Conclusion
The Metals-API is an invaluable resource for developers seeking to integrate real-time metals data into their applications. With its extensive range of endpoints, including the latest rates, historical data, and conversion capabilities, the API empowers developers to create sophisticated financial tools that can analyze market trends and provide users with actionable insights. By leveraging the capabilities of the Metals-API, developers can build applications that not only meet the demands of today's market but also anticipate the needs of tomorrow.
For further exploration of the API's capabilities, be sure to check out the Metals-API Documentation and the Metals-API Supported Symbols page. With the right tools and data at your fingertips, the possibilities for innovation are endless.