Hdfcsec APIhdfcsec.com ↗
Access real-time NSE and BSE equity data via the HDFC Securities API: top gainers, losers, most active stocks, 52-week highs/lows, index overviews, and stock quotes.
What is the Hdfcsec API?
The HDFC Securities API covers 8 endpoints for real-time Indian equity market data across NSE and BSE. You can retrieve top gainers and losers, most active stocks by volume, 52-week high and low listings, index overviews, and detailed per-stock quotes — including fields like ltp, market_cap, pe_ratio, fifty_two_wk_high, and isin — all filterable by exchange and index code.
curl -X GET 'https://api.parse.bot/scraper/b58bc736-5f89-43ac-b79d-9cc4508f29fb/get_most_active_nse_stocks?index=20559&period=I&exchange=NSE' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace hdfcsec-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: HDFC Securities Market Data — bounded, re-runnable; every call capped."""
from parse_apis.hdfc_securities_market_data_api import (
HDFCSecurities, Exchange, Period, StockNotFound
)
client = HDFCSecurities()
# List top gainers on NSE for intra-day, capped at 5 results.
for stock in client.stocks.top_gainers(exchange=Exchange.NSE, period=Period.INTRA_DAY, limit=5):
print(stock.stock_name, stock.ltp, stock.percent_change)
# Get all available NSE indices — discover index codes for filtering.
for idx in client.indexes.list(exchange=Exchange.NSE, limit=3):
print(idx.index_name, idx.index_code, idx.ltp)
# Search for a stock and drill into its full quote.
result = client.searchresults.search(query="Reliance", limit=1).first()
if result:
print(result.stock_name, result.isin, result.exchange)
# Fetch a detailed stock quote with typed-error handling.
try:
quote = client.stockquotes.get(symbol="INFY")
print(quote.stock_name, quote.ltp, quote.sector, quote.fifty_two_wk_high)
except StockNotFound as exc:
print(f"Stock not found: {exc.symbol}")
# 52-week highs on BSE — market momentum scan.
for high in client.weekhighstocks.list(exchange=Exchange.BSE, limit=3):
print(high.stock_name, high.ltp, high.prev_day_high)
print("exercised: stocks.top_gainers / indexes.list / searchresults.search / stockquotes.get / weekhighstocks.list")
Get the most active stocks for a given exchange and index, sorted by trading volume descending. Each result includes last traded price, change, percent change, day range, and volume. Supports filtering by exchange and index code, and time period.
| Param | Type | Description |
|---|---|---|
| index | string | Index code to filter by (e.g., 20559 for Nifty 50, 20558 for Sensex) |
| period | string | Time period: I (Intra Day), W (Week), M (Month) |
| exchange | string | Exchange code: NSE or BSE |
{
"type": "object",
"fields": {
"items": "array of stock objects with stock_name, symbol, ltp, change, percent_change, day_low, day_high, volume, co_code, isin"
},
"sample": {
"data": {
"items": [
{
"ltp": "198.35",
"isin": "INE081A01020",
"change": "-0.96",
"symbol": "",
"volume": "38288607",
"co_code": "566",
"day_low": "196.05",
"day_high": "199.35",
"stock_name": "Tata Steel Ltd",
"percent_change": "-0.48"
}
]
},
"status": "success"
}
}About the Hdfcsec API
Market Movers and Activity
get_most_active_nse_stocks, get_top_gainers_nse, and get_top_losers_nse each return arrays of stock objects sorted by volume or percent change. All three accept an exchange param (NSE or BSE), an index code (e.g., 20559 for Nifty 50, 20558 for Sensex), a period flag (I for intraday, W for week, M for month), and an optional limit. Each result includes stock_name, symbol, ltp, change, percent_change, day_low, day_high, volume, co_code, and isin.
52-Week Extremes and Index Overview
get_52_week_high_stocks and get_52_week_low_stocks return stocks currently at their highest or lowest prices over the trailing 52 weeks, with prev_day_high or prev_day_low included for comparison. Both accept an optional index filter and exchange code. get_equity_market_overview lists all available indices for a given exchange, returning index_name, index_code, ltp, change, and percent_change — useful for discovering valid index codes to pass to the other endpoints.
Stock Search and Detailed Quotes
search_stock accepts a free-text query (name or symbol) and returns up to 10 matches, each with stock_name, co_code, ltp, change, percent_change, isin, and exchange. For deeper detail, get_stock_quote takes a trading symbol and returns a single object with fields including open, prev_close, high, low, volume, market_cap, fifty_two_wk_high, pe_ratio, and sector, making it the primary endpoint for per-company fundamental and price data.
The Hdfcsec API is a managed, monitored endpoint for hdfcsec.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when hdfcsec.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official hdfcsec.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a live NSE/BSE market dashboard showing top gainers and losers filtered by Nifty 50 or Sensex index
- Alert system that monitors
get_52_week_high_stocksandget_52_week_low_stocksto notify users of breakout or breakdown events - Screen most active stocks by intraday volume using the
period=Ifilter onget_most_active_nse_stocks - Portfolio tracker that calls
get_stock_quotefor each held symbol to display currentltp,market_cap, andpe_ratio - Index discovery tool that uses
get_equity_market_overviewto enumerate all available BSE and NSE indices and their current values - Stock autocomplete search widget backed by
search_stockreturning ISIN and exchange for each match - Weekly performance report comparing
percent_changeacross gainers and losers using theperiod=Wparameter
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does HDFC Securities offer an official developer API?+
How do I find the correct index code to filter endpoints like `get_top_gainers_nse`?+
get_equity_market_overview with your target exchange (NSE or BSE). The response returns an array of index objects each containing index_name and index_code. Pass that index_code value to the index parameter on any of the movers or 52-week endpoints.Does `get_stock_quote` return historical OHLCV data or only the current quote?+
open, high, low, ltp, prev_close, and volume reflect the current trading session. Historical candlestick or OHLCV series data is not covered by any endpoint in this API. You can fork it on Parse and revise to add a historical data endpoint if that coverage is needed.