Bangalore Gold 24k API: BANG-24k in INR per Gram
Symbol: Bangalore Gold 24k (BANG-24k) → · Gold price API
You need to price 24k jewelry in Bengaluru in real time, in INR per gram, and wire it into your app without babysitting spreadsheets. By the end of this article you’ll be calling a single endpoint on Metals-API to request BANG-24k, parsing the JSON, and rendering Bangalore 24k gold rates reliably in production.
What “BANG-24k in INR per Gram” Delivers
The symbol BANG-24k represents Bengaluru (Bangalore) 24 karat jewelry gold, quoted in Indian Rupees per gram. This is a locality-specific retail-grade benchmark developers use to:
- Price catalog SKUs and quotes in jewelry POS or e-commerce flows.
- Drive procurement decisions or hedging workflows for gold-using manufacturers located in or serving Bengaluru.
- Build alerts when the retail-grade local price crosses thresholds in INR/gram.
- Render charts and P&L calculations that match the consumer market in Bangalore.
On Metals-API the Bangalore 24k price is served by a dedicated endpoint: GET /api/gold-price-india, with symbols=BANG-24k. The quote is returned in INR only; changing a base currency is not supported and will be rejected by this endpoint.
Go Live in Minutes
- Register for an API key on Metals-API: Register — plan: Copper Monthly $19.99/mo. No Free Trial.
- Copy your
access_keyfrom the dashboard. - Call GET
/api/gold-price-indiawithsymbols=BANG-24kand youraccess_key. - Render the value at
rates.BANG-24kto display INR per gram for Bangalore 24k gold.
If you’re integrating beyond pricing (analytics, alerting, charting), keep the Documentation handy for production considerations and broader feature coverage.
Requesting BANG-24k from the India Gold Endpoint
The Bangalore 24k price is available from a specialized India gold endpoint so you can query local retail-grade symbols directly in INR/gram. Here is a copy-paste request you can run from your terminal (replace YOUR_API_KEY with your key):
curl "https://metals-api.com/api/gold-price-india?access_key=YOUR_API_KEY&symbols=BANG-24k"
That request fetches the latest Bangalore 24k price in INR per gram. You do not need to specify a base currency; the endpoint only returns INR. If you attempt to use a base parameter, the request will be rejected.
Python example
The following example shows a minimal Python client that queries the same endpoint and reads the fields you’ll actually use in your app:
import os
import sys
import json
import time
import urllib.parse
import urllib.request
API_KEY = os.getenv("METALS_API_KEY", "YOUR_API_KEY")
BASE_URL = "https://metals-api.com/api/gold-price-india"
def get_bangalore_24k():
params = {
"access_key": API_KEY,
"symbols": "BANG-24k"
}
url = f"{BASE_URL}?{urllib.parse.urlencode(params)}"
req = urllib.request.Request(url, method="GET")
try:
with urllib.request.urlopen(req, timeout=10) as resp:
data = json.loads(resp.read().decode("utf-8"))
except Exception as e:
print(f"HTTP error: {e}", file=sys.stderr)
return None
# Basic validation and field access.
# The endpoint returns INR per gram for BANG-24k.
# Expect a top-level 'date' and a 'rates' map with key 'BANG-24k'.
if not isinstance(data, dict) or "rates" not in data:
print("Unexpected response shape", file=sys.stderr)
return None
bang_rate = data.get("rates", {}).get("BANG-24k")
api_date = data.get("date") # Use this as the 'print date'
if bang_rate is None:
print("BANG-24k missing in response", file=sys.stderr)
return None
return {
"date": api_date,
"inr_per_gram": bang_rate,
"raw": data
}
if __name__ == "__main__":
result = get_bangalore_24k()
if result:
print(f"Date: {result['date']}, Bangalore 24k: ₹{result['inr_per_gram']} per gram")
else:
sys.exit(1)
Sample Response and Field Semantics
Below is a live response example from the same India gold endpoint. Use it to map fields into your app. The “print date” you show in your UI should come from the JSON’s date field.
{"success": true, "timestamp": 1791223754, "base": "INR", "date": "2026-10-05", "rates": {"BANG-24k": 14918}, "unit": "per gram"}
What you’ll actually use from this payload:
- date: The API’s print date for the price. Use this value when labeling price freshness in your UI or logs.
- rates.BANG-24k: The numeric Bangalore 24k price in INR per gram. Render this value directly for pricing, quotes, and alerts.
If your integration includes auditing or alerts, also persist the entire JSON payload alongside your derived values, so you can reproduce downstream calculations exactly as rendered to users.
Units and Display: INR per Gram, Not Ounces
This endpoint returns INR per gram. If your app stores inventory weights in grams, you can multiply directly: price_in_inr = grams * rates.BANG-24k.
If you maintain weights in troy ounces, convert before multiplying. A troy ounce is approximately 31.1034768 grams. A safe approach is to store product weights in grams internally to avoid rounding drift, and convert only for display when needed.
- Do treat the returned quote as a gross retail-grade benchmark; taxes, making charges, and margins are separate concerns you should model in your own pricing engine.
- Don’t attempt to switch the base currency for this endpoint. INR is fixed.
Error Handling, Validation and “success=false”
Plan for request failures and schema variability in production. Practical guidelines:
- Check that the top-level container is a JSON object and that
ratesexists. - Verify
rates.BANG-24kis present and numeric before using it. If missing, log the full body and fall back to the last known good value with a timestamp flag in your UI. - If the API indicates an unsuccessful response (for example, an explicit error object or a boolean flag), record the error details, avoid overwriting cached good data, and retry with a backoff.
- Reject any response where
dateregresses relative to your last stored print date unless you are explicitly reprocessing historical states.
Because this endpoint is INR-only, omitting or adding unrelated parameters (like a base currency) can cause validation errors. Keep your query minimal: access_key and symbols=BANG-24k.
Caching, Polling and Market Calendars
To ship a resilient integration, plan your request cadence and caching strategy:
- Cache short-lived: Cache the latest successful payload in your datastore or memory cache and serve it to clients. On subsequent fetch failures, continue serving the cached value with a visible “as of” label derived from the
datefield. - Respect staleness: When the market is closed or on weekends/holidays, the
datemay not advance. Avoid noisy alerts on unchanged print dates; compare rates and dates to decide whether to notify end users. - Backoff on 4xx/5xx: Implement exponential backoff and jitter for retries to protect your app and the API.
- De-duplicate writes: If you persist snapshots, use the
dateas a natural key to avoid duplicate entries when the value is unchanged across calls.
Production Checklist
- Use the dedicated India endpoint:
/api/gold-price-india. - Request the Bangalore symbol:
symbols=BANG-24k. - Never send a base currency; this endpoint returns INR and will reject a base override.
- Render and persist
rates.BANG-24kanddate. - Apply your own rounding/display rules (e.g., two decimal places) and clearly label the unit as “INR per gram”.
- Cache responses and show the print date for transparency.
Testing, Symbols and Coverage
Before deploying, confirm your symbol list and endpoint behavior against the official references:
- Browse all available codes on the Symbols page.
- Review endpoint behavior, authentication, and response formats in the Documentation.
- Understand sourcing and consolidation on the MCP page.
If you are migrating an existing USD-based flow, note that the India endpoint’s output is already in INR per gram and is locality-specific; you don’t need cross-currency conversion or ounce-to-gram normalization here.
Common Integration Patterns
Real-time pricing in a cart or quote engine
Fetch BANG-24k on a schedule (e.g., every few minutes) on your server, cache the last response, and price items as grams * rates.BANG-24k plus your margins and taxes. Render the “as of” label from the date field.
Threshold alerts for Bangalore 24k
Poll at a cadence appropriate for your user expectations, compare the latest rates.BANG-24k with your alert thresholds, and send notifications when crossed. Debounce notifications on unchanged print dates and unchanged rates to avoid spam during quiet periods.
Backfilling dashboards
If you are building charts or dashboards for Bangalore 24k, persist each unique print date and rate as time series points. When the API’s print date repeats, skip writes to avoid duplicate samples. If you need other locales or purity levels, consult the Symbols list and query them via the appropriate endpoint.
Troubleshooting Tips
- HTTP 4xx with parameter errors: Remove unsupported params like
base. Keep onlyaccess_keyandsymbols. - Empty or missing
rates.BANG-24k: Validate thesymbolsstring, ensure the symbol exists in the Symbols list, and retry with backoff. - Stale date: If the
datedoes not change across calls, it may be off-market hours or a holiday. Continue serving the cached value and surface the print date in your UI. - Plan access: Ensure your subscription (Copper Monthly $19.99/mo, No Free Trial) is active and your
access_keyis correct.
FAQ
What exactly does BANG-24k represent?
BANG-24k is the Bangalore (Bengaluru) 24 karat jewelry gold price symbol returned by the India gold endpoint. It maps to a locality-specific retail-grade rate.
What unit is the value in?
The endpoint returns INR per gram. Multiply by item weight in grams to compute item prices. Convert from troy ounces to grams if your inventory is stored in ounces.
Can I change the base currency from INR?
No. The India gold endpoint returns INR only, and attempts to set a base currency are rejected. If your app needs other currencies, handle conversion separately in your own stack.
How do I know the price’s effective date?
Use the top-level date field from the response as the print date. Display this to users and store it with the rate for auditing and caching.
What should I do if the response is unsuccessful or missing BANG-24k?
Check for an error indicator, log the full response, retain your last known good value, and retry with exponential backoff. Only update your cache when rates.BANG-24k is present and valid.
Ready to ship Bangalore 24k pricing into your app? Create your key and query BANG-24k today: Register. For endpoint details and symbol coverage, review the Documentation and confirm availability on Symbols; sourcing notes are on MCP.