How to retrieve Peruvian Sol (PEN) prices using this API
In today's rapidly evolving financial landscape, the ability to retrieve and analyze real-time currency data is paramount for developers and businesses alike. One such currency that has gained attention is the Peruvian Sol (PEN). In this blog post, we will explore how to effectively retrieve PEN prices using the Metals-API, a powerful tool that provides real-time and historical data on various metals and currencies. We will delve into the features of this API, its endpoints, and how it can be utilized to enhance your applications.
About Peruvian Sol (PEN)
The Peruvian Sol (PEN) is the official currency of Peru, a country rich in mineral resources and a significant player in the global metals market. As digital transformation continues to reshape financial markets, the integration of technology in currency exchange and metal pricing is becoming increasingly vital. The Metals-API stands at the forefront of this transformation, offering developers the tools they need to access and analyze real-time data.
Digital Transformation in Metal Markets
As the world moves towards a more digital economy, the metal markets are also experiencing a shift. The integration of smart technologies and data analytics is enabling businesses to make informed decisions based on real-time data. The Metals-API allows developers to tap into this wealth of information, providing insights that can drive strategic decisions and enhance operational efficiency.
Technological Innovation and Advancement
The Metals-API is a prime example of technological innovation in the financial sector. By offering a comprehensive suite of endpoints, it empowers developers to build applications that can retrieve the latest rates, historical data, and even perform currency conversions. This level of accessibility to data is crucial for businesses looking to stay competitive in a fast-paced market.
Data Analytics and Insights
With the Metals-API, developers can leverage data analytics to gain insights into market trends and fluctuations. The API provides various endpoints that allow users to track historical rates, analyze time-series data, and monitor fluctuations over time. This capability is essential for businesses that rely on accurate pricing information to make informed decisions.
Smart Technology Integration
Integrating smart technology into financial applications is no longer a luxury but a necessity. The Metals-API facilitates this integration by providing a robust framework for accessing real-time data. Developers can create applications that not only retrieve data but also analyze and visualize it, providing users with a comprehensive understanding of market dynamics.
Future Trends and Possibilities
As we look to the future, the potential for innovation in the financial sector is limitless. The Metals-API is designed to evolve with these trends, offering new features and capabilities that will empower developers to create next-generation applications. By harnessing the power of real-time data, businesses can position themselves for success in an increasingly competitive landscape.
API Description
The Metals-API is a powerful tool that provides access to real-time and historical data on various metals and currencies, including the Peruvian Sol (PEN). This API is designed to empower developers to build applications that require accurate and timely data. With a focus on innovation and technological advancement, the Metals-API offers a range of features that can transform how businesses interact with financial data.
Key Features and Endpoints
The Metals-API comes equipped with several key features that enhance its functionality:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently. This ensures that users have access to the most current pricing information.
- Historical Rates Endpoint: Users can access historical rates dating back to 2019 by appending a specific date to the API request. This feature is invaluable for analyzing trends and making informed decisions based on past performance.
- Bid and Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices for various metals, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint that enables users to convert amounts from one currency to another, facilitating seamless transactions across different currencies.
- Time-Series Endpoint: This endpoint allows users to query daily historical rates between two dates of their choice, enabling detailed analysis of price movements over time.
- Fluctuation Endpoint: Users can track how currencies fluctuate on a day-to-day basis, providing insights into market volatility and trends.
- Carat Endpoint: This endpoint allows users to retrieve information about gold rates by carat, catering to specific market needs.
- Lowest/Highest Price Endpoint: Users can query the API to get the lowest and highest prices for a specified date, aiding in market analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific time period, essential for traders and analysts.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, allowing for comprehensive market analysis.
- API Key: Each user is assigned a unique API key that must be included in API requests, 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.
- Available Endpoints: The API offers a total of 14 endpoints, each providing different functionalities tailored to user needs.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, ensuring users have access to the latest information.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping users informed about market 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
Latest Rates Endpoint
The Latest Rates Endpoint allows users to get real-time exchange rates for all available metals. Here’s an example response:
{
"success": true,
"timestamp": 1773187860,
"base": "USD",
"date": "2026-03-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"
}
This response provides the latest exchange rates for various metals, allowing users to make informed decisions based on current market conditions.
Historical Rates Endpoint
Accessing historical exchange rates is crucial for analyzing market trends. Here’s an example response from the Historical Rates Endpoint:
{
"success": true,
"timestamp": 1773101460,
"base": "USD",
"date": "2026-03-10",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response shows historical rates for a specific date, allowing users to analyze past performance and make predictions about future trends.
Time-Series Endpoint
The Time-Series Endpoint enables users to get exchange rates for a specific time period. Here’s an example response:
{
"success": true,
"timeseries": true,
"start_date": "2026-03-04",
"end_date": "2026-03-11",
"base": "USD",
"rates": {
"2026-03-04": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-03-06": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-03-11": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily historical rates between two specified dates, allowing users to track price movements over time.
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. Here’s an example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1773187860,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows the conversion of 1000 USD to gold (XAU), providing users with the equivalent amount in troy ounces.
Fluctuation Endpoint
The Fluctuation Endpoint allows users to track rate fluctuations between two dates. Here’s an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2026-03-04",
"end_date": "2026-03-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"
}
This response provides insights into how the rates for various metals have fluctuated over a specified period, which is essential for market analysis.
OHLC (Open/High/Low/Close) Price Endpoint
The OHLC Price Endpoint provides open, high, low, and close prices for a specific time period. Here’s an example response:
{
"success": true,
"timestamp": 1773187860,
"base": "USD",
"date": "2026-03-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"
}
This response provides a comprehensive view of the price movements for various metals over a specified period, aiding traders in making informed decisions.
Bid/Ask Endpoint
The Bid/Ask Endpoint allows users to get current bid and ask prices for metals. Here’s an example response:
{
"success": true,
"timestamp": 1773187860,
"base": "USD",
"date": "2026-03-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"
}
This response provides the current bid and ask prices for various metals, allowing traders to assess market conditions and make informed trading decisions.
Conclusion
The Metals-API is an invaluable resource for developers looking to access real-time and historical data on metals and currencies, including the Peruvian Sol (PEN). By leveraging the various endpoints offered by the API, developers can create applications that provide insights into market trends, facilitate currency conversions, and track price fluctuations. As the financial landscape continues to evolve, the ability to harness real-time data will be crucial for businesses aiming to stay competitive.
For more information on how to implement the Metals-API in your applications, refer to the Metals-API Documentation. Explore the full range of supported symbols on the Metals-API Supported Symbols page, and start building your next-generation financial applications today!