How to Build a Stock Screener with an API
A stock screener filters the whole listed universe down to the names that match your criteria — say, large caps with a low P/E and a high ROE. Instead of scraping a screener website, you can run the same filters programmatically.
The screener endpoint
Call GET /v1/screener with one or more filter parameters. Each filter is a field, an operator, and a value — for example market cap above a threshold, P/E below a ceiling, or ROE above a floor. Combine several filters to narrow the universe, and paginate through the matches.
curl "https://bharatstockapi.com/v1/screener?filter=pe_ratio<20&filter=roe>15" -H "X-API-Key: bsk_live_..."
Fields you can filter on
The screener works over the same canonical metrics served everywhere else — market cap, P/E, P/B, ROE, ROCE, dividend yield, revenue growth, and liquidity aggregates like 30-day average turnover and delivery percentage. Because the values match the stock pages and the ratios endpoint, a result you screen for will show the same numbers when you drill into the stock.
From screen to detail
Each screener row returns the ticker and its metrics; follow up with /v1/stocks/{ticker} or the stock page for the full profile. See the screener reference for the complete list of filterable fields and operators.