Retrieve Sri Lankan Rupee (LKR) Historical Prices via this API
Retrieve Sri Lankan Rupee (LKR) Historical Prices via this API
The Sri Lankan Rupee (LKR) is a vital currency in South Asia, and understanding its historical prices is essential for various financial analyses and decision-making processes. With the advent of technology, accessing historical currency data has become easier than ever. The Metals-API provides a powerful solution for developers looking to retrieve historical prices of the Sri Lankan Rupee and other currencies. This blog post will delve into the capabilities of the Metals-API, exploring its features, endpoints, and how it can be utilized to access LKR historical prices effectively.
About Sri Lankan Rupee (LKR)
The Sri Lankan Rupee (LKR) has undergone significant changes over the years, influenced by various economic factors, including inflation, trade balances, and foreign investments. As the world moves towards digital transformation, the metal markets are also evolving. The integration of smart technology and data analytics is reshaping how traders and investors interact with currency markets. The Metals-API stands at the forefront of this transformation, providing real-time data and insights that empower developers to create innovative applications.
Technological advancements have made it possible to analyze historical data effectively, allowing for better forecasting and decision-making. The Metals-API not only offers historical data but also provides insights into trends and fluctuations, enabling users to make informed choices. As we explore the features of the Metals-API, we will see how it can be leveraged to retrieve LKR historical prices and much more.
API Description
The Metals-API is a comprehensive JSON API designed to provide real-time and historical data for various metals and currencies, including the Sri Lankan Rupee. It empowers developers to build next-generation applications by offering a suite of endpoints that deliver accurate and timely data. The API is built with innovation in mind, allowing for seamless integration into existing systems and applications.
For more detailed information on how to use the API, developers can refer to the Metals-API Documentation. This resource provides comprehensive guidance on authentication, endpoint usage, and response structures.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for various currencies, including LKR. Depending on your subscription plan, the latest rates can be updated every 60 minutes or even more frequently. This feature is crucial for applications that require up-to-the-minute data.
- Historical Rates Endpoint: Developers can access historical rates for most currencies dating back to 2019. By appending a specific date to the endpoint, users can retrieve historical exchange rates, making it easier to analyze trends over time.
- Bid And Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices for metals and currencies. It is particularly useful for traders who need to make quick decisions based on market conditions.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, enabling users to convert amounts from one currency to another. This feature is essential for applications that require real-time conversion rates.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two specified dates. It is particularly useful for analyzing trends and fluctuations over specific periods.
- Fluctuation Endpoint: Users can track how currencies fluctuate on a day-to-day basis using this endpoint. It provides insights into the volatility of the LKR and other currencies, aiding in risk assessment.
- Carat Endpoint: This feature allows users to retrieve information about gold rates by carat. It is particularly relevant for those involved in the jewelry industry or precious metals trading.
- Lowest/Highest Price Endpoint: This endpoint enables users to query the API for the lowest and highest prices of metals and currencies over a specified period, providing valuable insights into market trends.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can access OHLC data for specific time periods, which is crucial for technical analysis and trading strategies.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, allowing users to analyze long-term trends in the metals market.
- API Key: To access the API, users must include their unique API key in the request. This key is essential for authentication and ensuring secure access to the data.
- API Response: The Metals-API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format. This makes it easy for developers to parse and utilize the data in their applications.
- Available Endpoints: The API offers a total of 14 endpoints, each designed to provide specific functionalities. Developers can explore these endpoints to find the ones that best suit their needs.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available currencies and metals, ensuring users have access to the latest information.
For a complete list of all supported symbols and their specifications, refer to the Metals-API Supported Symbols.
API Endpoint Examples and Responses
Understanding how to interpret 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": 1781136805,
"base": "USD",
"date": "2026-06-11",
"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": 1781050405,
"base": "USD",
"date": "2026-06-10",
"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-04",
"end_date": "2026-06-11",
"base": "USD",
"rates": {
"2026-06-04": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-06-06": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-06-11": {
"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": 1781136805,
"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-04",
"end_date": "2026-06-11",
"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": 1781136805,
"base": "USD",
"date": "2026-06-11",
"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": 1781136805,
"base": "USD",
"date": "2026-06-11",
"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 robust and flexible solution for developers looking to retrieve historical prices of the Sri Lankan Rupee (LKR) and other currencies. With its comprehensive suite of endpoints, the API allows for real-time data access, historical analysis, and currency conversion, making it an invaluable tool for financial applications.
By leveraging the capabilities of the Metals-API, developers can create applications that not only track currency fluctuations but also provide insights into market trends and investment opportunities. For more information on how to get started, visit the Metals-API Website and explore the Metals-API Documentation for detailed guidance on implementation.
As the financial landscape continues to evolve, staying informed and utilizing advanced tools like the Metals-API will be crucial for success in the ever-changing world of currency trading and investment.