{
  "info": {
    "name": "BharatStock API (Public)",
    "description": "Complete Postman collection for the BharatStock Indian Stock Data API.\n\nSetup:\n1. Set the `base_url` variable to your server (default: http://localhost:8000)\n2. Run the 'Create API Key' request first — it auto-saves the key to the `api_key` variable\n3. All other requests use that key automatically via the collection-level auth header\n\nThis is the public distribution of the collection, linked from the API reference page -- it omits the operator-only 'Admin' folder (key minting bypassing checkout, manual UPI payment confirmation) and the `admin_secret` variable, which are internal tooling gated by a server-side secret that customers have no legitimate use for. See postman/BharatStock_API.postman_collection.json in the repo for the full internal collection.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://bharatstockapi.com",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "",
      "type": "string"
    },
    {
      "key": "ticker",
      "value": "RELIANCE",
      "type": "string"
    },
    {
      "key": "index_name",
      "value": "NIFTY 50",
      "type": "string"
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-API-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{api_key}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Stocks",
      "item": [
        {
          "name": "List Stocks",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has pagination', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData).to.have.property('data');",
                  "    pm.expect(jsonData).to.have.property('pagination');",
                  "    pm.expect(jsonData.pagination).to.have.property('total_items');",
                  "});",
                  "",
                  "pm.test('Data is an array', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.be.an('array');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks?page=1&page_size=10&active_only=true",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "10" },
                { "key": "active_only", "value": "true" },
                { "key": "q", "value": "", "disabled": true },
                { "key": "sector", "value": "", "disabled": true }
              ]
            },
            "description": "List all stocks with pagination. Enable the `q` param to search by symbol/company name, or `sector` to filter."
          }
        },
        {
          "name": "Compare Stocks (Sector Peers)",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response is an array', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData).to.be.an('array');",
                  "});",
                  "",
                  "pm.test('Rows have ratio fields', function () {",
                  "    var jsonData = pm.response.json();",
                  "    if (jsonData.length > 0) {",
                  "        var row = jsonData[0];",
                  "        pm.expect(row).to.have.property('pe_ratio');",
                  "        pm.expect(row).to.have.property('market_cap');",
                  "    }",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/compare?sector=Banking&sort=market_cap&limit=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "compare"],
              "query": [
                { "key": "sector", "value": "Banking" },
                { "key": "sort", "value": "market_cap" },
                { "key": "limit", "value": "20" }
              ]
            },
            "description": "Compare valuation/profitability ratios across every active stock in a sector, e.g. all Banking stocks sorted by market cap. `sort` accepts market_cap, pe_ratio, pb_ratio, roe, or roce -- highest value first, with stocks missing that field pushed to the end rather than excluded."
          }
        },
        {
          "name": "Batch Stock Quotes",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response is an array matching requested symbols', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData).to.be.an('array');",
                  "    pm.expect(jsonData.length).to.eql(3);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/quotes?symbols=RELIANCE,TCS,INFY",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "quotes"],
              "query": [
                { "key": "symbols", "value": "RELIANCE,TCS,INFY" }
              ]
            },
            "description": "Latest price snapshot for multiple tickers in one call (max 50), for building watchlists/dashboards without N separate GET /stocks/{ticker} calls. Unknown symbols are returned with `found: false` rather than failing the whole request."
          }
        },
        {
          "name": "Get Stock Detail",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has stock fields', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData).to.have.property('symbol');",
                  "    pm.expect(jsonData).to.have.property('isin');",
                  "    pm.expect(jsonData).to.have.property('company_name');",
                  "});",
                  "",
                  "pm.test('Has latest_price or null', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData).to.have.property('latest_price');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}"]
            },
            "description": "Get full company info + latest EOD price for a ticker. Change the `ticker` variable or replace {{ticker}} with any NSE symbol."
          }
        },
        {
          "name": "Get Stock Prices",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has paginated price data', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.be.an('array');",
                  "    pm.expect(jsonData.pagination.total_items).to.be.a('number');",
                  "});",
                  "",
                  "pm.test('Price rows have expected fields', function () {",
                  "    var jsonData = pm.response.json();",
                  "    if (jsonData.data.length > 0) {",
                  "        var row = jsonData.data[0];",
                  "        pm.expect(row).to.have.property('trade_date');",
                  "        pm.expect(row).to.have.property('open');",
                  "        pm.expect(row).to.have.property('close');",
                  "        pm.expect(row).to.have.property('volume');",
                  "    }",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/prices?page=1&page_size=50",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "prices"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "50" },
                { "key": "from", "value": "2025-08-01", "disabled": true },
                { "key": "to", "value": "2025-08-10", "disabled": true }
              ]
            },
            "description": "Historical daily OHLCV prices for a ticker. Enable `from` and `to` query params to filter by date range. Each row also includes `adjusted_close` and `adjustment_factor` -- close scaled down for any bonus/split that happened after that date, so prices are comparable across the whole history."
          }
        },
        {
          "name": "Get Stock Financials",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has paginated financial data', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.be.an('array');",
                  "    pm.expect(jsonData.pagination).to.have.property('total_items');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/financials?period_type=quarterly&page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "financials"],
              "query": [
                { "key": "period_type", "value": "quarterly" },
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" }
              ]
            },
            "description": "Quarterly or annual P&L data. Full breakdown includes revenue, expense line items, operating profit/EBITDA (derived), tax breakdown, net profit with minority-interest split, EPS (basic + diluted), capital structure, and segment-wise revenue/results. Change `period_type` to 'annual' for full-year results."
          }
        },
        {
          "name": "Get Stock Ratios",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has ratio fields', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData).to.have.property('pe_ratio');",
                  "    pm.expect(jsonData).to.have.property('pb_ratio');",
                  "    pm.expect(jsonData).to.have.property('roe');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/ratios",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "ratios"]
            },
            "description": "Valuation/profitability ratios for a ticker (P/E, P/B, ROE, ROCE, dividend yield, market cap, book value, 52-week high/low). Computed on read from the latest price and the latest annual financial statement (falls back to the latest quarterly filing if no annual data exists yet)."
          }
        },
        {
          "name": "Get Technical Indicators",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/technical-indicators?page=1&page_size=50&sma_period=20&ema_period=20&rsi_period=14",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "technical-indicators"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "50" },
                { "key": "sma_period", "value": "20" },
                { "key": "ema_period", "value": "20" },
                { "key": "rsi_period", "value": "14" }
              ]
            },
            "description": "SMA, EMA, RSI, and MACD for a ticker, computed on read from daily closing prices already ingested. Values are null wherever there isn't enough price history yet to compute them."
          }
        },
        {
          "name": "Get Shareholding Pattern",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/shareholding?page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "shareholding"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" }
              ]
            },
            "description": "Quarterly shareholding pattern (promoter/public/employee-trust split, with FII/DII/mutual-fund/individual sub-splits where NSE's filing reports them) for a ticker, most recent quarter first."
          }
        },
        {
          "name": "Get MF Holdings",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/mf-holdings?page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "mf-holdings"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" },
                { "key": "month", "value": "2026-07", "disabled": true }
              ]
            },
            "description": "Mutual fund holdings for a stock — which MF schemes hold this stock, with position size and month-over-month quantity change. Returns the latest available month by default, or a specific month if the 'month' query param is provided (format: YYYY-MM)."
          }
        },
        {
          "name": "Market Movers",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/movers?category=gainers&limit=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "movers"],
              "query": [
                { "key": "category", "value": "gainers" },
                { "key": "limit", "value": "20" }
              ]
            },
            "description": "Top gainers, losers, or most-active-by-volume stocks for the most recent trading day with price data. `category` accepts gainers, losers, or active."
          }
        },
        {
          "name": "Price Shockers",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/price-shockers?min_change_pct=5&direction=both&limit=50",
              "host": ["{{base_url}}"],
              "path": ["v1", "price-shockers"],
              "query": [
                { "key": "min_change_pct", "value": "5" },
                { "key": "direction", "value": "both" },
                { "key": "limit", "value": "50" }
              ]
            },
            "description": "Stocks whose price moved by at least `min_change_pct` percent versus the previous close, on the most recent trading day with price data."
          }
        }
      ]
    },
    {
      "name": "Market",
      "item": [
        {
          "name": "FII/DII Daily Activity",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/market/fii-dii?from=2026-08-01&to=2026-08-17",
              "host": ["{{base_url}}"],
              "path": ["v1", "market", "fii-dii"],
              "query": [
                { "key": "from", "value": "2026-08-01" },
                { "key": "to", "value": "2026-08-17" },
                { "key": "latest", "value": "true", "disabled": true, "description": "If true, return only the single most recent day (ignores from/to/limit)." }
              ]
            },
            "description": "Daily FII/DII aggregate cash market activity (buy/sell/net in ₹ Crores). Returns up to 30 days by default. Pass latest=true to get just the single most recent day (ignores from/to/limit)."
          }
        }
      ]
    },
    {
      "name": "Mutual Funds",
      "item": [
        {
          "name": "List / Search Schemes",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/mf/schemes?category=Flexi Cap&plan=Direct&option=Growth&limit=50",
              "host": ["{{base_url}}"],
              "path": ["v1", "mf", "schemes"],
              "query": [
                { "key": "q", "value": "", "disabled": true, "description": "Substring match on scheme name." },
                { "key": "amc", "value": "", "disabled": true, "description": "Filter by AMC name (substring)." },
                { "key": "category", "value": "Flexi Cap", "description": "AMFI category substring, e.g. 'Flexi Cap'." },
                { "key": "plan", "value": "Direct", "description": "'Direct' or 'Regular'." },
                { "key": "option", "value": "Growth", "description": "'Growth' or 'IDCW'." },
                { "key": "isin", "value": "", "disabled": true, "description": "Exact match on either ISIN." },
                { "key": "limit", "value": "50" },
                { "key": "offset", "value": "0" }
              ]
            },
            "description": "List/search mutual-fund schemes across all AMCs (the industry-wide AMFI NAV dataset, keyed by AMFI scheme_code = a scheme/plan/option variant). Paginated."
          }
        },
        {
          "name": "Scheme Detail + Latest NAV",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/mf/schemes/120503",
              "host": ["{{base_url}}"],
              "path": ["v1", "mf", "schemes", "120503"]
            },
            "description": "One scheme's identity plus its latest NAV (with as-of date). The path value is the AMFI scheme_code."
          }
        },
        {
          "name": "Scheme NAV History",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/mf/schemes/120503/nav?from=2024-01-01&to=2026-12-31&limit=400",
              "host": ["{{base_url}}"],
              "path": ["v1", "mf", "schemes", "120503", "nav"],
              "query": [
                { "key": "from", "value": "2024-01-01" },
                { "key": "to", "value": "2026-12-31" },
                { "key": "limit", "value": "400" }
              ]
            },
            "description": "Daily NAV history for one scheme, most recent first. Free-tier keys are limited to a recent window; paid keys get the full archive."
          }
        },
        {
          "name": "Scheme Returns",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/mf/schemes/120503/returns",
              "host": ["{{base_url}}"],
              "path": ["v1", "mf", "schemes", "120503", "returns"]
            },
            "description": "Trailing returns (1m/3m/6m/1y/3y/5y + since_inception) computed from the scheme's NAV series (CAGR for >=1y horizons). Always derived from the raw NAV, never precomputed."
          }
        }
      ]
    },
    {
      "name": "Status",
      "item": [
        {
          "name": "Data Trust / Status",
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/status",
              "host": ["{{base_url}}"],
              "path": ["v1", "status"]
            },
            "description": "Public data-integrity status (no API key required). Reports whether the daily freshness + correctness checks are currently passing, with each check's plain-English label, category, and status. Operator-only detail (counts, thresholds, offending rows) is never included."
          }
        }
      ]
    },
    {
      "name": "Screener",
      "item": [
        {
          "name": "Screen Stocks (Basic — Low PE Large Caps)",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has paginated data', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.be.an('array');",
                  "    pm.expect(jsonData.pagination).to.have.property('total_items');",
                  "});",
                  "",
                  "pm.test('Rows have screener fields', function () {",
                  "    var jsonData = pm.response.json();",
                  "    if (jsonData.data.length > 0) {",
                  "        var row = jsonData.data[0];",
                  "        pm.expect(row).to.have.property('symbol');",
                  "        pm.expect(row).to.have.property('pe_ratio');",
                  "        pm.expect(row).to.have.property('market_cap');",
                  "        pm.expect(row).to.have.property('roe');",
                  "        pm.expect(row).to.have.property('return_1y');",
                  "    }",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/screener?filter=pe_ratio.lt.15&filter=market_cap.gt.10000&page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "screener"],
              "query": [
                { "key": "filter", "value": "pe_ratio.lt.15" },
                { "key": "filter", "value": "market_cap.gt.10000" },
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" }
              ]
            },
            "description": "Screen stocks by pre-computed metrics. This example finds large-cap (>10,000 Cr) stocks with P/E below 15. All filter params are optional and can be combined freely. market_cap values are in Crores."
          }
        },
        {
          "name": "Screen Stocks (Growth — High ROE + Revenue Growth)",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has paginated data', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.be.an('array');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/screener?filter=roe.gt.15&filter=revenue_growth_yoy.gt.20&sort_by=roe&sort_order=desc&page=1&page_size=50",
              "host": ["{{base_url}}"],
              "path": ["v1", "screener"],
              "query": [
                { "key": "filter", "value": "roe.gt.15" },
                { "key": "filter", "value": "revenue_growth_yoy.gt.20" },
                { "key": "sort_by", "value": "roe" },
                { "key": "sort_order", "value": "desc" },
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "50" }
              ]
            },
            "description": "Growth screen: stocks with ROE > 15% AND revenue growth > 20% YoY, sorted by ROE descending."
          }
        },
        {
          "name": "Screen Stocks (Momentum — Near 52W High)",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has paginated data', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.be.an('array');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/screener?filter=distance_from_52w_high_pct.lt.5&filter=return_1m.gt.5&sort_by=return_1y&sort_order=desc&page=1&page_size=50",
              "host": ["{{base_url}}"],
              "path": ["v1", "screener"],
              "query": [
                { "key": "filter", "value": "distance_from_52w_high_pct.lt.5" },
                { "key": "filter", "value": "return_1m.gt.5" },
                { "key": "sort_by", "value": "return_1y" },
                { "key": "sort_order", "value": "desc" },
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "50" }
              ]
            },
            "description": "Momentum screen: stocks within 5% of their 52-week high AND with >5% return in the last month, sorted by 1-year return."
          }
        },
        {
          "name": "Screen Stocks (Sector Filter — IT High Margin)",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has paginated data', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.be.an('array');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/screener?filter=operating_margin.gt.20&sector=Information+Technology&sort_by=market_cap&page=1&page_size=50",
              "host": ["{{base_url}}"],
              "path": ["v1", "screener"],
              "query": [
                { "key": "filter", "value": "operating_margin.gt.20" },
                { "key": "sector", "value": "Information Technology" },
                { "key": "sort_by", "value": "market_cap" },
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "50" }
              ]
            },
            "description": "Sector-specific screen: IT sector stocks with operating margin > 20%, sorted by market cap."
          }
        },
        {
          "name": "Screen Stocks (All Filters — Kitchen Sink)",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has paginated data', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.data).to.be.an('array');",
                  "    pm.expect(jsonData.pagination).to.have.property('total_items');",
                  "    pm.expect(jsonData.pagination).to.have.property('total_pages');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/screener?filter=pe_ratio.lt.25&filter=pe_ratio.gt.5&filter=pb_ratio.lt.5&filter=market_cap.gt.5000&filter=roe.gt.12&filter=roce.gt.12&filter=operating_margin.gt.10&filter=net_margin.gt.5&filter=revenue_growth_yoy.gt.10&filter=profit_growth_yoy.gt.10&filter=return_1y.gt.0&filter=promoter_holding.gt.40&filter=dividend_yield.gt.1&sort_by=market_cap&sort_order=desc&page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "screener"],
              "query": [
                { "key": "filter", "value": "pe_ratio.lt.25" },
                { "key": "filter", "value": "pe_ratio.gt.5" },
                { "key": "filter", "value": "pb_ratio.lt.5" },
                { "key": "filter", "value": "market_cap.gt.5000" },
                { "key": "filter", "value": "roe.gt.12" },
                { "key": "filter", "value": "roce.gt.12" },
                { "key": "filter", "value": "operating_margin.gt.10" },
                { "key": "filter", "value": "net_margin.gt.5" },
                { "key": "filter", "value": "revenue_growth_yoy.gt.10" },
                { "key": "filter", "value": "profit_growth_yoy.gt.10" },
                { "key": "filter", "value": "return_1y.gt.0" },
                { "key": "filter", "value": "promoter_holding.gt.40" },
                { "key": "filter", "value": "dividend_yield.gt.1" },
                { "key": "sort_by", "value": "market_cap" },
                { "key": "sort_order", "value": "desc" },
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" }
              ]
            },
            "description": "Demonstrates combining many filters at once: mid-to-large cap, reasonable PE (5-25), high profitability (ROE/ROCE >12%), growing (revenue+profit >10% YoY), positive 1Y return, high promoter holding (>40%), dividend paying (>1% yield). Unlikely to match many stocks but shows the full filter API surface."
          }
        }
      ]
    },
    {
      "name": "Corporate Actions",
      "item": [
        {
          "name": "Get Corporate Actions",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/corporate-actions?page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "corporate-actions"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" },
                { "key": "action_type", "value": "dividend", "disabled": true }
              ]
            },
            "description": "Corporate actions (dividends, bonuses, splits, rights issues, buybacks) for a ticker. Enable `action_type` to filter by one of: dividend, bonus, split, rights, buyback, other."
          }
        }
      ]
    },
    {
      "name": "Deals & Insider Trades",
      "description": "Bulk deals (single-day trades >0.5% of equity), block deals (exchange's large-ticket window), and insider/promoter SEBI PIT disclosures. Per-ticker and market-wide endpoints.",
      "item": [
        {
          "name": "Get Stock Bulk Deals",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has pagination', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData).to.have.property('data');",
                  "    pm.expect(jsonData).to.have.property('pagination');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/bulk-deals?page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "bulk-deals"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" },
                { "key": "buy_sell", "value": "BUY", "disabled": true }
              ]
            },
            "description": "Bulk deals for a ticker — large trades where one client traded >0.5% of listed equity in a single day. Enable `buy_sell` to filter by BUY or SELL only."
          }
        },
        {
          "name": "Get Stock Block Deals",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/block-deals?page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "block-deals"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" },
                { "key": "buy_sell", "value": "", "disabled": true }
              ]
            },
            "description": "Block deals for a ticker — large trades executed in the exchange's dedicated block window (minimum ticket size ~₹10 Cr)."
          }
        },
        {
          "name": "Get Stock Insider Trades",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Data items have acquirer_name', function () {",
                  "    var jsonData = pm.response.json();",
                  "    if (jsonData.data.length > 0) {",
                  "        pm.expect(jsonData.data[0]).to.have.property('acquirer_name');",
                  "        pm.expect(jsonData.data[0]).to.have.property('transaction_type');",
                  "    }",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/{{ticker}}/insider-trades?page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "{{ticker}}", "insider-trades"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" },
                { "key": "transaction_type", "value": "acquisition", "disabled": true },
                { "key": "promoters_only", "value": "true", "disabled": true }
              ]
            },
            "description": "Insider / promoter (SEBI PIT) disclosures for a ticker. Enable `promoters_only=true` for promoter/promoter-group only, or `transaction_type=acquisition|disposal` to filter."
          }
        },
        {
          "name": "Market-Wide Bulk Deals",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Data items have symbol', function () {",
                  "    var jsonData = pm.response.json();",
                  "    if (jsonData.data.length > 0) {",
                  "        pm.expect(jsonData.data[0]).to.have.property('symbol');",
                  "    }",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/deals/bulk?page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "deals", "bulk"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" },
                { "key": "buy_sell", "value": "", "disabled": true }
              ]
            },
            "description": "Recent bulk deals across all stocks, most recent first. Includes `symbol` and `company_name` in each row."
          }
        },
        {
          "name": "Market-Wide Block Deals",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/deals/block?page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "deals", "block"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" },
                { "key": "buy_sell", "value": "", "disabled": true }
              ]
            },
            "description": "Recent block deals across all stocks, most recent first."
          }
        },
        {
          "name": "Market-Wide Insider Trades",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Data items have is_promoter field', function () {",
                  "    var jsonData = pm.response.json();",
                  "    if (jsonData.data.length > 0) {",
                  "        pm.expect(jsonData.data[0]).to.have.property('is_promoter');",
                  "        pm.expect(jsonData.data[0]).to.have.property('symbol');",
                  "    }",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/insider-trades?page=1&page_size=20",
              "host": ["{{base_url}}"],
              "path": ["v1", "insider-trades"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" },
                { "key": "transaction_type", "value": "", "disabled": true },
                { "key": "promoters_only", "value": "true", "disabled": true }
              ]
            },
            "description": "Recent insider/promoter disclosures across all stocks. Enable `promoters_only=true` for promoter-only or `transaction_type=acquisition|disposal` to filter."
          }
        }
      ]
    },
    {
      "name": "Indices",
      "item": [
        {
          "name": "List Indices",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/indices?page=1&page_size=20&active_only=true",
              "host": ["{{base_url}}"],
              "path": ["v1", "indices"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "20" },
                { "key": "active_only", "value": "true" }
              ]
            },
            "description": "List all tracked NSE indices. Enable `category` to filter (e.g. broad-market, sectoral, thematic)."
          }
        },
        {
          "name": "Get Index Prices",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/indices/{{index_name}}/prices?page=1&page_size=50",
              "host": ["{{base_url}}"],
              "path": ["v1", "indices", "{{index_name}}", "prices"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "50" }
              ]
            },
            "description": "Historical daily OHLC data for an index. `{{index_name}}` defaults to 'NIFTY 50' — Postman URL-encodes the space automatically."
          }
        }
      ]
    },
    {
      "name": "Search",
      "item": [
        {
          "name": "Search Stocks",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/search?q=reliance&limit=10",
              "host": ["{{base_url}}"],
              "path": ["v1", "search"],
              "query": [
                { "key": "q", "value": "reliance" },
                { "key": "limit", "value": "10" }
              ]
            },
            "description": "Fuzzy search across ticker symbols and company names. Exact symbol matches rank first."
          }
        }
      ]
    },
    {
      "name": "Error Cases",
      "item": [
        {
          "name": "Missing API Key (401)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks"]
            },
            "auth": {
              "type": "noauth"
            },
            "description": "Demonstrates the 401 response when no X-API-Key header is provided."
          }
        },
        {
          "name": "Unknown Ticker (404)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/DOESNOTEXIST",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "DOESNOTEXIST"]
            },
            "description": "Demonstrates the 404 response for an unknown ticker symbol."
          }
        }
      ]
    },
    {
      "name": "Shared Tickers (NSE vs BSE)",
      "description": "A few tickers belong to two DIFFERENT companies — one on NSE, the other on BSE. Example: KALYANI is Kalyani Commercials Limited on NSE and Kalyani Cast-Tech Limited on BSE. The plain /v1/stocks/{ticker} returns the NSE listing by default. Use the ?exchange= query param to pick the other listing, or address a specific listing directly by its ISIN in the path (globally unique). Both work on every /v1/stocks/{ticker}/... sub-endpoint.",
      "item": [
        {
          "name": "KALYANI — default (NSE)",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Returns the NSE listing by default', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.symbol).to.eql('KALYANI');",
                  "    pm.expect(jsonData.exchange).to.eql('NSE');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/KALYANI",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "KALYANI"]
            },
            "description": "Plain ticker: returns the NSE company (Kalyani Commercials Limited), the default when a ticker is shared across exchanges."
          }
        },
        {
          "name": "KALYANI — ?exchange=BSE",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('exchange=BSE returns the BSE company', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.symbol).to.eql('KALYANI');",
                  "    pm.expect(jsonData.exchange).to.eql('BSE');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/KALYANI?exchange=BSE",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "KALYANI"],
              "query": [
                { "key": "exchange", "value": "BSE" }
              ]
            },
            "description": "Disambiguate a shared ticker by exchange: returns the BSE company (Kalyani Cast-Tech Limited). Pass NSE or BSE. The ?exchange= param works on every /v1/stocks/{ticker}/... sub-endpoint too (prices, financials, corporate-actions, ratios, shareholding, mf-holdings, technical-indicators)."
          }
        },
        {
          "name": "KALYANI (BSE) — by ISIN",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('ISIN path resolves that exact listing', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData.isin).to.eql('INE0N6U01018');",
                  "    pm.expect(jsonData.exchange).to.eql('BSE');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/INE0N6U01018",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "INE0N6U01018"]
            },
            "description": "Address a specific listing directly by its ISIN in the path (globally unique, never ambiguous) — here the BSE Kalyani Cast-Tech listing. Any endpoint that takes {ticker} accepts an ISIN in its place. The `isin` of any result is in its response body."
          }
        },
        {
          "name": "KALYANI (BSE) prices — ?exchange=BSE",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status is 200', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test('Response has pagination', function () {",
                  "    var jsonData = pm.response.json();",
                  "    pm.expect(jsonData).to.have.property('data');",
                  "    pm.expect(jsonData).to.have.property('pagination');",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/stocks/KALYANI/prices?exchange=BSE&page=1&page_size=10",
              "host": ["{{base_url}}"],
              "path": ["v1", "stocks", "KALYANI", "prices"],
              "query": [
                { "key": "exchange", "value": "BSE" },
                { "key": "page", "value": "1" },
                { "key": "page_size", "value": "10" }
              ]
            },
            "description": "Sub-endpoints honour ?exchange= too — daily prices for the BSE Kalyani Cast-Tech listing rather than the NSE default."
          }
        }
      ]
    }
  ]
}
