Find Patna Gold 18k (PATN-18k) Historical Prices easily using this API
Introduction
In the ever-evolving landscape of precious metals trading, finding accurate historical prices for Gold (XAU) has become increasingly essential for investors and developers alike. The Metals-API provides a robust solution for accessing real-time and historical data, enabling users to make informed decisions based on comprehensive market insights. This blog post will delve into the capabilities of the Metals-API, focusing on how to easily retrieve historical prices for Patna Gold 18k (PATN-18k) and other gold variants using its innovative features.
Understanding Gold (XAU)
Gold has long been a symbol of wealth and stability, serving as a hedge against inflation and economic uncertainty. In recent years, the digital transformation in precious metals trading has revolutionized how investors access and analyze gold prices. With the integration of data analytics and technology, traders can now leverage real-time data to enhance their trading strategies.
The Metals-API stands at the forefront of this transformation, offering developers the tools needed to build next-generation applications that utilize real-time metals data. By harnessing the power of data analytics, users can gain valuable market insights, track price fluctuations, and make informed decisions based on historical trends.
API Description
The Metals-API is a powerful JSON API that provides access to real-time and historical prices for various metals, including gold, silver, platinum, and palladium. With its user-friendly interface and comprehensive documentation, developers can easily integrate the API into their applications. The API empowers users to retrieve data on demand, enabling them to build innovative solutions that cater to the needs of investors and traders.
For more detailed information, you can refer to the Metals-API Documentation, which outlines the various features and endpoints available.
Key Features and Endpoints
The Metals-API offers a wide range of features that cater to different trading needs. Here are some of the key endpoints that developers can utilize:
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 the subscription plan. This endpoint is crucial for traders who need to stay updated on the latest market prices.
{
"success": true,
"timestamp": 1782692050,
"base": "USD",
"date": "2026-06-29",
"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 essential for analyzing trends and making informed investment decisions. The Historical Rates Endpoint allows users to query historical rates dating back to 2019 by appending a specific date in the format YYYY-MM-DD. This feature is invaluable for traders looking to understand past price movements and market behavior.
{
"success": true,
"timestamp": 1782605650,
"base": "USD",
"date": "2026-06-28",
"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 allows users to retrieve real-time bid and ask prices for various metals. This information is crucial for traders looking to execute buy and sell orders at optimal prices.
{
"success": true,
"timestamp": 1782692050,
"base": "USD",
"date": "2026-06-29",
"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 need to quickly assess the value of their holdings in different currencies.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1782692050,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series Endpoint allows users to query the API for daily historical rates between two dates of their choice. This feature is essential for conducting in-depth analyses of price trends over specific periods.
{
"success": true,
"timeseries": true,
"start_date": "2026-06-22",
"end_date": "2026-06-29",
"base": "USD",
"rates": {
"2026-06-22": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-06-24": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-06-29": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation Endpoint provides insights into how currencies fluctuate on a day-to-day basis. This feature is useful for traders looking to understand market volatility and make informed trading decisions.
{
"success": true,
"fluctuation": true,
"start_date": "2026-06-22",
"end_date": "2026-06-29",
"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 allows users to retrieve the open, high, low, and close prices for a specific time period. This data is crucial for technical analysis and helps traders identify potential entry and exit points.
{
"success": true,
"timestamp": 1782692050,
"base": "USD",
"date": "2026-06-29",
"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 endpoint is particularly useful for users interested in analyzing the performance of metals traded on the London Metal Exchange.
For a complete list of all supported symbols and their specifications, refer to the Metals-API Supported Symbols page.
API Key and Authentication
To access the Metals-API, users must obtain an API key, which is 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. Proper management of API keys is crucial for maintaining security and preventing unauthorized access.
Understanding API Responses
The API responses delivered by the Metals-API are by default relative to USD, and all data is returned in a structured JSON format. Each response includes fields such as success, timestamp, base currency, date, rates, and unit, providing users with comprehensive information about the requested data.
For example, a successful response from the Latest Rates Endpoint includes the current rates for various metals, allowing users to quickly assess market conditions.
Common Use Cases and Implementation Strategies
Developers can leverage the Metals-API for various applications, including:
- Building trading platforms that require real-time price updates.
- Creating analytical tools that provide insights into historical price trends.
- Developing mobile applications that allow users to track metal prices on the go.
By integrating the Metals-API into their applications, developers can enhance user experiences and provide valuable market insights.
Performance Optimization and Scaling
When working with the Metals-API, developers should consider performance optimization strategies to ensure their applications run smoothly. This includes implementing caching mechanisms to reduce API calls, optimizing data retrieval processes, and managing rate limits effectively.
Scaling applications that utilize the Metals-API may also require careful planning, especially during periods of high market volatility. Developers should implement strategies to handle increased traffic and ensure that their applications remain responsive.
Security Considerations
Security is paramount when working with APIs. Developers should follow best practices for securing API keys, including storing them securely and not exposing them in client-side code. Additionally, implementing HTTPS for all API requests ensures that data is transmitted securely.
Regularly reviewing access logs and monitoring for unusual activity can help identify potential security threats and mitigate risks.
Conclusion
In conclusion, the Metals-API offers a comprehensive solution for accessing real-time and historical prices for Gold (XAU) and other metals. By leveraging its innovative features, developers can build powerful applications that provide valuable insights into the precious metals market. Whether you are a trader looking to analyze historical trends or a developer seeking to integrate real-time data into your applications, the Metals-API is an invaluable resource.
For more information on how to get started, visit the Metals-API Website and explore the extensive documentation available. With the right tools and insights, you can navigate the complexities of the metals market with confidence.