Get Afghan Afghani (AFN) Historical Prices with this API Guide
Introduction
In today's rapidly evolving financial landscape, obtaining accurate and historical pricing data for currencies like the Afghan Afghani (AFN) is crucial for developers and businesses alike. The Metals-API provides a robust solution for accessing real-time and historical data on various metals and currencies, including the AFN. This guide will explore how to leverage the Metals-API to retrieve historical prices, delve into its features, and discuss the transformative potential of real-time data in the metal markets.
Understanding the Metals-API
The Metals-API is a powerful tool designed for developers seeking to integrate real-time and historical pricing data into their applications. It offers a wide array of endpoints that cater to various needs, from accessing the latest exchange rates to retrieving historical data dating back several years. The API is built on a foundation of technological innovation, allowing for seamless integration and data analytics capabilities that empower developers to create next-generation applications.
About Nickel (NI)
Nickel is a key metal in various industries, particularly in the production of stainless steel and batteries. The digital transformation in metal markets has led to significant advancements in how data is collected, analyzed, and utilized. With the integration of smart technology, businesses can now harness data analytics to gain insights into market trends and make informed decisions. The Metals-API plays a vital role in this transformation by providing developers with the tools needed to access and analyze metal prices in real-time.
API Description
The Metals-API is designed to empower developers by providing access to a wealth of data related to metals and currencies. With its innovative architecture, the API allows for real-time data retrieval, enabling applications to display the most current pricing information. The API's capabilities extend beyond mere data access; it facilitates the integration of advanced analytics and insights, allowing businesses to stay ahead of market trends.
For comprehensive documentation on how to utilize the API effectively, visit the Metals-API Documentation. Here, you will find detailed information on endpoints, parameters, and response structures.
Key Features and Endpoints
The Metals-API boasts a variety of endpoints, each designed to serve specific purposes. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data, updated based on your subscription plan. Depending on the plan, updates can occur every 60 minutes or even every 10 minutes, ensuring you have the most current information at your fingertips.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. By appending a specific date (in the format YYYY-MM-DD) to the endpoint, you can retrieve past pricing data, which is invaluable for trend analysis and forecasting.
- Bid And Ask Endpoint: This feature allows you to retrieve real-time bid and ask prices, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The API includes a currency conversion feature, enabling you to convert amounts from one currency to another seamlessly. This is particularly useful for applications that require multi-currency support.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, allowing for in-depth analysis of price movements over time.
- Fluctuation Endpoint: This endpoint provides information on how currencies fluctuate on a day-to-day basis, offering insights into market volatility.
- Carat Endpoint: Retrieve information about gold rates by carat, which is essential for jewelers and gold traders.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specified date, helping you identify market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint allows you to obtain open, high, low, and close prices for a specific date, which is crucial for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a long-term view of metal prices.
- API Key: Your unique API key is essential for accessing the API and must be included in your requests.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: With 14 different API endpoints, the Metals-API offers a comprehensive suite of functionalities to meet diverse needs.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, ensuring you have the latest information on supported symbols. For a complete list, refer to the Metals-API Supported Symbols.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping you 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 Symbols page.
API Endpoint Examples and Responses
Latest Rates Endpoint
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1778026757,
"base": "USD",
"date": "2026-05-06",
"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": 1777940357,
"base": "USD",
"date": "2026-05-05",
"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-04-29",
"end_date": "2026-05-06",
"base": "USD",
"rates": {
"2026-04-29": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-05-01": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-05-06": {
"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": 1778026757,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2026-04-29",
"end_date": "2026-05-06",
"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": 1778026757,
"base": "USD",
"date": "2026-05-06",
"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": 1778026757,
"base": "USD",
"date": "2026-05-06",
"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 offers a comprehensive solution for developers looking to access real-time and historical pricing data for metals and currencies, including the Afghan Afghani (AFN). With its wide range of endpoints, the API enables seamless integration into applications, empowering businesses to make informed decisions based on accurate data. By leveraging the capabilities of the Metals-API, developers can create innovative applications that harness the power of real-time data analytics, ultimately transforming the way metal markets operate.
For further exploration of the API's features, refer to the Metals-API Documentation and stay updated with the latest supported symbols on the Symbols page. The future of metal pricing data is here, and with the Metals-API, you can be at the forefront of this transformation.