# Indian Stock Market API — Full Reference (Developer & Pro)

This document covers all endpoints available on dedicated server plans (Developer, Growth, Pro).

> **[AI Agent Instructions]**
> This file provides a high-level overview. For the **complete, machine-readable OpenAPI specification** including every response schema, parameter, and definition, you should fetch `https://<dedicated_base_url>/openapi.json` (e.g., `https://dev.indianapi.in/openapi.json`). 

For the standard Free/Hobby endpoint reference, see: https://indianapi.in/documentation/indian-stock-market

> Upgrade to Developer or above for 30+ additional endpoints, dedicated server, higher uptime, and priority support. Get started at https://indianapi.in

---

## Dedicated Base URLs

| Plan | Requests/Month | Base URL |
|------|----------------|----------|
| Developer | 10,000 | https://dev.indianapi.in |
| Growth | 50,000 | https://analyst.indianapi.in |
| Pro | 100,000 | https://pro.indianapi.in |
| Enterprise | Custom | Dedicated |

Dedicated server is provisioned automatically within 5 minutes. For issues email contact@indianapi.in from your subscribed email.

All dedicated plans share the same endpoints — switch base URLs without changing any other code.

---

## Authentication

```
X-API-Key: YOUR_API_KEY_HERE
```

---

## Available Stock & Fund Lists

- All Stocks: https://dev.indianapi.in/static/all_stocks.json
- All Mutual Funds: https://dev.indianapi.in/static/all_mf.json

---

## Endpoints

### Search & Discovery

#### GET /stock — Get Stock Details

Parameters (provide at least one): `name`, `symbol`, `id`

```bash
curl -H "X-API-Key: YOUR_KEY" "https://dev.indianapi.in/stock?name=TCS"
curl -H "X-API-Key: YOUR_KEY" "https://dev.indianapi.in/stock?symbol=INFY"
curl -H "X-API-Key: YOUR_KEY" "https://dev.indianapi.in/stock?id=S0003032"
```

Key response fields: companyName, industry, currentPrice {BSE, NSE}, percentChange, yearHigh, yearLow, financials, keyMetrics, analystView, shareholding, stockCorporateActionData, recentNews.

#### GET /industry_search — Search by Industry

Parameter: `query` (required) — e.g., "Banking", "Power", "Tata"

#### GET /mutual_fund_search — Search Mutual Funds

Parameter: `query` (required) — e.g., "Nippon", "ELSS", "SBI Bluechip"

---

### Live Pricing

#### GET /get_stock_data — Live Stock Data

Parameter: `stock_name` (required)

Response: open, high, low, close, ltp, volume, timestamp, day_change, day_change_percent.

#### POST /nse_stock_batch_live_price — NSE Batch Live Price

Request body: `{"stock_symbols": ["INFY", "TCS", "RELIANCE"]}`

#### POST /bse_stock_batch_live_price — BSE Batch Live Price

Request body: `{"stock_symbols": ["532822", "543257"]}` (numeric BSE script codes)

#### POST /1D_intraday_data — 1-Day Intraday Data

Parameter: `stock_id` (required) — Indian API stock ID from /static/all_stocks.json

Returns 5-minute interval data. Switches to 1-minute intervals after market close.

---

### Market Overview

#### GET /indices — Market Indices

Parameters: `exchange` (NSE/BSE, optional), `index_type` (POPULAR/SECTOR, optional)

Returns: SENSEX, NIFTY 50, Bank Nifty, sectoral indices with price, percentChange, netChange.

#### GET /trending — Trending Stocks

Parameter: `exchange` (NSE/BSE, optional)

Returns top_gainers and top_losers with full OHLC, volume, circuit limits, trend ratings, year high/low.

#### GET /fetch_52_week_high_low_data — 52-Week High/Low

Returns BSE_52WeekHighLow and NSE_52WeekHighLow with high52Week and low52Week arrays.

#### GET /NSE_most_active — NSE Most Active

Most traded NSE stocks by volume: ticker, company, price, percent_change, volume, overall_rating.

#### GET /BSE_most_active — BSE Most Active

Most traded BSE stocks by volume. Same fields as NSE.

#### GET /price_shockers — Price Shockers

Stocks with largest deviation from average: BSE_PriceShocker and NSE_PriceShocker arrays with deviation, averagePrice.

---

### Company Fundamentals

#### GET /corporate_actions — Corporate Actions

Parameter: `stock_name` (required)
Returns dividends, splits, bonuses, rights issues history.

#### GET /logo — Company Logo

Parameters: `stock_name` or `mutual_fund`
Returns: `{"content_type": "image/png", "base64_image": "..."}`

#### GET /credit_ratings — Credit Ratings

Parameter: `stock_name` (required)
Returns CRISIL, ICRA, CARE ratings.

