The Easiest Way to Get Patna Gold 24k (PATN-24k) Historical Rates with APIs

The Easiest Way to Get Patna Gold 24k (PATN-24k) Historical Rates with APIs
In today's digital age, accessing historical prices for precious metals like Patna Gold (24k) has never been easier, thanks to the advent of APIs. One of the most powerful tools available for developers is the Metals-API, which provides comprehensive data on various metals, including gold, silver, platinum, and palladium. This blog post will guide you through the process of retrieving historical prices for Patna Gold (24k) using the Metals-API, including example endpoints, parameters, and data formats.
About Gold (XAU)
Gold, represented by the symbol XAU, is not just a valuable asset; it is a symbol of wealth and stability. In recent years, the digital transformation in precious metals has opened new avenues for investors and traders. The integration of data analytics and market insights has revolutionized how we understand and interact with gold prices. With the help of technology, traders can now make informed decisions based on real-time data, enhancing their trading strategies and investment portfolios.
The innovation in price discovery mechanisms has also been significant. Digital asset solutions allow for seamless transactions and transparent pricing, making it easier for investors to access gold markets. The Metals-API plays a crucial role in this transformation by providing developers with the tools needed to build next-generation applications that leverage real-time metals data.
Metals-API Overview
The Metals-API is a powerful JSON API that offers a wide range of functionalities for accessing metals prices and currency conversions. With 14 different endpoints, developers can retrieve the latest rates, historical data, bid and ask prices, and much more. This API is designed to empower developers to create applications that require accurate and timely metals data.
One of the standout features of the Metals-API is its ability to provide historical rates dating back to 2019. This is particularly useful for developers looking to analyze trends over time or integrate historical data into their applications. The API also supports various currencies, making it versatile for different market needs.
Key Features and Endpoints
The Metals-API offers several key endpoints that can be utilized to gather valuable data about precious metals. Here are some of the most important ones:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data, updated based on your subscription plan. Depending on the plan, updates can occur every 60 minutes, every 10 minutes, or even more frequently.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. You can query the API for historical rates by appending a specific date to the endpoint.
- Bid and Ask Endpoint: This feature allows you to retrieve real-time bid and ask prices for various metals, providing insight into market liquidity.
- Convert Endpoint: Use this endpoint to convert any amount from one currency to another, facilitating seamless transactions.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, allowing for in-depth analysis of price movements.
- Fluctuation Endpoint: Track how currencies fluctuate on a day-to-day basis, providing insights into market volatility.
- Carat Endpoint: Retrieve information about gold rates by carat, which is essential for jewelers and gold traders.
- Lowest/Highest Price Endpoint: Get the lowest and highest prices for a specified date, which can help in understanding market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides the open, high, low, and close prices for a specific date, essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, useful for those involved in industrial metals.
- API Key: Your unique API key is required for authentication and must be included in your requests.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Supported Symbols Endpoint: This endpoint returns all available currencies, allowing developers to stay updated on the latest symbols.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping you informed about market trends.
API Endpoint Examples and Responses
To illustrate how to use the Metals-API effectively, let's explore some example endpoints and their corresponding JSON responses.
Latest Rates Endpoint
To get real-time exchange rates for all available metals, you can use the following endpoint:
GET https://metals-api.com/api/latest?access_key=YOUR_API_KEY
Example response:
{
"success": true,
"timestamp": 1760684453,
"base": "USD",
"date": "2025-10-17",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744
},
"unit": "per troy ounce"
}
Historical Rates Endpoint
To access historical exchange rates for any date since 1999, use the following endpoint:
GET https://metals-api.com/api/historical?access_key=YOUR_API_KEY&date=2025-10-16
Example response:
{
"success": true,
"timestamp": 1760598053,
"base": "USD",
"date": "2025-10-16",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"unit": "per troy ounce"
}
Time-Series Endpoint
To get exchange rates for a specific time period, use the following endpoint:
GET https://metals-api.com/api/timeseries?access_key=YOUR_API_KEY&start_date=2025-10-10&end_date=2025-10-17
Example response:
{
"success": true,
"timeseries": true,
"start_date": "2025-10-10",
"end_date": "2025-10-17",
"base": "USD",
"rates": {
"2025-10-10": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-10-12": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-10-17": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Convert Endpoint
To convert any amount from one metal to another or to/from USD, use the following endpoint:
GET https://metals-api.com/api/convert?access_key=YOUR_API_KEY&from=USD&to=XAU&amount=1000
Example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1760684453,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
To track rate fluctuations between two dates, use the following endpoint:
GET https://metals-api.com/api/fluctuation?access_key=YOUR_API_KEY&start_date=2025-10-10&end_date=2025-10-17
Example response:
{
"success": true,
"fluctuation": true,
"start_date": "2025-10-10",
"end_date": "2025-10-17",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
}
},
"unit": "per troy ounce"
}
OHLC (Open/High/Low/Close) Price Endpoint
To get OHLC data for a specific time period, use the following endpoint:
GET https://metals-api.com/api/open-high-low-close?access_key=YOUR_API_KEY&date=2025-10-17
Example response:
{
"success": true,
"timestamp": 1760684453,
"base": "USD",
"date": "2025-10-17",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
}
},
"unit": "per troy ounce"
}
Bid/Ask Endpoint
To get current bid and ask prices for metals, use the following endpoint:
GET https://metals-api.com/api/bid-ask?access_key=YOUR_API_KEY
Example response:
{
"success": true,
"timestamp": 1760684453,
"base": "USD",
"date": "2025-10-17",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
}
},
"unit": "per troy ounce"
}
Conclusion
In conclusion, the Metals-API provides a robust and flexible solution for developers looking to access historical rates for Patna Gold (24k) and other precious metals. By leveraging the various endpoints available, developers can create applications that not only retrieve real-time data but also analyze historical trends, track fluctuations, and convert currencies seamlessly.
With the ability to access comprehensive data through the Metals-API Documentation, developers can ensure they are utilizing the API to its fullest potential. Whether you are building a trading platform, a financial analysis tool, or simply looking to integrate metals data into your application, the Metals-API offers the necessary capabilities to succeed.
For a complete list of supported symbols, visit the Metals-API Supported Symbols page. Embrace the power of real-time metals data and transform how you interact with precious metals markets today!