Get Patna Gold 18k (PATN-18k) Historical Prices for Market Analysis using this API
Introduction
In the world of precious metals trading, having access to accurate and timely data is crucial for making informed decisions. One of the most sought-after metals is gold, represented by the symbol XAU. For traders, investors, and developers looking to analyze historical prices of gold, the Metals-API offers a robust solution. This blog post will delve into how to retrieve historical prices for Patna Gold 18k (PATN-18k) using the Metals-API, exploring its features, capabilities, and practical applications in market analysis.
Metals-API Information
About Gold (XAU)
Gold has long been a symbol of wealth and stability, and its value is influenced by various factors, including market demand, geopolitical events, and economic indicators. In recent years, the digital transformation in precious metals trading has revolutionized how investors access and analyze market data. The integration of data analytics and technology has enabled traders to gain deeper insights into market trends and price movements.
With the rise of digital asset solutions, the importance of real-time data has never been more pronounced. The Metals-API provides developers with the tools necessary to build next-generation applications that can harness the power of real-time metals data. By leveraging this API, users can innovate in price discovery and enhance their trading strategies.
API Description
The Metals-API is a powerful tool that offers a wide range of functionalities for accessing metals prices and historical data. It empowers developers to create applications that can analyze market trends, track price fluctuations, and convert currencies seamlessly. The API's capabilities are designed to support various use cases, from simple price retrieval to complex data analysis.
For detailed documentation on how to use the API, visit the Metals-API Documentation. This resource provides comprehensive guidance on the API's features, endpoints, and usage examples.
Key Features and Endpoints
The Metals-API offers several key features that can be utilized for market analysis:
- 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 traders who need the most current market information.
- Historical Rates Endpoint: Users can access historical rates for most currencies dating back to 2019. By appending a specific date to the API request, developers can retrieve historical price data, which is invaluable for trend analysis and forecasting.
- Bid And Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The API includes a currency conversion endpoint that enables users to convert any amount from one currency to another, facilitating seamless transactions across different metals and currencies.
- Time-Series Endpoint: This endpoint allows users to query the API for daily historical rates between two dates of their choice, making it easier to analyze price movements over time.
- Fluctuation Endpoint: Users can track how currencies fluctuate on a day-to-day basis, providing insights into market volatility and trends.
- Carat Endpoint: This feature allows users to retrieve information about gold rates by carat, which is particularly useful for jewelers and consumers interested in purchasing gold jewelry.
- Lowest/Highest Price Endpoint: This endpoint allows users to query the API to get the lowest and highest price for a specified date, aiding in market analysis and decision-making.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can retrieve open, high, low, and close prices for a specific date, 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: The API key is a unique identifier that must be included in API requests to authenticate and authorize access to the API.
- API Response: The API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format.
- Available Endpoints: The Metals-API includes 14 different endpoints, each providing unique functionalities for users.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, ensuring users have access to the latest information.
- News Endpoint: Users can retrieve the latest news articles related to various metals, keeping them informed about market 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 essential for developers looking to integrate specific metals into their applications.
API Endpoint Examples and Responses
Understanding the API's response structure is crucial for effective integration. Below are examples of various endpoints and their responses:
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1764144131,
"base": "USD",
"date": "2025-11-26",
"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 the current exchange rates for various metals, with XAU representing gold.
Historical Rates Endpoint
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1764057731,
"base": "USD",
"date": "2025-11-25",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response provides historical rates for gold and other metals, allowing for in-depth analysis of price trends over time.
Time-series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2025-11-19",
"end_date": "2025-11-26",
"base": "USD",
"rates": {
"2025-11-19": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-11-21": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-11-26": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response allows users to analyze how gold prices have changed over a specified period, providing valuable insights for traders.
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": 1764144131,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows how much gold can be purchased with a specified amount of USD, which is crucial for investment decisions.
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2025-11-19",
"end_date": "2025-11-26",
"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 and other metals have fluctuated over a specific period, which is essential for understanding market dynamics.
OHLC (Open/High/Low/Close) Price Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1764144131,
"base": "USD",
"date": "2025-11-26",
"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 critical data for traders looking to analyze market trends and make informed decisions based on historical performance.
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1764144131,
"base": "USD",
"date": "2025-11-26",
"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 insights into the current market conditions for gold and other metals, helping traders make timely decisions.
Conclusion
In conclusion, the Metals-API offers a comprehensive suite of tools for accessing historical prices and real-time data for precious metals like gold. By utilizing endpoints such as the Latest Rates, Historical Rates, and Time-Series, developers can build powerful applications that enhance market analysis and trading strategies. The API's capabilities extend beyond simple price retrieval, enabling users to analyze fluctuations, convert currencies, and access critical market news.
For developers looking to integrate these features into their applications, the Metals-API Documentation provides all the necessary information to get started. Additionally, the Metals-API Supported Symbols page is an invaluable resource for understanding the various metals available for analysis.
As the digital landscape continues to evolve, leveraging APIs like Metals-API will be essential for staying ahead in the competitive world of precious metals trading. Embrace the power of real-time data and analytics to make informed decisions and optimize your trading strategies.