Get Kolkata Gold 22k (KOLK-22k) Historical Prices with Python and this API

Introduction
In the world of precious metals trading, having access to accurate and timely data is crucial for making informed decisions. One of the most sought-after metals is gold, represented by the symbol XAU. For developers looking to integrate historical price data for gold into their applications, the Metals-API offers a powerful solution. This blog post will explore how to retrieve historical prices for Kolkata Gold 22k (KOLK-22k) using the Metals-API, focusing on its innovative features, capabilities, and practical applications.
About Gold (XAU)
Gold has long been a symbol of wealth and stability. As a precious metal, it plays a significant role in the global economy, serving as a hedge against inflation and currency fluctuations. With the digital transformation in precious metals trading, data analytics and market insights have become more accessible than ever. The integration of technology in trading has revolutionized how investors and traders interact with the market, leading to innovative solutions for price discovery and digital asset management.
The Metals-API is at the forefront of this transformation, providing developers with the tools they need to access real-time and historical data on various metals, including gold. By leveraging this API, developers can build next-generation applications that offer users valuable insights into market trends and price movements.
Metals-API Overview
The Metals-API is a comprehensive JSON API that provides access to real-time and historical prices for a wide range of metals. It empowers developers to create applications that can analyze market trends, perform currency conversions, and track price fluctuations. The API is designed with innovation in mind, enabling seamless integration into various platforms and applications.
Key Features and Endpoints
The Metals-API offers several key features that make it an invaluable resource for developers:
- 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 developers to provide users with the most current pricing information.
- Historical Rates Endpoint: Access historical rates for most currencies dating back to 2019. By appending a specific date to the API request, developers can retrieve historical price data for gold and other metals.
- Bid And Ask Endpoint: This powerful feature enables developers to retrieve real-time bid and ask prices, providing insights into market liquidity and trading opportunities.
- Convert Endpoint: The API includes a currency conversion endpoint, allowing users to convert any amount from one metal to another or to/from USD, facilitating easier trading and investment decisions.
- Time-Series Endpoint: Developers can query the API for daily historical rates between two dates of their choice, enabling detailed analysis of price trends over time.
- Fluctuation Endpoint: This endpoint provides information about how currencies fluctuate on a day-to-day basis, helping users understand market volatility.
- Carat Endpoint: Retrieve information about gold rates by carat, allowing for precise pricing based on purity levels.
- Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specified date, which is essential for traders looking to identify market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific time period, offering a comprehensive view of market performance.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a long-term perspective on metal prices.
- API Key: Each user is assigned a unique API key, which is required for authentication and access to the API's features.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data presentation.
- Supported Symbols Endpoint: This constantly updated endpoint returns all available currencies, allowing developers to stay informed about the latest offerings.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for local traders and investors.
- News Endpoint: Stay updated with the latest news articles related to various metals, providing context and insights into market movements.
API Endpoint Examples and Responses
Understanding how to interact with the Metals-API is essential for developers. Below are examples of various API endpoints, along with their expected responses:
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1748055741,
"base": "USD",
"date": "2025-05-24",
"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
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1747969341,
"base": "USD",
"date": "2025-05-23",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-Series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2025-05-17",
"end_date": "2025-05-24",
"base": "USD",
"rates": {
"2025-05-17": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-05-19": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-05-24": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
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": 1748055741,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2025-05-17",
"end_date": "2025-05-24",
"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"
}
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1748055741,
"base": "USD",
"date": "2025-05-24",
"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"
}
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1748055741,
"base": "USD",
"date": "2025-05-24",
"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"
}
Practical Use Cases and Integration Strategies
Integrating the Metals-API into your applications can unlock numerous possibilities for data analysis and trading strategies. Here are some practical use cases:
1. Historical Price Analysis
By utilizing the Historical Rates Endpoint, developers can create applications that analyze gold price trends over time. This can be particularly useful for investors looking to identify patterns and make informed decisions based on historical data.
2. Real-Time Trading Applications
With the Latest Rates Endpoint, developers can build real-time trading applications that provide users with up-to-the-minute pricing information. This is essential for traders who need to react quickly to market changes.
3. Currency Conversion Tools
The Convert Endpoint allows developers to create currency conversion tools that enable users to easily convert between different metals and fiat currencies. This can enhance the user experience for those trading in multiple currencies.
4. Market Analysis Dashboards
By leveraging the Time-Series and Fluctuation Endpoints, developers can create comprehensive market analysis dashboards that visualize price movements and fluctuations over time. This can help users understand market dynamics and make better trading decisions.
5. Investment Portfolio Management
Using the OHLC and Bid/Ask Endpoints, developers can build investment portfolio management tools that track the performance of various metals, allowing users to optimize their investment strategies based on real-time data.
Conclusion
The Metals-API is a powerful tool for developers looking to access historical prices and real-time data for precious metals like gold. By utilizing its various endpoints, developers can create innovative applications that provide valuable insights into market trends and trading opportunities. Whether you're building a trading platform, a market analysis dashboard, or a currency conversion tool, the Metals-API offers the flexibility and functionality needed to succeed in the dynamic world of precious metals trading.
For more information on how to get started with the Metals-API, visit the Metals-API Documentation for detailed guidance on implementation and usage. Additionally, explore the Metals-API Supported Symbols page to understand the full range of available metal symbols. Start leveraging the power of real-time metals data today with the Metals-API Website.