{
  "components": {
    "schemas": {
      "Envelope": {
        "description": "Standard DalalOS response envelope (src/models.py). `source` is a per-tool provenance tag; `stale`/`data_age_seconds` describe cache freshness.",
        "properties": {
          "cached_at": {
            "description": "ISO timestamp the served data was refreshed.",
            "nullable": true,
            "type": "string"
          },
          "data": {
            "description": "Tool payload (object or array); null on error."
          },
          "data_age_seconds": {
            "description": "Present only when cached_at is set.",
            "type": "number"
          },
          "error": {
            "nullable": true,
            "type": "string"
          },
          "reason_code": {
            "description": "Stable machine-readable category (no_data, not_found, bad_request, ...).",
            "nullable": true,
            "type": "string"
          },
          "resolved_via": {
            "description": "Present only when a query resolved via a rename/merger alias.",
            "type": "string"
          },
          "source": {
            "nullable": true,
            "type": "string"
          },
          "stale": {
            "type": "boolean"
          },
          "status": {
            "enum": [
              "success",
              "error"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "stale"
        ],
        "type": "object"
      },
      "ErrorEnvelope": {
        "properties": {
          "error": {
            "type": "string"
          },
          "reason_code": {
            "nullable": true,
            "type": "string"
          },
          "source": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "error"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "error"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "description": "DalalOS API key (`isk_live_...`) as a Bearer token. Create one in the DalalOS dashboard.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "contact": {
      "name": "DalalOS",
      "url": "https://dalalos.in"
    },
    "description": "BETA \u2014 new tools/routes/fields are still being added; the specifics of an individual route's payload may grow. STABILITY POLICY (issue #333, in effect since 2026-07-18): `/v1` is ADDITIVE-ONLY -- a published route, field, or `reason_code` value is never silently removed or renamed. The envelope shape itself (`status`/`data`/`cached_at`/`source`/`stale`/`error`/`reason_code`, plus the conditional `resolved_via`/`data_age_seconds` -- see the `Envelope` schema) and every `reason_code` value in current use are STABLE under that rule. When a route or tool is renamed (e.g. issue #285's `/fii-dii` -> `/market-fii-dii-flow`), the OLD path is kept working as a deprecated alias -- marked `\"deprecated\": true` on its operation here, and carrying RFC 8594 `Deprecation`/`Sunset`/`Link` response headers once a removal date exists (mechanism: `src/deprecation.py`) -- rather than being deleted outright. VERSION-NEGOTIATION POSTURE: `/v1` is the breaking-change boundary. A genuinely breaking change (removing/renaming a field or route without an alias, changing a field's type/meaning, or repurposing a `reason_code`) ships as a new `/v2` mount, never a silent mutation of `/v1` -- there is no per-request version header to negotiate; the path prefix IS the version. See CHANGELOG.md for the policy's introduction and any future deprecations. This is the HTTP/JSON adapter over the same read-only tools the MCP server exposes; every response is the standard DalalOS envelope. All data is raw-as-reported or a mechanically-computed ratio \u2014 never a verdict, target price, or buy/sell call (SEBI research-analyst boundary). Authenticate with an `isk_live_` API key as a Bearer token (create one in the DalalOS dashboard) \u2014 except on the routes whose own operation declares an empty `security` array, which take no credential at all (today: `GET /reports/{symbol}`, the company report behind a public web page). The account/key-management control-plane (`/v1/account/*`) is intentionally NOT part of this public spec.",
    "title": "DalalOS Indian Stock REST API",
    "version": "0.1.0-beta",
    "x-api-status": "beta"
  },
  "openapi": "3.1.0",
  "paths": {
    "/buckets": {
      "get": {
        "description": "Market-wide BSE announcement discovery buckets (id + label).",
        "operationId": "buckets",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "List announcement buckets",
        "tags": [
          "Calendar & Events"
        ]
      }
    },
    "/buckets/{bucket}": {
      "get": {
        "description": "Every company that filed a matching BSE announcement in a window.",
        "operationId": "buckets_bucket",
        "parameters": [
          {
            "description": "Path parameter: bucket.",
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Trailing window (1..90).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 7,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Announcement bucket",
        "tags": [
          "Calendar & Events"
        ]
      }
    },
    "/calendar": {
      "get": {
        "description": "Unified market-wide event calendar (results + corporate actions).",
        "operationId": "calendar",
        "parameters": [
          {
            "description": "Start date (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End date (YYYY-MM-DD; window <= 180 days).",
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated event-type filter.",
            "in": "query",
            "name": "types",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max rows (1..2000).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 500,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Market calendar",
        "tags": [
          "Calendar & Events"
        ]
      }
    },
    "/fii-dii": {
      "get": {
        "deprecated": true,
        "description": "DEPRECATED (issue #285): renamed to `/market-fii-dii-flow`. Kept as a working alias for this release (see the `Deprecation`/`Link` response headers, RFC 8594) -- same data, same params, no removal date committed yet.",
        "operationId": "fii_dii",
        "parameters": [
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "cash only; F&O uses participant activity.",
            "in": "query",
            "name": "segment",
            "required": false,
            "schema": {
              "default": "cash",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Market-wide FII/DII flow (deprecated alias)",
        "tags": [
          "Market Flows & Breadth"
        ]
      }
    },
    "/fii-dii/sectors": {
      "get": {
        "description": "Daily FII/FPI net flow aggregated by sector (CDSL-only coverage).",
        "operationId": "fii_dii_sectors",
        "parameters": [
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional sector filter.",
            "in": "query",
            "name": "sector",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Sector-wise FII flow",
        "tags": [
          "Market Flows & Breadth"
        ]
      }
    },
    "/fo-ban-list": {
      "get": {
        "description": "Full NSE F&O securities-in-ban list for the most-recently-published trading day, market-wide (every banned symbol/index plus the snapshot's ban_date) \u2014 the whole-list companion to the per-underlying `in_ban_list` field on the derivatives-positioning route.",
        "operationId": "fo_ban_list",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "F&O securities-in-ban list",
        "tags": [
          "Market Flows & Breadth"
        ]
      }
    },
    "/fo-participant-activity": {
      "get": {
        "description": "Daily participant-wise (FII/DII/Pro/Client) F&O open interest & volume, market-wide.",
        "operationId": "fo_participant_activity",
        "parameters": [
          {
            "description": "Lookback window (1..366).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "F&O participant-wise OI/volume",
        "tags": [
          "Market Flows & Breadth"
        ]
      }
    },
    "/fpi/sectors": {
      "get": {
        "description": "Fortnightly FPI net investment and assets under custody by NSDL sector, across both depositories (INR crore and USD million).",
        "operationId": "fpi_sectors",
        "parameters": [
          {
            "description": "Optional ISO date (YYYY-MM-DD), matched to period_end.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD), matched to period_end.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional NSDL sector label (case-insensitive).",
            "in": "query",
            "name": "sector",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "equity | debt_general | debt_vrr | debt_far | hybrid | aif | total | mf_equity | mf_debt | mf_hybrid | mf_solution_oriented | mf_other.",
            "in": "query",
            "name": "instrument",
            "required": false,
            "schema": {
              "default": "equity",
              "type": "string"
            }
          },
          {
            "description": "Also return pre-2022 nested sub-sector rows.",
            "in": "query",
            "name": "include_subsectors",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Sector-wise FPI investment (NSDL)",
        "tags": [
          "Market Flows & Breadth"
        ]
      }
    },
    "/freshness": {
      "get": {
        "description": "Last successful refresh per data domain and overall cache health.",
        "operationId": "freshness",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Cache freshness",
        "tags": [
          "Meta"
        ]
      }
    },
    "/index-valuations": {
      "get": {
        "description": "Every NSE index name tracked, with its latest close.",
        "operationId": "index_valuations",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "List NSE index valuations",
        "tags": [
          "Sectors & Indices"
        ]
      }
    },
    "/index-valuations/{index}": {
      "get": {
        "description": "NSE's own daily OHLC + P/E + P/B + Div-Yield for one index.",
        "operationId": "index_valuations_index",
        "parameters": [
          {
            "description": "Path parameter: index.",
            "in": "path",
            "name": "index",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "NSE index valuation series",
        "tags": [
          "Sectors & Indices"
        ]
      }
    },
    "/india-vix": {
      "get": {
        "description": "NSE's daily India VIX OHLC series.",
        "operationId": "india_vix",
        "parameters": [
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "India VIX series",
        "tags": [
          "Sectors & Indices"
        ]
      }
    },
    "/indices": {
      "get": {
        "description": "Market indices for which constituent membership is cached.",
        "operationId": "indices",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "List indices",
        "tags": [
          "Sectors & Indices"
        ]
      }
    },
    "/indices/{index}/constituents": {
      "get": {
        "description": "Member securities of an index (names from /indices).",
        "operationId": "indices_index_constituents",
        "parameters": [
          {
            "description": "Path parameter: index.",
            "in": "path",
            "name": "index",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max constituents (1..500).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Index constituents",
        "tags": [
          "Sectors & Indices"
        ]
      }
    },
    "/indices/{index}/heatmap": {
      "get": {
        "description": "Valuation + multi-horizon returns for an index's constituents.",
        "operationId": "indices_index_heatmap",
        "parameters": [
          {
            "description": "Path parameter: index.",
            "in": "path",
            "name": "index",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max constituents (1..500).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Index heatmap",
        "tags": [
          "Sectors & Indices"
        ]
      }
    },
    "/ipos": {
      "get": {
        "description": "IPO / public-issue records: upcoming, open, listing pending, or listed.",
        "operationId": "ipos",
        "parameters": [
          {
            "description": "upcoming | open | listing_pending | listed (omit for all).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max rows (1..500).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "IPO records",
        "tags": [
          "IPOs"
        ]
      }
    },
    "/macro/fx-rates": {
      "get": {
        "description": "Daily FBIL INR reference rates (USD/GBP/EUR/JPY/AED/IDR).",
        "operationId": "macro_fx_rates",
        "parameters": [
          {
            "description": "Optional pair filter (e.g. USD/INR).",
            "in": "query",
            "name": "currency_pair",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "FBIL FX reference rates",
        "tags": [
          "Macro & FX"
        ]
      }
    },
    "/macro/indicators": {
      "get": {
        "description": "Official MOSPI CPI/WPI/IIP/GDP and PPAC crude-basket series.",
        "operationId": "macro_indicators",
        "parameters": [
          {
            "description": "cpi | wpi | iip | gdp | crude_basket.",
            "in": "query",
            "name": "dataset",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional start period (YYYY-MM, or FY like 2024-25 for gdp).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional end period.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Substring filter on series_key.",
            "in": "query",
            "name": "series_contains",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max rows (1..2000).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 200,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Macro indicators",
        "tags": [
          "Macro & FX"
        ]
      }
    },
    "/market-breadth": {
      "get": {
        "description": "Whole-market advances/declines/unchanged counts per trading day.",
        "operationId": "market_breadth",
        "parameters": [
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Advance/decline breadth",
        "tags": [
          "Market Flows & Breadth"
        ]
      }
    },
    "/market-fii-dii-flow": {
      "get": {
        "description": "Daily market-wide FII/DII net cash flow (Rs crore). Renamed from `/fii-dii` (issue #285) so the path itself telegraphs scope against `/fii-dii/sectors` and `/stocks/{q}/fii-flow`; `/fii-dii` is kept as a deprecated alias for this release.",
        "operationId": "market_fii_dii_flow",
        "parameters": [
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "cash only; F&O uses participant activity.",
            "in": "query",
            "name": "segment",
            "required": false,
            "schema": {
              "default": "cash",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Market-wide FII/DII flow",
        "tags": [
          "Market Flows & Breadth"
        ]
      }
    },
    "/presets": {
      "get": {
        "description": "Fixed, nightly-precomputed preset screens.",
        "operationId": "presets",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "List preset screens",
        "tags": [
          "Screening"
        ]
      }
    },
    "/presets/{name}": {
      "get": {
        "description": "Last nightly-precomputed result for one preset (names from /presets).",
        "operationId": "presets_name",
        "parameters": [
          {
            "description": "Path parameter: name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Run a preset screen",
        "tags": [
          "Screening"
        ]
      }
    },
    "/quotes": {
      "get": {
        "description": "EOD quotes for up to 20 symbols in one call.",
        "operationId": "quotes",
        "parameters": [
          {
            "description": "Comma-separated NSE symbols / ISINs / BSE codes (max 20).",
            "in": "query",
            "name": "symbols",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Batch EOD quotes",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/ratios": {
      "get": {
        "description": "The canonical catalogue of every screener metric: canonical id, label, storage unit, value type, whether it can be filtered and sorted, company-type validity, and Screener.in compatibility metadata. Process-static for a deployed backend version; no storage detail is exposed.",
        "operationId": "ratios",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Metric registry",
        "tags": [
          "Screening"
        ]
      }
    },
    "/reports/{symbol}": {
      "get": {
        "description": "The same source-linked canonical company report as `/stocks/{q}/report`, over a FIXED reporting window, on a route that needs NO `Authorization` header \u2014 it backs a public web page linked from emailed briefs, where the reader has no session. `data` is uniform in both directions: `report_available`, `company` (always present), `readiness` (`ready`|`limited`|`insufficient` plus the issues behind it), and `report` (the `company_report_v1` payload, or `null`). A company that resolves but has too little cached data returns 200 with `readiness.status=\"insufficient\"` \u2014 never an error \u2014 carrying a thin report when one could still be assembled, or `report: null` plus `reason_code=\"no_data\"` when none could. Takes no query parameters: unlike every other data route it is not metered per account, so the window is fixed and results are briefly cached server-side. Raw data only, no verdicts.",
        "operationId": "reports_symbol",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code (retired tickers resolve via the alias map).",
            "in": "path",
            "name": "symbol",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "security": [],
        "summary": "Public company report (no API key required)",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/results-calendar": {
      "get": {
        "description": "Companies with an upcoming board-meeting / results date.",
        "operationId": "results_calendar",
        "parameters": [
          {
            "description": "Forward window (1..90).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 14,
              "type": "integer"
            }
          },
          {
            "description": "Optional sector filter.",
            "in": "query",
            "name": "sector",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max rows (1..200).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Upcoming results",
        "tags": [
          "Calendar & Events"
        ]
      }
    },
    "/screen": {
      "get": {
        "description": "Filter securities by mechanical criteria. Any query param other than sort_by/order/limit is treated as a filter (e.g. `pe_max=20`, `roe_min=0.15`, `sector=IT`); an unknown filter key returns a bad_request listing every accepted key.",
        "operationId": "screen",
        "parameters": [
          {
            "description": "Metric to sort by.",
            "in": "query",
            "name": "sort_by",
            "required": false,
            "schema": {
              "default": "market_cap",
              "type": "string"
            }
          },
          {
            "description": "asc or desc.",
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "default": "desc",
              "type": "string"
            }
          },
          {
            "description": "Max rows (1..100).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Screen the universe",
        "tags": [
          "Screening"
        ]
      }
    },
    "/screen/latest-results": {
      "get": {
        "description": "The quarter `only_latest_results` restricts a screen to: the most recent quarterly `period_end` that at least 50 companies have filed for, with how many have filed and the universe size. Derived from the cached filings, never typed.",
        "operationId": "screen_latest_results",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Current results season",
        "tags": [
          "Screening"
        ]
      }
    },
    "/screen/query": {
      "post": {
        "description": "Screen the universe with a Screener.in-style expression instead of a fixed filter key set: `Return on capital employed > 22% AND Market Capitalization > 500`. Metric names come from `GET /v1/ratios`; `dialect` selects whether they are Screener.in phrases and surface units (`screener`, the default) or canonical DalalOS metric ids and storage units (`dalalos`). Results are paginated against ONE published metrics generation: pass the `snapshot_id` a page returned back on the next page, and a refresh in between answers 409 `snapshot_expired` rather than silently mixing two generations. Missing values follow SQL three-valued logic -- a bare comparison against an unknown value does not match, `COALESCE(...)` and `OR` behave as they do in SQL. A query that cannot be parsed or resolved returns 400 `bad_request` naming the metric or position at fault.",
        "operationId": "screen_query",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "columns": {
                    "description": "Extra values to return per row: a metric name, a custom ratio's name, or a bracketed `[expression]`. At most 20. Each is described in `data.columns` with a stable id, and each row carries its value under `columns` keyed by that id.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "definitions": {
                    "description": "Inline custom ratios usable anywhere a metric name is, in the query, in `columns`, and in each other. Each is `{name, expression, dialect}`. At most 20; a name may not shadow a canonical metric id or a Screener ratio name, and the references between them may not form a cycle.",
                    "items": {
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "dialect": {
                    "default": "screener",
                    "description": "`screener` (Screener.in names and surface units) or `dalalos` (canonical metric ids and storage units).",
                    "type": "string"
                  },
                  "limit": {
                    "default": 25,
                    "description": "Rows per page (1..100).",
                    "type": "integer"
                  },
                  "offset": {
                    "default": 0,
                    "description": "Rows to skip (0..5000).",
                    "type": "integer"
                  },
                  "only_latest_results": {
                    "default": false,
                    "description": "Keep only companies that have filed the current results season -- the most recent quarter-end at least 50 companies have reported. `data.latest_results` names that quarter. See GET /screen/latest-results.",
                    "type": "boolean"
                  },
                  "order": {
                    "default": "desc",
                    "description": "asc or desc.",
                    "type": "string"
                  },
                  "query": {
                    "description": "The screen expression, e.g. `Return on capital employed > 22%`.",
                    "type": "string"
                  },
                  "scope": {
                    "description": "Exact-match classification filters AND-ed with the query, because the grammar has no string literal: an object with any of `sector`, `industry`, `igroup`, `isubgroup`, `company_type` (equality on the securities master) and `index` (membership of the named index). Echoed back as `data.scope`.",
                    "type": "object"
                  },
                  "snapshot_id": {
                    "description": "Metrics generation to pin this page to, from a previous page's `pagination.snapshot_id`. Omit on the first page.",
                    "nullable": true,
                    "type": "integer"
                  },
                  "sort_by": {
                    "default": "market_cap",
                    "description": "Sortable metric id to order by.",
                    "type": "string"
                  }
                },
                "required": [
                  "query"
                ],
                "type": "object"
              }
            }
          },
          "description": "The query and its paging/sort controls.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The pinned metrics generation was replaced by a refresh (reason_code=snapshot_expired); restart from page 1."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "No metrics generation is published yet (reason_code=snapshot_unavailable)."
          }
        },
        "summary": "Screen with a free-form query",
        "tags": [
          "Screening"
        ]
      }
    },
    "/search": {
      "get": {
        "description": "Find Indian stocks by company name, NSE symbol, BSE code, or ISIN.",
        "operationId": "search",
        "parameters": [
          {
            "description": "Free-text query (name / symbol / ISIN / BSE code).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max matches to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Search securities",
        "tags": [
          "Search"
        ]
      }
    },
    "/sectors": {
      "get": {
        "description": "Aggregate count / market cap / median PE-PB per group.",
        "operationId": "sectors",
        "parameters": [
          {
            "description": "sector | igroup | isubgroup.",
            "in": "query",
            "name": "grain",
            "required": false,
            "schema": {
              "default": "sector",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Sector overview (all groups)",
        "tags": [
          "Sectors & Indices"
        ]
      }
    },
    "/sectors/{sector}": {
      "get": {
        "description": "Drill into one sector/industry group.",
        "operationId": "sectors_sector",
        "parameters": [
          {
            "description": "Path parameter: sector.",
            "in": "path",
            "name": "sector",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "sector | igroup | isubgroup.",
            "in": "query",
            "name": "grain",
            "required": false,
            "schema": {
              "default": "sector",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Sector overview (one group)",
        "tags": [
          "Sectors & Indices"
        ]
      }
    },
    "/stocks/{q}/brsr": {
      "get": {
        "description": "SEBI BRSR (Business Responsibility & Sustainability Report) disclosures \u2014 curated emissions/energy/water/waste/workforce KPIs grouped by theme, raw as filed. No ESG score or verdict.",
        "operationId": "stocks_q_brsr",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Fiscal years, newest first (1..10).",
            "in": "query",
            "name": "years",
            "required": false,
            "schema": {
              "default": 3,
              "type": "integer"
            }
          },
          {
            "description": "Also return the full concept-level map.",
            "in": "query",
            "name": "include_raw",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "BRSR ESG disclosures",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/bulk-block-deals": {
      "get": {
        "description": "NSE bulk/block trade disclosures.",
        "operationId": "stocks_q_bulk_block_deals",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "bulk | block (omit for both).",
            "in": "query",
            "name": "deal_type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Window (1..1825).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 90,
              "type": "integer"
            }
          },
          {
            "description": "Max rows (1..500).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Bulk/block deals",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/corporate-actions": {
      "get": {
        "description": "Disclosed corporate-action timeline (splits, bonuses, dividends, ...).",
        "operationId": "stocks_q_corporate_actions",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Window (1..20).",
            "in": "query",
            "name": "years",
            "required": false,
            "schema": {
              "default": 5,
              "type": "integer"
            }
          },
          {
            "description": "Comma-separated action-type filter.",
            "in": "query",
            "name": "types",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Corporate actions",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/delivery-trends": {
      "get": {
        "description": "Delivery-volume / delivery-% trend.",
        "operationId": "stocks_q_delivery_trends",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Lookback window (1..1825).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 90,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Delivery trends",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/derivatives-positioning": {
      "get": {
        "description": "Latest NSE F&O futures OI/OI-change, call/put OI, PCR, volume, and ban-list status for one underlying (stock or index).",
        "operationId": "stocks_q_derivatives_positioning",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "F&O derivatives positioning",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/disclosure-search": {
      "get": {
        "description": "Cache-only search across page-preserving official filing text. Results retain source page and attachment URL; coverage reports indexed history.",
        "operationId": "stocks_q_disclosure_search",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Words or phrase to search in cached filing text.",
            "in": "query",
            "name": "search_text",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional inclusive ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "from_date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional inclusive ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "to_date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional comma-separated cached document-type filter.",
            "in": "query",
            "name": "document_types",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum results (1..20).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Historical filing search",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/dividends": {
      "get": {
        "description": "Cash-dividend history with ex-dates and yield history.",
        "operationId": "stocks_q_dividends",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Window (1..15).",
            "in": "query",
            "name": "years",
            "required": false,
            "schema": {
              "default": 5,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Dividend history",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/events": {
      "get": {
        "description": "Recent BSE corporate announcements (SEBI Reg-30 disclosures).",
        "operationId": "stocks_q_events",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Trailing window (1..365).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "type": "integer"
            }
          },
          {
            "description": "Optional BSE category filter.",
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Corporate announcements",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/exposures": {
      "get": {
        "description": "Cache-only, read-only list of one company's reviewed, source-grounded macro-factor exposures, each joined to the factor catalog (label/description/dimension). Raw evidence and factor metadata only \u2014 no macro-window eligibility check (see macro-exposures for that), and never a causal, earnings, price or investment claim.",
        "operationId": "stocks_q_exposures",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Company reviewed macro-factor exposures",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/fii-activity": {
      "get": {
        "deprecated": true,
        "description": "DEPRECATED (issue #285): renamed to `/stocks/{q}/fii-flow`. Kept as a working alias for this release (see the `Deprecation`/`Link` response headers, RFC 8594) -- same data, same params, no removal date committed yet.",
        "operationId": "stocks_q_fii_activity",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Lookback window (1..1825).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 90,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Per-stock FII activity (deprecated alias)",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/fii-flow": {
      "get": {
        "description": "Per-stock daily FII/FPI transaction flow (CDSL-only coverage). Renamed from `/stocks/{q}/fii-activity` (issue #285) so the path carries \"flow\" like its `/market-fii-dii-flow`/`/fii-dii/sectors` siblings; the old path is kept as a deprecated alias for this release.",
        "operationId": "stocks_q_fii_flow",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Lookback window (1..1825).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 90,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Per-stock FII flow",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/filings/{news_id}/context": {
      "get": {
        "description": "Cached canonical event fields, deterministic historical links and mechanical changes. No causal, price-correlation, or investment claim.",
        "operationId": "stocks_q_filings_news_id_context",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Path parameter: news_id.",
            "in": "path",
            "name": "news_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Filing event context",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/filings/{news_id}/extract": {
      "get": {
        "description": "Cached grounded facts + factual summary for one BSE filing.",
        "operationId": "stocks_q_filings_news_id_extract",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Path parameter: news_id.",
            "in": "path",
            "name": "news_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Filing extract",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/financial-trends": {
      "get": {
        "description": "Multi-period growth and margin trends.",
        "operationId": "stocks_q_financial_trends",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "quarterly | annual.",
            "in": "query",
            "name": "period_type",
            "required": false,
            "schema": {
              "default": "quarterly",
              "type": "string"
            }
          },
          {
            "description": "Max periods (1..12).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 8,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Financial trends",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/financials": {
      "get": {
        "description": "Consolidated P&L + balance sheet, TTM, and computed margins.",
        "operationId": "stocks_q_financials",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "quarterly | annual.",
            "in": "query",
            "name": "period_type",
            "required": false,
            "schema": {
              "default": "quarterly",
              "type": "string"
            }
          },
          {
            "description": "Max periods.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 8,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Financial statements",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/macro-exposures": {
      "get": {
        "description": "Cached company-sourced macro pathways and only the official PPAC/FBIL context signals that meet the evidence, confidence and data-completeness policy. A signal is conditional context, not a causal, earnings, price or investment claim.",
        "operationId": "stocks_q_macro_exposures",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional comma-separated macro factor keys.",
            "in": "query",
            "name": "factors",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional ISO date for evidence validity and macro window.",
            "in": "query",
            "name": "as_of_date",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Company macro exposure evidence",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/operating-metrics": {
      "get": {
        "description": "Cached, source-grounded operating metrics and explicit coverage gaps. Does not infer an updated order book or forecast operations.",
        "operationId": "stocks_q_operating_metrics",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional comma-separated operating metric keys.",
            "in": "query",
            "name": "metrics",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional inclusive ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "from_date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional inclusive ISO date (YYYY-MM-DD).",
            "in": "query",
            "name": "to_date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return latest applicable observation per metric.",
            "in": "query",
            "name": "latest_only",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Maximum observations (1..100).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Operating KPI history",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/peers": {
      "get": {
        "description": "Side-by-side valuation table vs sector/industry peers.",
        "operationId": "stocks_q_peers",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max peers.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 8,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Peer comparison",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/pledge-trend": {
      "get": {
        "description": "Promoter share-pledge percentage time series.",
        "operationId": "stocks_q_pledge_trend",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max periods (1..16).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 12,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Promoter pledge trend",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/price-history": {
      "get": {
        "description": "OHLC + volume series.",
        "operationId": "stocks_q_price_history",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Lookback window (1..1825).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 90,
              "type": "integer"
            }
          },
          {
            "description": "Split/bonus-adjusted closes.",
            "in": "query",
            "name": "adjusted",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "daily | weekly | monthly.",
            "in": "query",
            "name": "interval",
            "required": false,
            "schema": {
              "default": "daily",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Price history",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/profile": {
      "get": {
        "description": "Identity, sector/industry, market snapshot, and TTM summary.",
        "operationId": "stocks_q_profile",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Company profile",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/quote": {
      "get": {
        "description": "Latest EOD quote (price, OHLC, volume, computed ratios).",
        "operationId": "stocks_q_quote",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Latest quote",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/relevant-peers": {
      "get": {
        "description": "Cache-only, provenance-backed peer selection for a declared comparison purpose. May return fewer peers when business-model evidence is insufficient.",
        "operationId": "stocks_q_relevant_peers",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "operating | financial | valuation.",
            "in": "query",
            "name": "purpose",
            "required": false,
            "schema": {
              "default": "operating",
              "type": "string"
            }
          },
          {
            "description": "Optional declared event context label; selection purpose remains explicit.",
            "in": "query",
            "name": "event_context",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum peers (1..15).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 8,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Purpose-specific relevant peers",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/report": {
      "get": {
        "description": "Source-linked canonical company report (facts + citations, computed calculations, evidence-referenced claims, materiality-bucketed events) over cached filings + reviewed exposure/peer mappings. Raw data only, no verdicts.",
        "operationId": "stocks_q_report",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Reporting window (1..365).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 90,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Company report",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/returns": {
      "get": {
        "description": "Period returns, CAGR, volatility, max drawdown, 52w high/low.",
        "operationId": "stocks_q_returns",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Return statistics",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/shareholding": {
      "get": {
        "description": "Promoter / FII / DII / public ownership time series.",
        "operationId": "stocks_q_shareholding",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max quarterly periods (max 12).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 8,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Shareholding pattern",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/technical-indicators": {
      "get": {
        "description": "Moving averages, RSI, MACD, Bollinger Bands, beta vs Nifty 50, and circuit-filter band %/hit-days (null circuit_band_pct with a non-null circuit_band_as_of means NSE's 'No Band', not missing data).",
        "operationId": "stocks_q_technical_indicators",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Technical indicators",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/stocks/{q}/valuation-history": {
      "get": {
        "description": "Point-in-time P/E and price-to-sales series using as-filed TTM inputs.",
        "operationId": "stocks_q_valuation_history",
        "parameters": [
          {
            "description": "NSE symbol, ISIN, or BSE code.",
            "in": "path",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Lookback window (1..1825).",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 365,
              "type": "integer"
            }
          },
          {
            "description": "daily | weekly | monthly.",
            "in": "query",
            "name": "interval",
            "required": false,
            "schema": {
              "default": "daily",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Valuation history",
        "tags": [
          "Stocks"
        ]
      }
    },
    "/top-movers": {
      "get": {
        "description": "Raw ranked gainers/losers/most-active constituents of an index for one completed EOD session, sorted by a caller-chosen mechanical field (day % change, absolute price change, traded value, or traded volume). Distinct from the index heatmap (/indices/{index}/heatmap), which is deliberately NOT sortable by return and always sorts by market cap instead (issue #85).",
        "operationId": "top_movers",
        "parameters": [
          {
            "description": "Index name (get valid names from /indices).",
            "in": "query",
            "name": "index",
            "required": false,
            "schema": {
              "default": "NIFTY 500",
              "type": "string"
            }
          },
          {
            "description": "Ranking field: pct_change, change, turnover, or volume.",
            "in": "query",
            "name": "metric",
            "required": false,
            "schema": {
              "default": "pct_change",
              "type": "string"
            }
          },
          {
            "description": "'desc' (top gainers/most-active) or 'asc' (top losers).",
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "default": "desc",
              "type": "string"
            }
          },
          {
            "description": "Max rows to return (1..100).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            },
            "description": "Success (or success-with-empty when nothing is cached)."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Malformed request (reason_code=bad_request)."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Missing/invalid API key (reason_code=unauthorized)."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Monthly quota exhausted (reason_code=quota_exceeded)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Account or plan is not permitted to use this route."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Identifier resolves to nothing (reason_code=not_found)."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request conflicts with an account limit."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Rate or concurrency limit exceeded."
          }
        },
        "summary": "Top movers (gainers/losers/most-active)",
        "tags": [
          "Sectors & Indices"
        ]
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "description": "Production (BETA)",
      "url": "https://mcp.dalalos.in/v1"
    }
  ],
  "tags": [
    {
      "description": "Per-security data: quotes, financials, ownership, prices, returns, technicals, corporate actions and filings. Most take a `query` path segment that is an NSE symbol, ISIN, or BSE code.",
      "name": "Stocks"
    },
    {
      "description": "Resolve a company name / ticker / ISIN to a security.",
      "name": "Search"
    },
    {
      "description": "Mechanical filtering of the universe and fixed preset screens. Raw data only \u2014 never ranked as a recommendation.",
      "name": "Screening"
    },
    {
      "description": "Sector/industry aggregates, index membership, heatmaps, and NSE's own published index-level valuation bands.",
      "name": "Sectors & Indices"
    },
    {
      "description": "Market-wide and sector FII/DII flows and advance/decline breadth. Raw exchange-published figures; net = buy - sell only.",
      "name": "Market Flows & Breadth"
    },
    {
      "description": "Official government macro series (MOSPI CPI/WPI/IIP/GDP, PPAC crude) and FBIL INR reference rates.",
      "name": "Macro & FX"
    },
    {
      "description": "Unified event calendar, upcoming results, and market-wide BSE announcement discovery buckets.",
      "name": "Calendar & Events"
    },
    {
      "description": "IPO / public-issue records (upcoming, open, recently listed).",
      "name": "IPOs"
    },
    {
      "description": "Operational metadata about the served data (cache freshness).",
      "name": "Meta"
    }
  ]
}
