Build a Stock Watchlist with the Batch Quotes API (Up to 50 Tickers per Call)
Looping over single-ticker endpoints burns your daily request quota. GET /v1/stocks/quotes takes up to 50 comma-separated symbols and returns the latest price snapshot for each in one call.
import httpx
API = "https://bharatstockapi.com"
HEADERS = {"X-API-Key": "bsk_live_..."} # your key from the dashboard
symbols = ["RELIANCE", "TCS", "INFY", "NOTATICKER"]
r = httpx.get(f"{API}/v1/stocks/quotes", headers=HEADERS,
params={"symbols": ",".join(symbols)})
r.raise_for_status()
for q in r.json():
if q["found"]:
print(q["symbol"], q["close"], q["change_pct"])
else:
print(q["symbol"], "not found")Behaviour to rely on
- An unknown symbol comes back as
{"symbol": ..., "found": false}. It does not fail the request. - The maximum is 50 symbols. Chunk longer lists into batches of 50.
- Prices are end-of-day, not a live tick stream, so refreshing more than once a day gains nothing.
To find a ticker from a company name, use symbols and scrip codes and the /v1/search endpoint.