Obtain weekly Patna Gold 22k (PATN-22k) prices using this API
Introduction
In the ever-evolving landscape of precious metals trading, obtaining accurate and timely data is crucial for investors and developers alike. This is particularly true for gold, represented by the symbol XAU, which has long been a cornerstone of financial markets. With the advent of APIs like the Metals-API, accessing real-time gold prices, including the weekly Patna Gold 22k (PATN-22k) prices, has never been easier. This blog post delves into the transformative potential of the Metals-API, exploring its capabilities, features, and how developers can leverage it to build innovative applications.
About Gold (XAU)
Gold has been a symbol of wealth and stability for centuries. In today's digital age, the integration of technology into precious metals trading is reshaping how investors access and analyze market data. The digital transformation in precious metals is characterized by the use of data analytics and market insights to make informed decisions. With the rise of technology integration in trading, investors can now utilize advanced tools for price discovery and market analysis.
The Metals-API stands at the forefront of this transformation, offering developers the ability to access real-time and historical data on gold prices. By harnessing the power of this API, developers can create applications that provide users with innovative digital asset solutions, enabling them to track gold prices, analyze trends, and make data-driven investment decisions.
API Description
The Metals-API is a powerful tool that provides real-time and historical data for various metals, including gold, silver, platinum, and palladium. This API empowers developers to build next-generation applications that can analyze market trends, track price fluctuations, and convert between different currencies. With its comprehensive capabilities, the Metals-API is designed to meet the needs of both novice and experienced developers.
For more detailed information, you can refer to the Metals-API Documentation, which outlines the various features and endpoints available for use.
Key Features and Endpoints
The Metals-API offers a range of endpoints that provide developers with access to essential data. Each endpoint serves a specific purpose, allowing users to retrieve the information they need efficiently. Here are some of the key features:
Latest Rates Endpoint
The Latest Rates Endpoint is a cornerstone feature of the Metals-API. Depending on your subscription plan, this endpoint returns real-time exchange rate data for various metals, updated every 60 minutes, every 10 minutes, or even more frequently. This allows developers to provide users with the most current pricing information, essential for making timely trading decisions.
{
"success": true,
"timestamp": 1782951009,
"base": "USD",
"date": "2026-07-02",
"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 crucial for analyzing market trends over time. The Historical Rates Endpoint allows developers to query the Metals-API for historical rates dating back to 2019. By appending a specific date in the format YYYY-MM-DD, users can retrieve past pricing data, enabling them to conduct thorough market analyses.
{
"success": true,
"timestamp": 1782864609,
"base": "USD",
"date": "2026-07-01",
"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 enables developers to retrieve real-time bid and ask prices for various metals. This information is crucial for traders looking to make informed decisions based on current market conditions. Depending on your subscription plan, this endpoint can provide valuable insights into the current market spread.
{
"success": true,
"timestamp": 1782951009,
"base": "USD",
"date": "2026-07-02",
"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. By specifying the amount and the currencies involved, developers can create applications that facilitate seamless currency conversions.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1782951009,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series Endpoint allows developers to query the API for daily historical rates between two dates of their choice. This feature is essential for analyzing trends over specific periods, enabling users to make informed decisions based on historical data.
{
"success": true,
"timeseries": true,
"start_date": "2026-06-25",
"end_date": "2026-07-02",
"base": "USD",
"rates": {
"2026-06-25": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-06-27": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-07-02": {
"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. By specifying a date range, developers can track the changes in metal prices, which is invaluable for understanding market volatility.
{
"success": true,
"fluctuation": true,
"start_date": "2026-06-25",
"end_date": "2026-07-02",
"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 developers to retrieve the open, high, low, and close prices for a specific time period. This data is essential for traders who rely on candlestick charts and other technical analysis tools to make informed decisions.
{
"success": true,
"timestamp": 1782951009,
"base": "USD",
"date": "2026-07-02",
"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 developers working with industrial metals and looking to analyze long-term trends.
API Key and Authentication
To access the Metals-API, developers must obtain an API key, which is a unique identifier 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.
API Response and Data Structure
Exchange rates delivered by the Metals-API are by default relative to USD. All data is returned in a structured JSON format, making it easy for developers to parse and utilize the information in their applications. Understanding the structure of the API response is crucial for effective implementation.
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 invaluable for developers looking to integrate various metals into their applications.
Conclusion
The Metals-API is a powerful tool that empowers developers to access real-time and historical data for precious metals, including gold. By leveraging its various endpoints, developers can create innovative applications that provide users with valuable insights into market trends and pricing. From the Latest Rates Endpoint to the OHLC Price Endpoint, each feature offers unique capabilities that can enhance trading strategies and decision-making processes.
As the digital transformation of precious metals continues, APIs like the Metals-API will play a crucial role in shaping the future of trading and investment. By understanding the capabilities of this API and how to implement its features effectively, developers can stay ahead in the competitive landscape of precious metals trading.
For more information on how to get started with the Metals-API, visit the Metals-API Website and explore the extensive documentation available.