How to access Patna Gold 18k (PATN-18k) prices with this API
Introduction
Accessing real-time prices for precious metals like Gold (XAU) has become increasingly important for traders, investors, and developers alike. With the rise of digital transformation in the financial sector, leveraging APIs such as the Metals-API can provide invaluable insights into market trends and price fluctuations. This blog post will delve into how to access Patna Gold 18k (PATN-18k) prices using the Metals-API, while exploring the broader implications of technology integration in trading and data analytics in precious metals.
About Gold (XAU)
Gold has long been regarded as a safe-haven asset, especially during times of economic uncertainty. The digital transformation in precious metals trading has opened up new avenues for investors and developers. By utilizing data analytics and market insights, stakeholders can make informed decisions based on real-time data. The integration of technology in trading has led to innovative solutions for price discovery and digital asset management.
The Role of APIs in Precious Metals Trading
APIs like the Metals-API empower developers to build next-generation applications that can access real-time metals data. This API provides a comprehensive suite of features that enable users to retrieve the latest rates, historical data, and even perform currency conversions. The transformative potential of real-time data cannot be overstated, as it allows for more accurate forecasting and strategic planning in trading.
API Description
The Metals-API is a powerful tool designed to provide real-time and historical data for various metals, including Gold (XAU). It offers a range of endpoints that cater to different needs, from retrieving the latest rates to accessing historical data dating back to 2019. The API is designed with developers in mind, offering clear documentation and a user-friendly interface. For more detailed information, you can refer to the Metals-API Documentation.
Key Features of the Metals-API
The Metals-API boasts several key features that make it an essential tool for anyone involved in precious metals trading:
- 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 allows traders to stay informed about the latest market movements.
- Historical Rates Endpoint: Users can access historical rates for most currencies dating back to 2019. By appending a specific date (YYYY-MM-DD) to the endpoint, you can retrieve past rates, which is crucial for trend analysis.
- Bid and Ask Endpoint: This feature enables users to retrieve real-time Bid and Ask prices, providing insights into market liquidity and pricing strategies.
- Convert Endpoint: The API includes a currency conversion endpoint, allowing users to convert any amount from one currency to another, facilitating seamless transactions.
- Time-Series Endpoint: Users can query the API for daily historical rates between two dates of their choice, making it easier to analyze trends over time.
- Fluctuation Endpoint: This endpoint provides information about how currencies fluctuate on a day-to-day basis, helping traders understand market volatility.
- Carat Endpoint: Users can retrieve information about Gold rates by Carat, which is particularly useful for jewelers and gold traders.
- Lowest/Highest Price Endpoint: This feature allows users to query the API for the lowest and highest prices within a specified date range, aiding in price analysis.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can access OHLC data for specific time periods, which is essential for technical analysis.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, offering a broader perspective on market trends.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate access to the API.
- API Response: The API delivers exchange rates relative to USD, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API features 14 different endpoints, each designed to provide specific functionalities.
- Supported Symbols Endpoint: This endpoint returns all available currencies, ensuring users have access to the latest symbols.
- News Endpoint: Users can 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 the API's response structure is crucial for effective integration. Below are examples of various endpoints and their corresponding JSON responses:
Latest Rates Endpoint
This endpoint provides real-time exchange rates for all available metals.
{
"success": true,
"timestamp": 1779149320,
"base": "USD",
"date": "2026-05-19",
"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"
}
In this response, the "rates" object contains the latest prices for various metals, with "XAU" representing Gold.
Historical Rates Endpoint
This endpoint allows access to historical exchange rates for any date since 1999.
{
"success": true,
"timestamp": 1779062920,
"base": "USD",
"date": "2026-05-18",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
The "date" field indicates the specific day for which the rates are provided, allowing for historical analysis.
Time-Series Endpoint
This endpoint retrieves exchange rates for a specific time period.
{
"success": true,
"timeseries": true,
"start_date": "2026-05-12",
"end_date": "2026-05-19",
"base": "USD",
"rates": {
"2026-05-12": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-05-14": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-05-19": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides a time series of rates, allowing users to analyze trends over a specified period.
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1779149320,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response indicates that 1000 USD is equivalent to 0.482 troy ounces of Gold, showcasing the utility of the conversion feature.
Fluctuation Endpoint
Track rate fluctuations between two dates using this endpoint.
{
"success": true,
"fluctuation": true,
"start_date": "2026-05-12",
"end_date": "2026-05-19",
"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 have changed over the specified period, which is crucial for traders looking to capitalize on market movements.
OHLC (Open/High/Low/Close) Price Endpoint
Get OHLC data for a specific time period with this endpoint.
{
"success": true,
"timestamp": 1779149320,
"base": "USD",
"date": "2026-05-19",
"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 response provides a comprehensive view of the price movement for each metal, which is essential for technical analysis.
Bid/Ask Endpoint
Retrieve current bid and ask prices for metals using this endpoint.
{
"success": true,
"timestamp": 1779149320,
"base": "USD",
"date": "2026-05-19",
"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 bid and ask prices, along with the spread, which is critical for traders looking to execute orders effectively.
Conclusion
In conclusion, the Metals-API offers a robust solution for accessing real-time and historical data for precious metals like Gold (XAU). By leveraging its various endpoints, developers can create applications that provide valuable insights into market trends and price fluctuations. The integration of technology in trading not only enhances the efficiency of transactions but also empowers users with the data needed for informed decision-making. For further exploration of the API's capabilities, visit the Metals-API Website and check out the Metals-API Documentation for detailed guidance on implementation. Understanding the dynamics of precious metals trading through APIs is essential for anyone looking to thrive in this ever-evolving market.