Get Patna Gold 22k (PATN-22k) Historical Prices from 2020 to 2025 using this API

Introduction
In the world of precious metals trading, having access to accurate and timely data is crucial for making informed decisions. For developers and traders alike, the ability to retrieve historical prices for gold, specifically Patna Gold 22k (PATN-22k), from 2020 to 2025 can be a game-changer. This is where the Metals-API comes into play, offering a robust solution for accessing real-time and historical data on various metals, including gold. In this blog post, we will explore the capabilities of the Metals-API, focusing on how to obtain historical prices for gold and the innovative features that make this API a valuable tool for developers.
Metals-API Information
About Gold (XAU)
Gold, represented by the symbol XAU, has long been a symbol of wealth and stability. In recent years, the digital transformation in precious metals has revolutionized how traders and investors interact with the market. The integration of data analytics and technology in trading has enabled more precise market insights, allowing for better decision-making. The innovation in price discovery mechanisms has also paved the way for digital asset solutions that cater to a tech-savvy audience.
As the demand for gold continues to rise, understanding its historical prices becomes essential. The Metals-API provides developers with the tools to access this data efficiently, enabling them to build applications that can analyze trends, forecast future prices, and provide insights into market dynamics.
API Description
The Metals-API is designed to empower developers by providing real-time metals data through a simple and intuitive interface. With its extensive capabilities, the API allows users to build next-generation applications that leverage historical and current market data. The API's architecture is built on innovation, ensuring that developers can access the information they need without unnecessary complexity.
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 means that developers can create applications that respond to market changes instantly, providing users with the most accurate information available.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for metals, updated every 60 minutes, every 10 minutes, or even more frequently, depending on the subscription plan. This feature is essential for applications that require up-to-the-minute pricing 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 prices for gold, allowing for in-depth analysis of price trends over time.
- Bid And Ask Endpoint: This powerful feature enables users to retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing dynamics.
- 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 applications that need to display prices in different currencies.
- Time-Series Endpoint: Developers can query the API for daily historical rates between two dates of their choice, making it easy to analyze price movements over specific periods.
- Fluctuation Endpoint: This endpoint provides information about how currencies fluctuate on a day-to-day basis, enabling users to track volatility in the market.
- Carat Endpoint: Users can retrieve information about gold rates by carat, which is essential for applications focused on jewelry and precious metal trading.
- Lowest/Highest Price Endpoint: This feature allows users to query the API to get the lowest and highest prices for a specified date range, providing insights into market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides the open, high, low, and close prices for a specific date, which is crucial for technical analysis.
- Historical LME Endpoint: Users can access historical rates for LME symbols dating back to 2008, which is beneficial for those analyzing industrial metals.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate and authorize 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 offers a comprehensive list of endpoints, each providing different functionalities tailored to user needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies, allowing developers to stay updated on the symbols they can use.
- Gold Price India Endpoint: Users can retrieve the latest gold price in India, which is particularly useful for traders in the Indian market.
- News Endpoint: This feature allows users to 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.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is crucial for developers looking to integrate its capabilities into their applications. 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": 1750093212,
"base": "USD",
"date": "2025-06-16",
"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 a successful request, providing the latest rates for various metals, including gold (XAU).
Historical Rates Endpoint
Access historical exchange rates for any date since 1999.
{
"success": true,
"timestamp": 1750006812,
"base": "USD",
"date": "2025-06-15",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows how to retrieve historical rates for gold and other metals, allowing for analysis of price trends over time.
Time-series Endpoint
Get exchange rates for a specific time period.
{
"success": true,
"timeseries": true,
"start_date": "2025-06-09",
"end_date": "2025-06-16",
"base": "USD",
"rates": {
"2025-06-09": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-06-11": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-06-16": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response illustrates how to obtain daily historical rates for a specific period, which is essential for trend analysis.
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": 1750093212,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This example demonstrates how to convert an amount from USD to gold (XAU), providing the conversion rate and resulting value.
Fluctuation Endpoint
Track rate fluctuations between two dates.
{
"success": true,
"fluctuation": true,
"start_date": "2025-06-09",
"end_date": "2025-06-16",
"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 the rates of gold and other metals have fluctuated over a specified period, which is vital for understanding market volatility.
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period.
{
"success": true,
"timestamp": 1750093212,
"base": "USD",
"date": "2025-06-16",
"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 example shows how to retrieve open, high, low, and close prices for gold, which is essential for traders conducting technical analysis.
Bid/Ask Endpoint
Get current bid and ask prices for metals.
{
"success": true,
"timestamp": 1750093212,
"base": "USD",
"date": "2025-06-16",
"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 crucial for traders looking to execute buy or sell orders effectively.
Conclusion
The Metals-API is a powerful tool for developers seeking to access historical prices for gold, including Patna Gold 22k (PATN-22k), from 2020 to 2025. With its extensive range of endpoints, the API allows users to retrieve real-time and historical data, enabling them to build applications that provide valuable insights into the precious metals market. By leveraging the capabilities of the Metals-API, developers can create innovative solutions that enhance trading strategies and improve decision-making processes.
For more information on how to get started with the Metals-API, refer to the Metals-API Documentation. To explore the full list of supported symbols, visit the Metals-API Supported Symbols page. The Metals-API Website also offers additional resources and support for developers looking to integrate this powerful API into their applications.