Collect MTL Historical Prices for Time Series Analysis using this API
Introduction
The Maltese Lira (MTL) has a rich history, and understanding its historical prices is crucial for time series analysis, especially in the context of metals trading. With the advent of APIs like Metals-API, developers can easily access real-time and historical data for various metals, including Gold (XAU). This blog post will delve into how to collect historical prices for Gold using the Metals-API, exploring its features, capabilities, and practical applications for developers.
Understanding Metals-API
Metals-API is a powerful tool designed for developers looking to integrate real-time and historical metals data into their applications. This API provides a comprehensive suite of endpoints that allow users to access exchange rates, historical data, and various functionalities related to metals trading. By leveraging the capabilities of Metals-API, developers can create innovative applications that provide insights into market trends and fluctuations.
About Maltese Lira (MTL)
The Maltese Lira was the currency of Malta before the country adopted the Euro. Although it is no longer in circulation, its historical significance remains relevant, particularly in the context of financial analysis and economic studies. The digital transformation in metal markets has made it essential for developers to utilize advanced technologies and data analytics to gain insights into market behavior. The Metals-API plays a pivotal role in this transformation, enabling developers to access real-time data and historical trends that can inform decision-making.
API Description
The Metals-API offers a robust set of features that empower developers to build next-generation applications. With capabilities to retrieve real-time exchange rates, historical data, and perform currency conversions, the API stands out as a valuable resource for anyone involved in metals trading. The API is designed with innovation in mind, allowing for seamless integration into various applications, from financial dashboards to trading platforms.
For more information, you can visit the Metals-API Website and explore the Metals-API Documentation for detailed guidance on implementation.
Key Features and Endpoints
Metals-API provides a variety of endpoints, each serving a unique purpose. Here are some of the key features:
Latest Rates Endpoint
The Latest Rates Endpoint allows users to retrieve real-time exchange rate data for metals. Depending on the subscription plan, this endpoint can return data updated every 60 minutes or even every 10 minutes. This feature is crucial for developers who need up-to-the-minute information to make informed trading decisions.
Historical Rates Endpoint
Accessing historical rates is essential for time series analysis. The Historical Rates Endpoint allows users to query historical exchange rates for most currencies dating back to 2019. By appending a specific date to the API request, developers can obtain valuable historical data that can be used for trend analysis and forecasting.
Bid and Ask Endpoint
The Bid and Ask Endpoint provides real-time bid and ask prices for metals, which is vital for traders looking to make informed buying and selling decisions. This feature allows developers to integrate live market data into their applications, enhancing user experience and decision-making capabilities.
Convert Endpoint
The Convert Endpoint enables users to convert amounts from one currency to another. This feature is particularly useful for developers who need to provide currency conversion functionalities within their applications. By specifying the amount and the currencies involved, users can easily obtain conversion rates.
Time-Series Endpoint
The Time-Series Endpoint allows developers to query daily historical rates between two dates of their choice. This feature is particularly useful for analyzing trends over specific periods, enabling developers to create insightful visualizations and reports based on historical data.
Fluctuation Endpoint
Using the Fluctuation Endpoint, developers can track how currencies fluctuate on a day-to-day basis. This feature provides insights into market volatility, allowing users to make informed decisions based on historical fluctuations.
Carat Endpoint
The Carat Endpoint provides information about Gold rates by carat. This feature is particularly useful for jewelers and traders dealing with gold in various purities. By appending a base to the API request, users can obtain specific carat rates.
Lowest/Highest Price Endpoint
The Lowest/Highest Price Endpoint allows users to query the API for the lowest and highest prices of metals over a specified period. This feature is essential for traders looking to identify price trends and make strategic decisions based on historical price data.
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price Endpoint provides users with open, high, low, and close prices for a specific time period. This data is crucial for technical analysis, enabling traders to assess market conditions and make informed trading decisions.
Historical LME Endpoint
The Historical LME Endpoint provides access to historical rates for LME symbols dating back to 2008. This feature is particularly useful for developers looking to analyze historical data specific to the London Metal Exchange.
API Key and Response
To access the Metals-API, users must obtain an API key, which is passed into the API base URL's access_key parameter. The API responds with exchange rates relative to USD, ensuring that all data is returned in a consistent format.
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 structure of API responses is crucial for developers. Below are examples of various endpoints and their corresponding JSON responses.
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1781655342,
"base": "USD",
"date": "2026-06-17",
"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": 1781568942,
"base": "USD",
"date": "2026-06-16",
"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": "2026-06-10",
"end_date": "2026-06-17",
"base": "USD",
"rates": {
"2026-06-10": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-06-12": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-06-17": {
"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": 1781655342,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2026-06-10",
"end_date": "2026-06-17",
"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": 1781655342,
"base": "USD",
"date": "2026-06-17",
"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": 1781655342,
"base": "USD",
"date": "2026-06-17",
"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
In conclusion, the Metals-API provides a comprehensive solution for developers looking to access historical prices for Gold (XAU) and other metals. By utilizing the various endpoints available, developers can gather valuable data for time series analysis, enabling them to make informed decisions in the metals market. The API's capabilities, including real-time rates, historical data, and conversion functionalities, make it an essential tool for anyone involved in metals trading.
For further exploration, developers are encouraged to review the Metals-API Documentation and familiarize themselves with the Metals-API Supported Symbols to maximize their use of this powerful API.