Retrieve real-time West African Cfa Franc (XOF) prices using this API
Retrieve Real-Time West African Cfa Franc (XOF) Prices Using Metals-API
The West African Cfa Franc (XOF) is a crucial currency in the economic landscape of West Africa, serving as a common currency for several countries in the region. As the demand for real-time financial data continues to grow, developers are increasingly looking for reliable APIs to access up-to-date currency exchange rates and metal prices. One such powerful tool is the Metals-API, which provides comprehensive access to real-time and historical data for various metals and currencies, including the XOF. This blog post will delve into the capabilities of the Metals-API, its innovative features, and how developers can leverage this API to build next-generation applications.
About West African Cfa Franc (XOF)
The West African Cfa Franc (XOF) is used by eight countries in West Africa, including Benin, Burkina Faso, CΓ΄te d'Ivoire, Guinea-Bissau, Mali, Niger, Senegal, and Togo. As a stable currency pegged to the Euro, the XOF plays a vital role in facilitating trade and investment in the region. With the rise of digital transformation in financial markets, the integration of technological innovations and data analytics is reshaping how businesses operate. The Metals-API stands at the forefront of this transformation, providing developers with the tools needed to access real-time data and insights.
API Description
The Metals-API is a powerful JSON API that provides real-time and historical data for metals and currencies. It empowers developers to create applications that require up-to-date information on metal prices, including gold, silver, platinum, and palladium, as well as currency exchange rates. By utilizing the Metals-API, developers can integrate advanced data analytics and smart technology into their applications, enabling them to make informed decisions based on real-time data.
For more detailed information, developers can refer to the Metals-API Documentation, which outlines the various endpoints and their functionalities. The API supports a wide range of symbols, which can be explored in the Metals-API Supported Symbols list.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different data needs. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals and currencies, updated every 60 minutes, every 10 minutes, or more frequently, depending on the subscription plan. Developers can easily access the latest rates for XOF against various metals.
- Historical Rates Endpoint: Historical rates are available for most currencies dating back to 2019. By appending a specific date (YYYY-MM-DD) to the endpoint, developers can retrieve past exchange rates, enabling them to analyze trends over time.
- Bid and Ask Endpoint: This feature allows developers to retrieve real-time bid and ask prices for metals, providing insights into market conditions and helping users make informed trading decisions.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint that enables users to convert amounts from one currency to another. This is particularly useful for businesses operating in multiple currencies.
- Time-Series Endpoint: Developers can query the API for daily historical rates between two specified dates, 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: Users can retrieve information about gold rates by carat, which is essential for jewelers and investors in the gold market.
- Lowest/Highest Price Endpoint: This endpoint allows developers to query the API for the lowest and highest prices of metals over a specified period, aiding in market analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: This feature provides open, high, low, and close prices for a specific date, which is crucial for traders looking to analyze market trends.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, allowing for comprehensive market analysis.
- API Key: Each user receives a unique API key that must be included in the API requests to authenticate access.
- API Response: The Metals-API delivers exchange rates relative to USD by default, ensuring consistency in data presentation.
- Available Endpoints: With 14 different API endpoints, developers have access to a wide range of functionalities tailored to their needs.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies and metals, ensuring developers have access to the latest data.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping users informed about market developments.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for developers. Below are examples of various endpoints and their JSON responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1776816745,
"base": "USD",
"date": "2026-04-22",
"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"
}
The response indicates a successful request, providing the latest exchange rates for various metals against USD. The "rates" object contains the current price for each metal, which developers can use to display real-time data in their applications.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1776730345,
"base": "USD",
"date": "2026-04-21",
"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 developers to analyze past market conditions. The "rates" object provides the price of each metal, which can be used for trend analysis.
Time-Series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2026-04-15",
"end_date": "2026-04-22",
"base": "USD",
"rates": {
"2026-04-15": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-04-17": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-04-22": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
The time-series response provides daily rates for the specified date range, allowing developers to visualize trends and fluctuations over time. Each date in the "rates" object contains the corresponding prices for the metals.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1776816745,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response illustrates how the conversion endpoint works, allowing users to convert a specified amount from one currency to another. The "result" field shows the converted amount, while the "info" object provides the exchange rate used for the conversion.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2026-04-15",
"end_date": "2026-04-22",
"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"
}
The fluctuation endpoint provides insights into how prices have changed over a specified period. The "change" and "change_pct" fields indicate the amount and percentage change, respectively, allowing developers to assess market volatility.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1776816745,
"base": "USD",
"date": "2026-04-22",
"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 the open, high, low, and close prices for a specific date, which is essential for traders looking to analyze market trends. Each metal's rates are clearly outlined, allowing for easy comparison.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1776816745,
"base": "USD",
"date": "2026-04-22",
"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"
}
The bid/ask endpoint provides current bid and ask prices, along with the spread for each metal. This information is crucial for traders as it helps them understand 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 for the West African Cfa Franc (XOF) and various metals. By leveraging the API's innovative features, developers can create applications that provide users with comprehensive insights into market trends and fluctuations. With endpoints that cater to a wide range of data needs, the Metals-API empowers developers to build next-generation applications that integrate advanced data analytics and smart technology.
For more information on how to get started with the Metals-API, visit the Metals-API Website and explore the Metals-API Documentation for detailed guidance on each endpoint. Additionally, check out the Metals-API Supported Symbols list to familiarize yourself with the available currencies and metals.