Using this API to
Using the Metals-API to Access 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 accessing up-to-date information on various metals, including precious metals like Gold (XAU), Silver (XAG), Platinum (XPT), and Palladium (XPD). This blog post will delve into the capabilities of the Metals-API, its key features, and how developers can leverage this API to build innovative applications that require accurate and timely metals data.
Metals-API Information
API Description
The Metals-API is a robust JSON API that offers real-time and historical data on metal prices and currency conversions. With its innovative design, the API empowers developers to create next-generation applications that can analyze market trends, track price fluctuations, and perform currency conversions seamlessly. Whether you are building a trading platform, a financial analysis tool, or an e-commerce site that deals with precious metals, the Metals-API provides the necessary data to enhance your application's functionality.
For more information about the API, visit the Metals-API Website. You can also check the Metals-API Documentation for detailed guidance on implementation.
Key Features and Endpoints
The Metals-API boasts a variety of endpoints that cater to different data needs. 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.
- Historical Rates Endpoint: Access historical rates dating back to 2019. By appending a specific date (in YYYY-MM-DD format) to your query, you can retrieve past exchange rates for any metal.
- Bid and Ask Endpoint: This feature allows you to retrieve real-time bid and ask prices for metals, providing insights into market conditions and helping traders make informed decisions.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint that enables you to convert any amount from one metal to another or to/from USD. This is particularly useful for businesses that deal with multiple currencies.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice. This endpoint is invaluable for analyzing trends over time.
- Fluctuation Endpoint: Retrieve information about how metal prices fluctuate on a day-to-day basis, allowing you to track market volatility.
- Carat Endpoint: Get information about Gold rates by carat. This feature is essential for jewelers and businesses that require precise measurements.
- Lowest/Highest Price Endpoint: Query the API to find the lowest and highest prices for a specific metal over a given period.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides the open, high, low, and close prices for a specific time period, which is crucial for traders analyzing market performance.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, allowing for comprehensive market analysis.
- API Key: Your API Key is essential for accessing the API and is passed into the base URL's access_key parameter.
- API Response: The Metals-API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The API offers 14 endpoints, each designed to provide specific functionalities, making it a versatile tool for developers.
- Supported Symbols Endpoint: This endpoint returns all available metal symbols, ensuring you have access to the latest data.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping you informed about market trends and developments.
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 how to interact with the Metals-API is crucial for effective implementation. Below are examples of various endpoints along with their expected JSON responses.
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1773447122,
"base": "USD",
"date": "2026-03-14",
"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 query, 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": 1773360722,
"base": "USD",
"date": "2026-03-13",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows how to retrieve historical data, which is essential for trend analysis and market research.
Time-Series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2026-03-07",
"end_date": "2026-03-14",
"base": "USD",
"rates": {
"2026-03-07": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-03-09": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-03-14": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time-series view of exchange rates, allowing for detailed analysis 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": 1773447122,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This example illustrates how to convert a specified amount of USD into Gold (XAU), providing both the conversion rate and the result.
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2026-03-07",
"end_date": "2026-03-14",
"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 details the fluctuations in metal prices over a defined period, which is vital for traders and analysts.
OHLC (Open/High/Low/Close) Price Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1773447122,
"base": "USD",
"date": "2026-03-14",
"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 endpoint provides essential price data for traders, allowing them to analyze market movements effectively.
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1773447122,
"base": "USD",
"date": "2026-03-14",
"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, which are critical for traders looking to make informed decisions in real-time.
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 Rates, and Conversion capabilities, the API offers a comprehensive solution for accessing and analyzing metal prices. By leveraging the power of this API, developers can create innovative applications that provide users with the insights they need to navigate the complex world of metals trading.
For further exploration of the API's capabilities, be sure to check out the Metals-API Documentation and the Metals-API Supported Symbols page. The potential applications of the Metals-API are vast, and with the right implementation, you can unlock new opportunities in the financial technology space.