How to retrieve Bangalore Gold 22k (BANG-22k) prices with a simple API call
Introduction
In the ever-evolving landscape of precious metals trading, retrieving accurate and real-time data is paramount for investors and developers alike. One of the most sought-after metals is Gold, specifically the 22k variant known as BANG-22k in the Indian market. With the advent of APIs, accessing this data has become simpler and more efficient. In this blog post, we will explore how to retrieve Bangalore Gold 22k prices using the Metals-API, a powerful tool that provides real-time and historical data on various metals, including Gold (XAU).
About Gold (XAU)
Gold has been a symbol of wealth and a safe haven asset for centuries. Its value is influenced by various factors, including market demand, geopolitical stability, and economic indicators. As digital transformation sweeps through the financial sector, the integration of technology in precious metals trading has become crucial. The use of data analytics and market insights allows traders to make informed decisions based on real-time data.
With the rise of digital asset solutions, investors can now access Gold prices and trends at their fingertips. The Metals-API offers a comprehensive suite of features that empower developers to build next-generation applications that can analyze and visualize Gold market trends effectively.
API Description
The Metals-API is designed to provide developers with a robust platform for accessing real-time and historical data on various metals, including Gold. This API is not just a data source; it represents a technological advancement that transforms how traders and investors interact with the market. By leveraging the power of real-time metals data, developers can create applications that offer innovative solutions for price discovery and trading strategies.
With endpoints that cater to various needs, such as retrieving the latest rates, historical data, and even bid and ask prices, the Metals-API is an invaluable resource for anyone looking to stay ahead in the precious metals market. The API's capabilities extend beyond mere data retrieval; it allows for comprehensive analysis and integration into larger financial systems.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that serve different purposes, each designed to enhance the user experience and provide valuable insights into the metals market.
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for various metals, including Gold. Depending on your subscription plan, the API updates this data every 60 minutes or every 10 minutes, ensuring that you have the most current information at your disposal.
- Historical Rates Endpoint: For those interested in analyzing trends over time, the historical rates endpoint allows users to access data dating back to 2019. By appending a specific date to the API call, developers can retrieve historical prices for any metal.
- Bid And Ask Endpoint: This feature enables users to obtain real-time bid and ask prices, which are crucial for making informed trading decisions. The bid and ask prices reflect the current market sentiment and can vary based on market conditions.
- Convert Endpoint: The conversion endpoint allows users to convert amounts between different metals or to/from USD. This is particularly useful for traders who operate in multiple currencies.
- Time-Series Endpoint: This endpoint provides daily historical rates between two specified dates, allowing users to analyze price movements over time.
- Fluctuation Endpoint: Users can track how prices fluctuate on a day-to-day basis, providing insights into market volatility and trends.
- Carat Endpoint: This unique feature allows users to retrieve Gold rates based on carat values, which is essential for jewelers and consumers looking to understand the value of their Gold items.
- Lowest/Highest Price Endpoint: This endpoint enables users to query the API for the lowest and highest prices of metals over a specified period, offering insights into market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This feature provides detailed price data, including the opening, high, low, and closing prices for a specific date, which is vital for technical analysis.
- Historical LME Endpoint: For those interested in the London Metal Exchange (LME), this endpoint provides historical rates dating back to 2008, allowing for comprehensive market analysis.
- API Key: Each user is assigned a unique API key, which must be included in the API requests to authenticate and authorize access to the data.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in data interpretation.
- Available Endpoints: The Metals-API comprises 14 different endpoints, each designed to provide specific functionalities tailored to user needs.
- Supported Symbols Endpoint: This endpoint returns a constantly updated list of all available currencies and metals, ensuring users have access to the latest information.
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 specific metals into their applications.
API Endpoint Examples and Responses
Understanding the API's response structure is crucial for effective integration. Below are examples of various API endpoints, showcasing their responses and the significance of each field.
Latest Rates Endpoint
The latest rates endpoint provides real-time exchange rates for all available metals. Here’s an example response:
{
"success": true,
"timestamp": 1783814941,
"base": "USD",
"date": "2026-07-12",
"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 success field indicates whether the API call was successful. The timestamp provides the time of the data retrieval, while base indicates the currency used for the rates. The rates object contains the exchange rates for various metals, with Gold (XAU) being one of them.
Historical Rates Endpoint
Accessing historical exchange rates is essential for trend analysis. Here’s an example response:
{
"success": true,
"timestamp": 1783728541,
"base": "USD",
"date": "2026-07-11",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response structure is similar to the latest rates endpoint, but it provides historical data for a specific date. Developers can use this data to analyze price movements over time.
Time-series Endpoint
The time-series endpoint allows users to retrieve exchange rates for a specific period. Here’s an example response:
{
"success": true,
"timeseries": true,
"start_date": "2026-07-05",
"end_date": "2026-07-12",
"base": "USD",
"rates": {
"2026-07-05": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-07-07": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-07-12": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This endpoint provides a time series of rates, allowing developers to visualize trends and fluctuations over the specified period.
Convert Endpoint
The convert endpoint is particularly useful for traders who need to convert amounts between different metals or currencies. Here’s an example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1783814941,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows the conversion of 1000 USD to Gold (XAU), providing the rate and the resulting amount in troy ounces.
Fluctuation Endpoint
Tracking fluctuations is vital for understanding market volatility. Here’s an example response:
{
"success": true,
"fluctuation": true,
"start_date": "2026-07-05",
"end_date": "2026-07-12",
"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 endpoint provides detailed fluctuation data, including the start and end rates, changes in value, and percentage changes over the specified period.
OHLC (Open/High/Low/Close) Price Endpoint
The OHLC endpoint provides critical price data for traders. Here’s an example response:
{
"success": true,
"timestamp": 1783814941,
"base": "USD",
"date": "2026-07-12",
"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 includes the opening, high, low, and closing prices for Gold, which are essential for technical analysis and trading strategies.
Bid/Ask Endpoint
The bid/ask endpoint provides current bid and ask prices for metals. Here’s an example response:
{
"success": true,
"timestamp": 1783814941,
"base": "USD",
"date": "2026-07-12",
"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 endpoint provides crucial information for traders, including the bid and ask prices and the spread, which is the difference between the two.
Conclusion
The Metals-API is a powerful tool for developers and traders looking to access real-time and historical data on precious metals, including Gold (XAU). By leveraging its various endpoints, users can retrieve the latest rates, historical data, and even bid/ask prices, enabling them to make informed trading decisions.
As the financial landscape continues to evolve, the integration of technology in precious metals trading will only become more critical. The Metals-API not only simplifies data retrieval but also empowers developers to create innovative applications that can analyze and visualize market trends effectively.
For more information on how to implement the Metals-API in your applications, refer to the Metals-API Documentation. To explore the full range of supported symbols, visit the Metals-API Supported Symbols page. By harnessing the capabilities of this API, you can stay ahead in the dynamic world of precious metals trading.