Integrate Patna Gold 18k (PATN-18k) Historical Prices using this API
Integrate Patna Gold 18k (PATN-18k) Historical Prices using this API
In the ever-evolving landscape of precious metals trading, the integration of real-time data and historical price analysis has become paramount for developers and traders alike. One of the most sought-after metals is gold, represented by the symbol XAU. This blog post will delve into how to effectively retrieve historical prices for Patna Gold 18k (PATN-18k) using the Metals-API. We will explore the capabilities of the API, its endpoints, and how it empowers developers to build innovative applications that leverage historical and real-time data.
About Gold (XAU)
Gold has long been a symbol of wealth and stability, often viewed as a safe haven during economic uncertainty. The digital transformation in precious metals trading has opened new avenues for data analytics and market insights. With the advent of technology, traders can now access real-time data, analyze trends, and make informed decisions based on historical performance.
The integration of technology in trading has revolutionized price discovery. Developers can utilize APIs like Metals-API to create applications that provide users with up-to-date information on gold prices, historical trends, and market fluctuations. This innovation not only enhances trading strategies but also offers digital asset solutions that cater to a diverse range of investors.
API Description
The Metals-API is a powerful tool designed to provide developers with access to real-time and historical data for various metals, including gold, silver, platinum, and palladium. The API's capabilities are vast, allowing for seamless integration into applications that require accurate and timely metal pricing information.
With a focus on innovation and technological advancement, Metals-API empowers developers to build next-generation applications. The API offers a range of endpoints that facilitate the retrieval of data, including the latest rates, historical prices, and conversion functionalities. This flexibility allows developers to create customized solutions tailored to their specific needs.
Key Features and Endpoints
The Metals-API offers several key features that developers can leverage to enhance their applications:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint provides real-time exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently. This feature is crucial for traders who need immediate access to current market conditions.
- Historical Rates Endpoint: Historical rates are available for most currencies dating back to 2019. Developers can query the API for historical rates by appending a specific date to the endpoint. This functionality is essential for analyzing past performance and making informed trading decisions.
- Bid And Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: The API includes a separate currency conversion endpoint, enabling users to convert any amount from one currency to another, facilitating transactions across different markets.
- Time-Series Endpoint: This endpoint allows developers to query the API for daily historical rates between two dates of their choice, making it easier to analyze trends over specific periods.
- Fluctuation Endpoint: Users can retrieve information about how currencies fluctuate on a day-to-day basis, which is vital for understanding market volatility.
- Carat Endpoint: This feature provides information about gold rates by carat, allowing for precise valuation of gold jewelry and investments.
- Lowest/Highest Price Endpoint: Developers can query the API to get the lowest and highest prices for a specified date, aiding in market analysis and strategy formulation.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, essential for technical analysis and trading strategies.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is particularly useful for traders focused on industrial metals.
- API Key: Each user receives 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 by default, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API includes 14 endpoints, each providing different functionalities to cater to various user needs.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, ensuring users have access to the latest data.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping users informed about market trends and 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 responses is crucial for effective integration. Below are examples of various endpoints and their JSON responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1770596051,
"base": "USD",
"date": "2026-02-09",
"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, providing a snapshot of the current market.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1770509651,
"base": "USD",
"date": "2026-02-08",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows the historical price for gold on February 8, 2026, allowing developers to analyze past trends and make predictions.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2026-02-02",
"end_date": "2026-02-09",
"base": "USD",
"rates": {
"2026-02-02": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-02-04": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-02-09": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response illustrates the price trend for gold over a specified time period, enabling developers to visualize fluctuations and make data-driven decisions.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1770596051,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This example demonstrates how to convert an amount from USD to gold (XAU), providing a clear understanding of the conversion process.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2026-02-02",
"end_date": "2026-02-09",
"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 gold prices fluctuated over a specific period, essential for traders looking to capitalize on market movements.
OHLC (Open/High/Low/Close) Endpoint
{
"success": true,
"timestamp": 1770596051,
"base": "USD",
"date": "2026-02-09",
"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 critical data for traders, allowing them to analyze market performance and make informed decisions based on open, high, low, and close prices.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1770596051,
"base": "USD",
"date": "2026-02-09",
"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, silver, and platinum, which are crucial for traders looking to execute orders effectively.
Conclusion
Integrating historical prices for Patna Gold 18k (PATN-18k) using the Metals-API is a powerful strategy for developers aiming to enhance their trading applications. By leveraging the API's extensive features, including real-time data, historical rates, and conversion capabilities, developers can create robust solutions that cater to the needs of traders and investors.
The ability to access comprehensive data through various endpoints allows for in-depth analysis and informed decision-making. As the digital transformation in precious metals continues to evolve, APIs like Metals-API will play a pivotal role in shaping the future of trading and investment strategies.
For more information on how to get started, refer to the Metals-API Documentation and explore the Metals-API Supported Symbols to find the right data for your application. Embrace the future of precious metals trading with the power of real-time data at your fingertips.