#### GET /concalls — Conference Calls

Parameter: `stock_name` (required)
Returns earnings call transcripts and recordings.

#### GET /annual_reports — Annual Reports

Parameter: `stock_name` (required)
Returns download links for annual reports.

#### GET /documents — Company Documents

Parameter: `stock_name` (required)
Returns regulatory filings — results, presentations, notices.

#### GET /recent_announcements — Recent Announcements

Parameter: `stock_name` (required)
Returns board meetings, results, insider trading disclosures.

---

### Historical & Financials

#### GET /historical_data — Historical Price Data

Parameters:
- `stock_name` (required)
- `period` (required): 1m, 6m, 1yr, 3yr, 5yr, 10yr, max
- `filter` (required): default, price, pe, sm, evebitda, ptb, mcs

Returns datasets array with Price, 50-DMA, 200-DMA, Volume time series.

#### GET /historical_stats — Historical Financial Stats

Parameters:
- `stock_name` (required)
- `stats` (required): quarter_results, yoy_results, balancesheet, cashflow, ratios, profit_loss_stats, all

#### GET /statement — Latest Financial Statement

Parameters:
- `stock_name` (required)
- `stats` (required): quarter_results, ttm_results, yoy_results, balancesheet, cashflow

Returns latest snapshot: sales, expenses, operating_profit, opm, net_profit, eps.

---

### Forecasts & Targets

#### GET /stock_target_price — Analyst Target Price

Parameter: `stock_id` (required)

Returns: priceTarget {Mean, High, Low, Median, NumberOfEstimates} and recommendation distribution.
Recommendation scale: 1 = Strong Buy, 2 = Outperform, 3 = Hold, 4 = Underperform, 5 = Sell.

#### GET /stock_forecasts — Analyst Forecasts

Parameters:
- `stock_id` (required)
- `measure_code` (required): EPS, SAL, NET, EBT, EBI, ROE, ROA, DPS, NAV, NDT, PRE, GRM, CPS, CPX, GPS
- `period_type` (required): Annual, Interim
- `data_type` (required): Actuals, Estimates
- `age` (required): Current, OneWeekAgo, ThirtyDaysAgo, SixtyDaysAgo, NinetyDaysAgo

---

### Mutual Funds

#### GET /mutual_funds — All Mutual Funds

Returns full fund universe by category. Each fund: fund_name, latest_nav, percentage_change, asset_size, 1-5 year returns, star_rating.

#### GET /mutual_funds_details — Fund Details

Parameter: `stock_name` (required, full fund name)

#### GET /get_mf_historical_data — Fund NAV History

Parameters: `stock_id` (fund ID), `stats` (5D, 1M, 6M, 1Y, 5Y, MAX)

#### GET /mf_holdings — Fund Holdings

Parameter: `stock_id` (required)
Returns portfolio stocks with allocation percentages.

---

### IPO

#### GET /ipo — IPO Data

Returns upcoming, open, and listed IPOs with status, price band, SEBI filing links.

#### GET /ipo/v2 — Enhanced IPO Data (Beta)

Parameters: `status` (open/closed/listed/upcoming), `issue_type` (mainboard/sme, optional)

#### GET /ipo/{id} — IPO Details by ID

Parameter: `id` (IPO slug)
Returns pricing, subscription data by category (Retail/NII/QIB), timeline, listing performance.

---

### News & Insights

#### GET /news — Market News

Parameters: `page_no` (default 1), `size` (default 20)
Fields: title, summary, url, image_url, pub_date, source, topics.

#### GET /company_news — Company News

Parameter: `stock_name` (required)

#### GET /ai_news — AI-Curated News (Beta)

Parameter: `category` (optional): stock_market, mutual_funds, ipo, investing, economy, commodities

---

### Commodities

#### GET /commodities — Commodity Futures

Live MCX futures — Gold, Silver, Crude Oil, Natural Gas, Copper.
Fields: product, expiry, last_traded_price, open/high/low/close price, total_quantity_traded, open_interest, change, per_change, oiResult.

---

### Utility

#### GET /usage — API Usage Stats

Returns: total_requests, hard_limit, remaining_requests, endpoint_usage (per-endpoint breakdown).

#### GET /ping — Health Check

Returns: `{"message": "Pong!"}`

---

## Error Handling

| Status Code | Meaning |
|-------------|---------|
| 200 | Success |
| 401 | Unauthorized — invalid or missing API key |
| 422 | Validation error — missing or invalid parameters |
| 429 | Rate limit exceeded |
| 500 | Internal server error |

---

## Notes

- All prices in INR (₹) unless stated otherwise
- Timestamps in Indian Standard Time (IST)
- Market hours: weekdays 9:15 AM – 3:30 PM IST
- Support: contact@indianapi.in from your subscribed email address
