The Easiest Way to Get Sri Lankan Rupee (LKR) Historical Rates via API Integration
The Easiest Way to Get Sri Lankan Rupee (LKR) Historical Rates via API Integration
In today's fast-paced financial landscape, accessing historical currency rates is crucial for developers, analysts, and businesses alike. The Sri Lankan Rupee (LKR) is no exception, and obtaining its historical rates can be seamlessly achieved through the Metals-API. This blog post will guide you through the process of retrieving LKR historical prices using the Metals-API, detailing its features, endpoints, and practical applications.
Understanding Metals-API
The Metals-API is a powerful tool that provides real-time and historical data for various metals and currencies, including the Sri Lankan Rupee. It is designed to empower developers to create next-generation applications that require accurate and timely financial data. With its robust architecture, the Metals-API allows for seamless integration into applications, enabling users to access a wealth of information at their fingertips.
About Tellurium (TE)
While the focus here is on the Sri Lankan Rupee, it's worth noting the broader context of metals and their markets. The digital transformation in metal markets is reshaping how data is collected, analyzed, and utilized. Technological innovations, such as data analytics and smart technology integration, are paving the way for future trends in the industry. As developers, understanding these shifts can enhance your ability to leverage APIs like Metals-API for insightful applications.
API Description
The Metals-API offers a comprehensive suite of features that allow developers to access real-time and historical metals data. Its capabilities include retrieving the latest rates, historical prices, bid and ask prices, and much more. This API is particularly valuable for those looking to integrate financial data into their applications, providing the necessary tools to build sophisticated financial solutions.
Key Features and Endpoints
One of the standout features of the Metals-API is its ability to deliver real-time exchange rate data. Depending on your subscription plan, the API's latest rates endpoint can return data updated every 60 minutes or even more frequently. This ensures that you have access to the most current information available.
For historical rates, the Metals-API allows you to query data dating back to 2019. By appending a specific date in the format YYYY-MM-DD to your request, you can easily access past exchange rates for the Sri Lankan Rupee. This is particularly useful for financial analysis, reporting, and trend evaluation.
The API also features a Bid and Ask endpoint, which provides real-time bid and ask prices for various metals. This functionality is essential for traders and financial analysts who need to make informed decisions based on current market conditions.
Another valuable feature is the Convert endpoint, which allows users to convert amounts from one currency to another. This is particularly useful for applications that require currency conversion functionalities, enabling seamless transactions across different currencies.
The Time-Series endpoint is another powerful tool, allowing users to query daily historical rates between two specified dates. This can be particularly beneficial for analyzing trends over time and making data-driven decisions.
Additionally, the Fluctuation endpoint provides insights into how currencies fluctuate on a day-to-day basis. This feature is crucial for understanding market volatility and making informed trading decisions.
The Metals-API also includes endpoints for retrieving information about Gold rates by Carat, as well as the lowest and highest prices for specified dates. The Open/High/Low/Close (OHLC) Price endpoint provides detailed price information for specific time periods, which is essential for technical analysis.
For those interested in LME symbols, the Historical LME endpoint allows access to historical rates dating back to 2008, providing a wealth of data for analysis.
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. This resource is invaluable for developers looking to integrate specific metals or currencies into their applications.
API Endpoint Examples and Responses
Latest Rates Endpoint
The Latest Rates endpoint allows you to get real-time exchange rates for all available metals. Here is an example response:
{
"success": true,
"timestamp": 1782865241,
"base": "USD",
"date": "2026-07-01",
"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 using the Historical Rates endpoint. Here is an example response:
{
"success": true,
"timestamp": 1782778841,
"base": "USD",
"date": "2026-06-30",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-series Endpoint
The Time-series endpoint allows you to get exchange rates for a specific time period. Here is an example response:
{
"success": true,
"timeseries": true,
"start_date": "2026-06-24",
"end_date": "2026-07-01",
"base": "USD",
"rates": {
"2026-06-24": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-06-26": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-07-01": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Convert Endpoint
The Convert endpoint allows you to convert any amount from one metal to another or to/from USD. Here is an example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1782865241,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
The Fluctuation endpoint allows you to track rate fluctuations between two dates. Here is an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2026-06-24",
"end_date": "2026-07-01",
"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
The OHLC endpoint provides open, high, low, and close data for a specific time period. Here is an example response:
{
"success": true,
"timestamp": 1782865241,
"base": "USD",
"date": "2026-07-01",
"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
The Bid/Ask endpoint provides current bid and ask prices for metals. Here is an example response:
{
"success": true,
"timestamp": 1782865241,
"base": "USD",
"date": "2026-07-01",
"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, accessing historical rates for the Sri Lankan Rupee (LKR) has never been easier thanks to the Metals-API Documentation. By utilizing its various endpoints, developers can retrieve real-time and historical data, perform currency conversions, and analyze market fluctuations. The comprehensive features of the Metals-API make it an invaluable resource for anyone looking to integrate financial data into their applications.
Whether you're a developer building a financial application or an analyst conducting market research, the Metals-API provides the tools you need to succeed. Explore the Metals-API Website today and unlock the potential of real-time metals data.