API Guide: Get Graphite Africa (AF-GR) Historical Prices
Introduction
In the rapidly evolving world of finance and commodities, having access to accurate and timely data is crucial for making informed decisions. One of the most sought-after metals in the market is Gold, represented by the symbol XAU. With the help of the Metals-API, developers can easily access historical prices for Gold and other metals, enabling them to build applications that leverage real-time and historical data. This blog post will guide you through the process of obtaining historical prices for Gold using the Metals-API, while also exploring its various features and capabilities.
Understanding Gold (XAU) and Its Market Dynamics
Gold has been a symbol of wealth and a standard for monetary systems for centuries. Its value is influenced by various factors, including market demand, geopolitical stability, and economic indicators. As a developer, understanding these dynamics is essential when working with the Metals-API to fetch historical prices and analyze trends.
The Role of Digital Transformation in Metal Markets
The integration of technology in the metal markets has transformed how traders and investors access and analyze data. The Metals-API exemplifies this transformation by providing a robust platform for accessing real-time and historical metal prices. By leveraging data analytics and insights, developers can create applications that not only track prices but also predict future trends based on historical data.
Technological Innovation and Advancement
With the advent of APIs, accessing complex datasets has become more straightforward. The Metals-API allows developers to retrieve data with ease, enabling them to focus on building innovative applications. The API's capabilities extend beyond mere data retrieval; it empowers developers to integrate smart technology solutions that can analyze price fluctuations, historical trends, and market conditions.
API Description
The Metals-API is a powerful tool designed for developers looking to access metals prices and currency conversion data. It provides a comprehensive suite of endpoints that allow users to retrieve real-time and historical data for various metals, including Gold (XAU). The API is built with a focus on innovation, enabling developers to create next-generation applications that can analyze and visualize metal price trends.
For more detailed information, you can refer to the Metals-API Documentation, which outlines all available features and endpoints.
Key Features of the Metals-API
The Metals-API offers a variety of endpoints that cater to different data retrieval needs. Here are some of the key features:
Latest Rates Endpoint
The Latest Rates endpoint provides real-time exchange rate data for metals, updated based on your subscription plan. Depending on your plan, you can receive updates every 60 minutes, every 10 minutes, or even more frequently. This feature is essential for applications that require up-to-the-minute pricing information.
Historical Rates Endpoint
Accessing historical rates is crucial for analyzing trends and making informed decisions. The Historical Rates endpoint allows you to query prices dating back to 2019. By appending a specific date in the format YYYY-MM-DD, you can retrieve historical prices for Gold and other metals.
{
"success": true,
"timestamp": 1787530535,
"base": "USD",
"date": "2026-08-24",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Bid And Ask Endpoint
This endpoint provides real-time Bid and Ask prices for metals, allowing traders to make informed decisions based on current market conditions. The Bid and Ask prices are essential for understanding the spread and liquidity of the metal market.
Convert Endpoint
The Convert endpoint enables users to convert any amount from one currency to another. This feature is particularly useful for applications that require currency conversion for transactions involving metals.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1787616935,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series endpoint allows you to query the API for daily historical rates between two dates of your choice. This feature is invaluable for developers looking to analyze price trends over specific periods.
{
"success": true,
"timeseries": true,
"start_date": "2026-08-18",
"end_date": "2026-08-25",
"base": "USD",
"rates": {
"2026-08-18": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-08-20": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-08-25": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation endpoint provides insights into how metal prices fluctuate on a day-to-day basis. By tracking rate changes between two dates, developers can gain valuable insights into market volatility.
{
"success": true,
"fluctuation": true,
"start_date": "2026-08-18",
"end_date": "2026-08-25",
"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"
}
Open/High/Low/Close (OHLC) Price Endpoint
This endpoint allows users to retrieve the open, high, low, and close prices for a specific time period. This data is crucial for traders looking to analyze market trends and make informed trading decisions.
{
"success": true,
"timestamp": 1787616935,
"base": "USD",
"date": "2026-08-25",
"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"
}
Historical LME Endpoint
The Historical LME endpoint provides access to historical rates for LME symbols dating back to 2008. This feature is particularly useful for developers interested in analyzing long-term trends in metal prices.
API Key and Authentication
To access the Metals-API, you will need an API key, which is a unique identifier passed into the API base URL's access_key parameter. This key is essential for authenticating your requests and ensuring secure access to the API's features.
API Response Structure
The API delivers exchange rates relative to USD by default. All data is returned in a structured JSON format, making it easy for developers to parse and utilize the information in their applications.
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.
Practical Use Cases and Integration Strategies
Developers can leverage the Metals-API in various applications, including:
- Trading Platforms: Integrate real-time and historical price data to provide users with insights into market trends.
- Financial Analysis Tools: Use historical data to analyze price movements and predict future trends.
- Portfolio Management Applications: Track the performance of metal investments over time.
Conclusion
In conclusion, the Metals-API offers a powerful suite of tools for developers looking to access real-time and historical prices for Gold and other metals. By understanding the various endpoints and their capabilities, developers can create innovative applications that leverage this data for trading, analysis, and market insights. With features like the Latest Rates, Historical Rates, and Time-Series endpoints, the API provides a comprehensive solution for accessing metal market data. For more information, explore the Metals-API Documentation and start building your applications today.