Access Pakistan Gold 18k (XAUPAK18) Historical Prices through this API
Access Pakistan Gold 18k (XAUPAK18) Historical Prices through this API
In the ever-evolving landscape of precious metals trading, access to real-time and historical data is paramount for developers and traders alike. Gold, represented by the symbol XAU, has long been a cornerstone of financial markets, serving as a safe haven and a hedge against inflation. With the advent of APIs like Metals-API, obtaining historical prices for gold and other metals has never been easier. This blog post delves into the capabilities of the Metals-API, focusing on how developers can leverage its features to access historical prices for Gold (XAU) and other precious metals.
About Gold (XAU)
Gold has been a symbol of wealth and prosperity for centuries. In today's digital age, the transformation of gold trading through technology is reshaping how investors and developers interact with this precious metal. The integration of data analytics and market insights allows for more informed decision-making, while innovations in price discovery are enhancing the trading experience. The Metals-API plays a crucial role in this transformation, providing developers with the tools needed to build next-generation applications that can analyze and visualize gold prices effectively.
As the demand for digital asset solutions grows, understanding the historical prices of gold becomes essential. The Metals-API offers a comprehensive suite of features that empower developers to access this data seamlessly. By utilizing the API, developers can create applications that not only track current prices but also analyze historical trends, providing valuable insights into market behavior.
API Description
The Metals-API is a powerful tool designed for developers looking to access real-time and historical data on precious metals. With its innovative approach to data delivery, the API enables users to build applications that can respond to market changes in real-time. The API's capabilities extend beyond simple price retrieval; it offers a range of endpoints that facilitate complex queries and data analysis.
For more information, you can visit the Metals-API Website and explore the Metals-API Documentation for detailed guidance on implementation.
Key Features and Endpoints
The Metals-API provides a variety of endpoints that cater to different needs. Here are some of the key features:
- 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 feature is essential for applications that require up-to-the-minute pricing information.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. By appending a specific date (YYYY-MM-DD) to the endpoint, developers can retrieve historical data for analysis and reporting.
- Bid And Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices, providing insights into market liquidity and trading opportunities.
- Convert Endpoint: The conversion endpoint enables users to convert any amount from one currency to another, facilitating transactions and financial calculations.
- 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: Retrieve information about how currencies fluctuate on a day-to-day basis, which is crucial for understanding market volatility.
- Carat Endpoint: This endpoint provides information about gold rates by carat, allowing for precise calculations in jewelry and precious metal trading.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specified date, which can be useful for identifying market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: Access detailed OHLC data for a specific time period, which is vital for technical analysis and trading strategies.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a comprehensive view of market trends.
- API Key: Your unique API key is essential for accessing the API and must be included in the request.
- API Response: The API delivers exchange rates relative to USD, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API features 14 endpoints, each designed to provide specific functionalities tailored to user needs.
- Supported Symbols Endpoint: Access a constantly updated list of all available currencies and metals.
- Intraday Endpoint: Query intraday exchange rate data for a single symbol, which is essential for high-frequency trading applications.
List of Symbols
The 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
Get real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1788307932,
"base": "USD",
"date": "2026-09-02",
"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": 1788221532,
"base": "USD",
"date": "2026-09-01",
"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-08-26",
"end_date": "2026-09-02",
"base": "USD",
"rates": {
"2026-08-26": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-08-28": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-09-02": {
"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": 1788307932,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2026-08-26",
"end_date": "2026-09-02",
"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": 1788307932,
"base": "USD",
"date": "2026-09-02",
"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": 1788307932,
"base": "USD",
"date": "2026-09-02",
"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 framework for accessing historical prices and real-time data for gold and other precious metals. By leveraging its various endpoints, developers can create applications that not only track current prices but also analyze historical trends, providing valuable insights into market behavior. The ability to access detailed information about fluctuations, bid/ask prices, and OHLC data empowers developers to build sophisticated trading applications that can respond to market changes in real-time.
For those looking to dive deeper into the world of precious metals trading, the Metals-API Documentation is an invaluable resource. Additionally, the Metals-API Supported Symbols page offers a comprehensive list of available symbols, ensuring that developers have access to the data they need.
As the financial landscape continues to evolve, staying informed and equipped with the right tools is essential. The Metals-API stands out as a leading solution for developers seeking to harness the power of real-time and historical metals data, paving the way for innovative applications in the world of finance.