Get Pakistan Gold 18k (XAUPAK18) prices using this API
Introduction
In the ever-evolving landscape of precious metals trading, obtaining accurate and real-time data is crucial for making informed decisions. For those interested in the gold market, particularly the 18k gold prices in Pakistan (XAUPAK18), leveraging an efficient API can significantly enhance trading strategies. The Metals-API provides developers with the tools necessary to access comprehensive data on gold and other metals, facilitating a deeper understanding of market dynamics.
About Gold (XAU)
Gold, represented by the symbol XAU, is not just a commodity; it is a symbol of wealth and stability. In recent years, the digital transformation of precious metals trading has opened new avenues for investors and traders alike. The integration of data analytics and market insights allows for a more nuanced approach to trading, enabling stakeholders to make decisions based on real-time data rather than historical trends alone.
Moreover, technology integration in trading platforms has revolutionized how traders interact with the market. Innovations in price discovery mechanisms have made it possible to obtain accurate pricing information almost instantaneously. As a result, digital asset solutions are becoming increasingly popular among investors looking to diversify their portfolios with precious metals.
API Description
The Metals-API is a powerful tool that provides real-time and historical data on various metals, including gold. This API empowers developers to build next-generation applications that can analyze market trends, track price fluctuations, and convert currencies seamlessly. With its robust features, the Metals-API stands out as a transformative solution for anyone involved in the precious metals market.
For more information on how to utilize this API, refer to the Metals-API Documentation, which offers comprehensive guidance on implementation and usage.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs within the precious metals trading ecosystem. Here are some of the key features:
Latest Rates Endpoint
The Latest Rates Endpoint provides real-time exchange rate data for various metals, updated every 60 minutes, 10 minutes, or even more frequently, depending on your subscription plan. This feature is essential for traders who need to make quick decisions based on the latest market conditions.
{
"success": true,
"timestamp": 1786493286,
"base": "USD",
"date": "2026-08-12",
"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
Accessing historical rates is crucial for understanding market trends over time. The Historical Rates Endpoint allows users to query data dating back to 2019, enabling comprehensive analysis of price movements.
{
"success": true,
"timestamp": 1786406886,
"base": "USD",
"date": "2026-08-11",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Bid And Ask Endpoint
The Bid and Ask Endpoint is a powerful feature that provides real-time bid and ask prices for metals. This information is vital for traders looking to execute orders at the best possible prices.
{
"success": true,
"timestamp": 1786493286,
"base": "USD",
"date": "2026-08-12",
"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"
}
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. This feature is particularly useful for traders who operate in multiple currencies and need quick conversions.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1786493286,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series Endpoint enables users to query daily historical rates between two specified dates. This feature is invaluable for analyzing trends and making predictions based on past performance.
{
"success": true,
"timeseries": true,
"start_date": "2026-08-05",
"end_date": "2026-08-12",
"base": "USD",
"rates": {
"2026-08-05": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-08-07": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-08-12": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation Endpoint allows users to track rate fluctuations between two dates. This is particularly useful for traders who want to understand volatility and make informed decisions based on market behavior.
{
"success": true,
"fluctuation": true,
"start_date": "2026-08-05",
"end_date": "2026-08-12",
"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
The OHLC Price Endpoint provides essential data for traders looking to analyze market trends over specific periods. This endpoint returns the open, high, low, and close prices for a given date.
{
"success": true,
"timestamp": 1786493286,
"base": "USD",
"date": "2026-08-12",
"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 essential for users interested in analyzing long-term trends in the metals market.
API Key and Authentication
To access the Metals-API, users must obtain an API Key, which is a unique identifier passed into the API base URL's access_key parameter. This key is essential for authentication and ensures that only authorized users can access the data.
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.
Conclusion
In conclusion, the Metals-API is an invaluable resource for developers and traders interested in the gold market and other precious metals. With its extensive features, including real-time rates, historical data, and various endpoints for different functionalities, this API empowers users to make informed trading decisions. By integrating the Metals-API into their applications, developers can harness the power of real-time data analytics and market insights, ultimately enhancing their trading strategies and outcomes.
For further exploration of the API's capabilities, visit the Metals-API Website and dive into the Metals-API Documentation for detailed implementation guidance.