Get Patna Gold 24k (PATN-24k) Historical Prices for Your Investment Portfolio using this API

Get Patna Gold 24k (PATN-24k) Historical Prices for Your Investment Portfolio using this API
Investing in precious metals, particularly gold, has always been a strategic choice for many investors. With the rise of digital transformation in the financial sector, accessing historical prices for gold has become easier than ever. The Metals-API provides a robust solution for developers looking to integrate real-time and historical gold price data into their applications. In this blog post, we will explore how to retrieve historical prices for Patna Gold 24k (PATN-24k) using the Metals-API, focusing on its innovative features and capabilities.
About Gold (XAU)
Gold, represented by the symbol XAU, is not just a commodity; it is a digital asset that has transformed the way investors approach wealth preservation and growth. The digital transformation in precious metals has led to the integration of advanced data analytics and market insights, allowing investors to make informed decisions based on real-time data. The Metals-API plays a crucial role in this transformation by providing developers with the tools necessary to access and analyze gold prices effectively.
One of the most significant advancements in trading technology is the ability to integrate real-time data into applications. The Metals-API offers a suite of features that empower developers to build next-generation applications that can track gold prices, analyze market trends, and provide insights into price discovery. This API is not just about retrieving data; it is about leveraging technology to create innovative digital asset solutions.
API Description
The Metals-API is a powerful tool that provides access to real-time and historical data for various metals, including gold. It enables developers to build applications that can track price fluctuations, analyze historical trends, and convert between different metal values. The API is designed with innovation in mind, allowing for seamless integration into existing systems and applications.
With the Metals-API, developers can access a variety of endpoints that cater to different needs. For instance, the Latest Rates Endpoint provides real-time exchange rate data, while the Historical Rates Endpoint allows users to query historical prices dating back to 2019. This flexibility makes the Metals-API an essential resource for anyone looking to incorporate precious metal data into their investment strategies.
Key Features and Endpoints
The Metals-API offers several key features that enhance its usability and functionality:
- 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 is crucial for traders who need the most current information to make timely decisions.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. By appending a specific date to your query, you can retrieve past prices for gold, allowing for comprehensive analysis and trend identification.
- Bid and Ask Endpoint: This feature enables you to retrieve real-time bid and ask prices, which are essential for understanding market dynamics and making informed trading decisions.
- Convert Endpoint: The API includes a currency conversion endpoint, allowing users to convert any amount from one metal to another or to/from USD. This is particularly useful for investors dealing with multiple currencies.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice. This feature is invaluable for analyzing trends over specific periods.
- Fluctuation Endpoint: Retrieve information about how currencies fluctuate on a day-to-day basis, providing insights into market volatility.
- Carat Endpoint: Get information about gold rates by carat, which is essential for jewelers and consumers looking to understand the value of gold jewelry.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specified date, helping investors identify price extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, allowing for detailed market analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is beneficial for those tracking industrial metals.
- API Key: Your unique API key is required to access the API, ensuring secure and authorized usage.
- API Response: The API delivers exchange rates relative to USD, with all data returned in a structured JSON format.
- Supported Symbols Endpoint: This endpoint returns all available currencies, allowing developers to stay updated on the symbols they can use.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for local investors.
- News Endpoint: Get the latest news articles related to various metals, keeping you informed about market trends and developments.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for developers. Below are examples of how to use various endpoints and what responses to expect:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1746255707,
"base": "USD",
"date": "2025-05-03",
"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 latest gold price (XAU) is 0.000482 per troy ounce, relative to USD. Developers can use this data to display current market prices in their applications.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1746169307,
"base": "USD",
"date": "2025-05-02",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows how to retrieve historical prices for a specific date. The response provides the gold price for May 2, 2025, allowing for historical analysis and trend tracking.
Time-Series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2025-04-26",
"end_date": "2025-05-03",
"base": "USD",
"rates": {
"2025-04-26": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-04-28": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-05-03": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
The time-series endpoint allows developers to analyze price trends over a specified period. This data can be visualized in charts or graphs to provide insights into market behavior.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1746255707,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows how to convert an amount from USD to gold (XAU). In this case, 1000 USD converts to 0.482 troy ounces of gold, which is useful for investors looking to understand their purchasing power in gold.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2025-04-26",
"end_date": "2025-05-03",
"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"
}
The fluctuation endpoint provides insights into how prices change over time, which is essential for traders looking to capitalize on market movements.
OHLC (Open/High/Low/Close) Price Endpoint
{
"success": true,
"timestamp": 1746255707,
"base": "USD",
"date": "2025-05-03",
"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 endpoint provides a comprehensive view of the price action for a specific date, allowing traders to analyze market behavior and make informed decisions based on historical data.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1746255707,
"base": "USD",
"date": "2025-05-03",
"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"
}
The bid/ask endpoint is crucial for traders as it provides the current market prices at which they can buy or sell gold. Understanding the spread between bid and ask prices is essential for making profitable trades.
Conclusion
The Metals-API is a powerful resource for developers looking to integrate gold price data into their applications. With its comprehensive suite of endpoints, it allows for real-time tracking, historical analysis, and conversion between different metal values. By leveraging the capabilities of the Metals-API, developers can create innovative solutions that enhance the investment experience for users.
As the digital landscape continues to evolve, the importance of accurate and timely data cannot be overstated. The Metals-API not only provides access to essential market data but also empowers developers to build applications that can adapt to the changing needs of investors. For more information on how to get started, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols for a complete list of available metals.
In summary, whether you are a seasoned trader or a newcomer to the world of precious metals, the Metals-API offers the tools and data necessary to make informed investment decisions. Embrace the future of trading with the power of real-time metals data at your fingertips.