How to retrieve Patna Gold 18k (PATN-18k) prices using this API
Introduction
In the ever-evolving landscape of precious metals trading, the ability to retrieve accurate and real-time data is paramount for investors and developers alike. One such valuable asset is Patna Gold 18k (PATN-18k), a symbol representing a specific quality of gold. To effectively track and analyze the prices of PATN-18k, developers can leverage the Metals-API, a powerful tool designed to provide comprehensive data on various metals, including gold. This blog post will delve into the capabilities of the Metals-API, explore the intricacies of gold trading, and provide insights into how to effectively utilize this API for retrieving gold prices.
Metals-API Information
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a cornerstone of wealth and investment. As a digital transformation takes place in the precious metals market, the integration of technology and data analytics is reshaping how investors approach gold trading. The Metals-API facilitates this transformation by providing real-time data analytics and market insights, enabling developers to create innovative applications that enhance trading strategies.
With the rise of digital asset solutions, the importance of accurate price discovery has never been more critical. The Metals-API empowers developers to access real-time gold prices, historical data, and various analytical tools that can be integrated into trading platforms, mobile applications, and financial dashboards. This technological advancement not only streamlines the trading process but also enhances decision-making through data-driven insights.
API Description
The Metals-API is a robust platform that offers a wide range of functionalities for accessing metals data. It provides developers with the tools necessary to build next-generation applications that require real-time and historical data on precious metals. The API's capabilities include retrieving the latest rates, historical prices, and even fluctuations over time, all of which are essential for informed trading decisions.
One of the standout features of the Metals-API is its ability to deliver real-time exchange rate data, updated at intervals depending on the user's subscription plan. This ensures that developers can access the most current information available, which is crucial for trading strategies that rely on timely data. Additionally, the API supports a variety of endpoints that cater to different needs, from historical analysis to currency conversion.
Key Features and Endpoints
The Metals-API offers a plethora 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 for various metals, including gold. Depending on the subscription plan, users can receive updates every 60 minutes or even every 10 minutes, ensuring they have access to the latest market information.
- Historical Rates Endpoint: Users can access historical rates dating back to 2019. By appending a specific date to the API request, developers can retrieve past prices, which is invaluable for trend analysis and forecasting.
- Bid And Ask Endpoint: This feature allows users to obtain real-time bid and ask prices for metals, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The Metals-API includes a currency conversion feature that enables users to convert amounts between different metals or to/from USD. This is particularly useful for traders dealing in multiple currencies.
- Time-Series Endpoint: This endpoint allows users to query daily historical rates between two specified dates, making it easier to analyze trends over time.
- Fluctuation Endpoint: Users can track how metal prices fluctuate between two dates, providing insights into market volatility.
- Carat Endpoint: This feature allows users to retrieve gold rates by carat, which is essential for jewelers and consumers interested in specific gold qualities.
- Lowest/Highest Price Endpoint: This endpoint enables users 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: Users can access OHLC data for specific time periods, which is crucial for technical analysis and trading strategies.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, allowing for comprehensive market analysis.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate access to the API.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API features 14 different endpoints, each offering unique functionalities tailored to various user needs.
- Supported Symbols Endpoint: This endpoint provides a constantly updated list of all available currencies and metals, ensuring users have access to the latest symbols.
- News Endpoint: Users can retrieve the latest news articles related to various metals, keeping them informed about market trends and 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 Metals-API Supported Symbols page. This resource is invaluable for developers looking to integrate specific metals into their applications.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for effective implementation. Below are examples of various API endpoints and their corresponding JSON responses.
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1763683442,
"base": "USD",
"date": "2025-11-21",
"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"
}
This response indicates that the current price of gold (XAU) is 0.000482 per troy ounce, with similar data for other metals.
Historical Rates Endpoint
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1763597042,
"base": "USD",
"date": "2025-11-20",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response shows the historical price of gold on a specific date, allowing users to analyze price trends over time.
Time-series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2025-11-14",
"end_date": "2025-11-21",
"base": "USD",
"rates": {
"2025-11-14": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-11-16": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-11-21": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time-series analysis of gold prices over a specified period, which is essential for identifying trends and making predictions.
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": 1763683442,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response indicates that 1000 USD converts to 0.482 troy ounces of gold, showcasing the utility of the conversion feature.
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2025-11-14",
"end_date": "2025-11-21",
"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"
}
This response provides insights into how gold prices have changed over a specified period, which is crucial for traders looking to capitalize on market movements.
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1763683442,
"base": "USD",
"date": "2025-11-21",
"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 open, high, low, and close prices for gold, which is essential for technical analysis and trading strategies.
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1763683442,
"base": "USD",
"date": "2025-11-21",
"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"
}
This response provides the current bid and ask prices for gold, which is essential for traders looking to make informed buying and selling decisions.
Conclusion
The Metals-API is an invaluable resource for developers and traders seeking to access real-time and historical data on precious metals like Patna Gold 18k (PATN-18k). By leveraging the various endpoints and features offered by the API, users can create sophisticated applications that enhance their trading strategies and provide deeper insights into market trends.
With capabilities such as real-time pricing, historical analysis, and conversion features, the Metals-API empowers developers to build innovative solutions that meet the demands of the modern trading environment. For more information on how to implement these features, refer to the Metals-API Documentation and explore the extensive range of supported symbols on the Metals-API Supported Symbols page.
In conclusion, the integration of technology in precious metals trading is not just a trend; it is a necessity for those looking to stay competitive in the market. By utilizing the Metals-API, developers can harness the power of real-time data to make informed decisions and drive innovation in their trading applications.