{
  "openapi": "3.1.0",
  "info": {
    "title": "bhavcopy.live agent data",
    "version": "1.0.0",
    "summary": "Read-only end-of-day NSE market data and AMFI mutual fund NAVs as static JSON and Markdown.",
    "description": "Static files regenerated on every data update (once per trading day, around 23:30 IST). No authentication; CORS is open. Data is derived from public NSE bhavcopy files, is for information only and is not investment advice. Agent guide: https://bhavcopy.live/llms.txt"
  },
  "servers": [{ "url": "https://bhavcopy.live" }],
  "paths": {
    "/agents/index.json": {
      "get": {
        "operationId": "getCatalog",
        "summary": "Catalog: data date, symbol count and endpoint templates.",
        "responses": {
          "200": { "description": "Catalog", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Catalog" } } } }
        }
      }
    },
    "/agents/symbols.json": {
      "get": {
        "operationId": "listSymbols",
        "summary": "Search index of every NSE symbol. Match on symbol or name, then follow the json or markdown URL.",
        "responses": {
          "200": { "description": "Symbol list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SymbolIndex" } } } }
        }
      }
    },
    "/agents/market.json": {
      "get": {
        "operationId": "getMarketOverview",
        "summary": "Index levels, top gainers and losers, breadth and FII/DII activity for the latest trading day.",
        "responses": {
          "200": { "description": "Market overview", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketOverview" } } } }
        }
      }
    },
    "/agents/market.md": {
      "get": {
        "operationId": "getMarketOverviewMarkdown",
        "summary": "The market overview as readable Markdown.",
        "responses": {
          "200": { "description": "Markdown", "content": { "text/markdown": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/agents/stocks/{slug}.json": {
      "get": {
        "operationId": "getStock",
        "summary": "Latest session, returns, 52-week range, corporate actions and one year of daily history for one symbol.",
        "parameters": [{ "$ref": "#/components/parameters/Slug" }],
        "responses": {
          "200": { "description": "Stock data, or a not-found body with success=false", "content": { "application/json": { "schema": { "oneOf": [{ "$ref": "#/components/schemas/Stock" }, { "$ref": "#/components/schemas/NotFound" }] } } } }
        }
      }
    },
    "/agents/stocks/{slug}.md": {
      "get": {
        "operationId": "getStockMarkdown",
        "summary": "Readable Markdown summary of one symbol.",
        "parameters": [{ "$ref": "#/components/parameters/Slug" }],
        "responses": {
          "200": { "description": "Markdown", "content": { "text/markdown": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/agents/indices.json": {
      "get": {
        "operationId": "listIndices",
        "summary": "Every index with its latest close and day change. Match on name, then follow the json or markdown URL.",
        "responses": {
          "200": { "description": "Index list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IndexList" } } } }
        }
      }
    },
    "/agents/indices/{indexSlug}.json": {
      "get": {
        "operationId": "getIndex",
        "summary": "Latest session, previous close, valuation, returns, 52-week range and one year of daily history for one index; for major NSE indices also constituents, breadth and the stocks that moved it most.",
        "parameters": [{ "$ref": "#/components/parameters/IndexSlug" }],
        "responses": {
          "200": { "description": "Index data, or a not-found body with success=false", "content": { "application/json": { "schema": { "oneOf": [{ "$ref": "#/components/schemas/Index" }, { "$ref": "#/components/schemas/NotFound" }] } } } }
        }
      }
    },
    "/agents/indices/{indexSlug}.md": {
      "get": {
        "operationId": "getIndexMarkdown",
        "summary": "Readable Markdown summary of one index.",
        "parameters": [{ "$ref": "#/components/parameters/IndexSlug" }],
        "responses": {
          "200": { "description": "Markdown", "content": { "text/markdown": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/agents/sectors.json": {
      "get": {
        "operationId": "listSectors",
        "summary": "Every NSE equity sector, largest first, with stock count, market cap and cap-weighted day and 1Y move.",
        "responses": {
          "200": { "description": "Sector list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SectorList" } } } }
        }
      }
    },
    "/agents/sectors/{sectorSlug}.json": {
      "get": {
        "operationId": "getSector",
        "summary": "Breadth, day move, lifts and drags, cap-weighted and median returns and every stock for one sector.",
        "parameters": [{ "$ref": "#/components/parameters/SectorSlug" }],
        "responses": {
          "200": { "description": "Sector data, or a not-found body with success=false", "content": { "application/json": { "schema": { "oneOf": [{ "$ref": "#/components/schemas/Sector" }, { "$ref": "#/components/schemas/NotFound" }] } } } }
        }
      }
    },
    "/agents/sectors/{sectorSlug}.md": {
      "get": {
        "operationId": "getSectorMarkdown",
        "summary": "Readable Markdown summary of one sector.",
        "parameters": [{ "$ref": "#/components/parameters/SectorSlug" }],
        "responses": {
          "200": { "description": "Markdown", "content": { "text/markdown": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/agents/funds.json": {
      "get": {
        "operationId": "listFunds",
        "summary": "Every current AMFI mutual fund scheme. Match on name, pick plan and option, then follow the markdown URL.",
        "responses": {
          "200": { "description": "Fund list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FundList" } } } }
        }
      }
    },
    "/agents/funds/{schemeCode}.json": {
      "get": {
        "operationId": "getFund",
        "summary": "Latest NAV, returns and CAGR, 52-week NAV range, category rank, other plans and one year of daily NAVs for one scheme.",
        "parameters": [{ "$ref": "#/components/parameters/SchemeCode" }],
        "responses": {
          "200": { "description": "Fund data, or a not-found body with success=false", "content": { "application/json": { "schema": { "oneOf": [{ "$ref": "#/components/schemas/Fund" }, { "$ref": "#/components/schemas/NotFound" }] } } } }
        }
      }
    },
    "/agents/funds/{schemeCode}.md": {
      "get": {
        "operationId": "getFundMarkdown",
        "summary": "Readable Markdown summary of one mutual fund scheme.",
        "parameters": [{ "$ref": "#/components/parameters/SchemeCode" }],
        "responses": {
          "200": { "description": "Markdown", "content": { "text/markdown": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/agents/fund-categories.json": {
      "get": {
        "operationId": "listFundCategories",
        "summary": "Every AMFI fund category with scheme counts and median Direct Growth returns.",
        "responses": {
          "200": { "description": "Category list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FundCategoryList" } } } }
        }
      }
    },
    "/agents/fund-categories/{categorySlug}.json": {
      "get": {
        "operationId": "getFundCategory",
        "summary": "Medians, top and bottom funds by 1Y return and 3Y CAGR, and every tracked Direct Growth fund in one category.",
        "parameters": [{ "$ref": "#/components/parameters/CategorySlug" }],
        "responses": {
          "200": { "description": "Category data, or a not-found body with success=false", "content": { "application/json": { "schema": { "oneOf": [{ "$ref": "#/components/schemas/FundCategory" }, { "$ref": "#/components/schemas/NotFound" }] } } } }
        }
      }
    },
    "/agents/fund-categories/{categorySlug}.md": {
      "get": {
        "operationId": "getFundCategoryMarkdown",
        "summary": "Readable Markdown summary of one fund category.",
        "parameters": [{ "$ref": "#/components/parameters/CategorySlug" }],
        "responses": {
          "200": { "description": "Markdown", "content": { "text/markdown": { "schema": { "type": "string" } } } }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "Slug": {
        "name": "slug",
        "in": "path",
        "required": true,
        "description": "Uppercase NSE symbol with every character outside A-Z, 0-9 and '-' replaced by '_' (M&M -> M_M). Also listed as `slug` in /agents/symbols.json.",
        "schema": { "type": "string", "pattern": "^[A-Z0-9_-]+$" },
        "example": "RELIANCE"
      },
      "IndexSlug": {
        "name": "indexSlug",
        "in": "path",
        "required": true,
        "description": "Lowercase index name with every run of characters outside a-z and 0-9 replaced by '-' (Nifty 50 -> nifty-50, NIFTY Midcap 100 -> nifty-midcap-100). Also listed as `slug` in /agents/indices.json.",
        "schema": { "type": "string", "pattern": "^[a-z0-9-]+$" },
        "example": "nifty-50"
      },
      "SectorSlug": {
        "name": "sectorSlug",
        "in": "path",
        "required": true,
        "description": "Lowercase sector name with every run of characters outside a-z and 0-9 replaced by '-' (IT Services & Consulting -> it-services-consulting). Listed as `slug` in /agents/sectors.json.",
        "schema": { "type": "string", "pattern": "^[a-z0-9-]+$" },
        "example": "private-banks"
      },
      "SchemeCode": {
        "name": "schemeCode",
        "in": "path",
        "required": true,
        "description": "AMFI scheme code. Listed as `schemeCode` in /agents/funds.json.",
        "schema": { "type": "string", "pattern": "^[0-9]+$" },
        "example": "122639"
      },
      "CategorySlug": {
        "name": "categorySlug",
        "in": "path",
        "required": true,
        "description": "Lowercase AMFI category name with every run of characters outside a-z and 0-9 replaced by '-' (Flexi Cap Fund -> flexi-cap-fund). Listed as `slug` in /agents/fund-categories.json.",
        "schema": { "type": "string", "pattern": "^[a-z0-9-]+$" },
        "example": "flexi-cap-fund"
      }
    },
    "schemas": {
      "Catalog": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "generatedAt": { "type": "string", "format": "date-time" },
          "symbolCount": { "type": "integer" },
          "indexCount": { "type": "integer" },
          "sectorCount": { "type": "integer" },
          "fundCount": { "type": "integer" },
          "fundsAsOf": { "type": ["string", "null"], "format": "date" },
          "historyIncluded": { "type": "boolean" },
          "endpoints": { "type": "object", "additionalProperties": { "type": "string" } },
          "slugRule": { "type": "string" },
          "indexSlugRule": { "type": "string" }
        }
      },
      "SymbolIndex": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "count": { "type": "integer" },
          "symbols": { "type": "array", "items": { "$ref": "#/components/schemas/SymbolEntry" } }
        }
      },
      "SymbolEntry": {
        "type": "object",
        "properties": {
          "symbol": { "type": "string", "example": "M&M" },
          "slug": { "type": "string", "example": "M_M" },
          "name": { "type": "string" },
          "instrumentType": { "$ref": "#/components/schemas/InstrumentType" },
          "series": { "type": ["string", "null"] },
          "sector": { "type": ["string", "null"] },
          "capCategory": { "type": ["string", "null"], "enum": ["Large Cap", "Mid Cap", "Small Cap", null] },
          "stale": { "type": "boolean", "description": "No trade for 90+ sessions (renamed, merged or delisted)." },
          "lastClose": { "type": ["number", "null"] },
          "changePercent": { "type": ["number", "null"] },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "json": { "type": "string", "format": "uri" },
          "markdown": { "type": "string", "format": "uri" }
        }
      },
      "InstrumentType": {
        "type": "string",
        "enum": ["equity", "sme-equity", "government-security", "state-development-loan", "treasury-bill", "sovereign-gold-bond", "debt", "other"]
      },
      "Session": {
        "type": "object",
        "description": "One trading day. Prices in INR, adjusted for splits and bonuses. Fields the exchange file did not provide are null.",
        "properties": {
          "date": { "type": "string", "format": "date" },
          "open": { "type": ["number", "null"] },
          "high": { "type": ["number", "null"] },
          "low": { "type": ["number", "null"] },
          "close": { "type": ["number", "null"] },
          "prevClose": { "type": ["number", "null"] },
          "change": { "type": ["number", "null"] },
          "changePercent": { "type": ["number", "null"] },
          "volume": { "type": ["integer", "null"] },
          "deliveryPercent": { "type": ["number", "null"] },
          "vwap": { "type": ["number", "null"] },
          "trades": { "type": ["integer", "null"] }
        }
      },
      "Stock": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "symbol": { "type": "string" },
          "slug": { "type": "string" },
          "name": { "type": "string" },
          "exchange": { "type": "string", "const": "NSE" },
          "series": { "type": ["string", "null"] },
          "instrumentType": { "$ref": "#/components/schemas/InstrumentType" },
          "sector": { "type": ["string", "null"] },
          "capCategory": { "type": ["string", "null"] },
          "marketCapCrore": { "type": ["number", "null"], "description": "Market capitalisation in INR crore." },
          "stale": { "type": "boolean" },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "latest": { "$ref": "#/components/schemas/Session" },
          "fiftyTwoWeek": {
            "type": "object",
            "properties": {
              "high": { "type": ["number", "null"] },
              "low": { "type": ["number", "null"] },
              "percentFromHigh": { "type": ["number", "null"] },
              "percentFromLow": { "type": ["number", "null"] }
            }
          },
          "returnsPercent": {
            "type": "object",
            "description": "Close-to-close returns; null when history does not reach back far enough.",
            "properties": {
              "1W": { "type": ["number", "null"] },
              "1M": { "type": ["number", "null"] },
              "3M": { "type": ["number", "null"] },
              "6M": { "type": ["number", "null"] },
              "1Y": { "type": ["number", "null"] },
              "3Y": { "type": ["number", "null"] },
              "5Y": { "type": ["number", "null"] },
              "YTD": { "type": ["number", "null"] }
            }
          },
          "history": {
            "type": "object",
            "properties": {
              "description": { "type": "string" },
              "fields": { "type": "array", "items": { "type": "string" }, "example": ["date", "open", "high", "low", "close", "volume", "deliveryPercent"] },
              "rows": { "type": "array", "description": "Newest first; values follow `fields`.", "items": { "type": "array" } }
            }
          },
          "corporateActions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "exDate": { "type": "string", "format": "date" },
                "type": { "type": ["string", "null"] },
                "ratio": { "type": ["string", "null"] },
                "description": { "type": ["string", "null"] }
              }
            }
          },
          "indexMembership": {
            "type": "array",
            "description": "Major NSE indices that list this stock as a constituent.",
            "items": { "$ref": "#/components/schemas/IndexLink" }
          },
          "links": { "type": "object", "additionalProperties": { "type": "string", "format": "uri" } },
          "source": { "type": "string" },
          "disclaimer": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "Mover": {
        "type": "object",
        "properties": {
          "symbol": { "type": "string" },
          "name": { "type": "string" },
          "capCategory": { "type": "string" },
          "changePercent": { "type": "number" },
          "url": { "type": "string", "format": "uri" }
        }
      },
      "MarketOverview": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "topGainers": { "type": "array", "items": { "$ref": "#/components/schemas/Mover" } },
          "topLosers": { "type": "array", "items": { "$ref": "#/components/schemas/Mover" } },
          "moversUniverse": { "type": "string" },
          "breadth": {
            "type": "object",
            "properties": {
              "advances": { "type": "integer" },
              "declines": { "type": "integer" },
              "unchanged": { "type": "integer" }
            }
          },
          "indices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "slug": { "type": "string" },
                "category": { "type": "string" },
                "date": { "type": ["string", "null"], "format": "date" },
                "close": { "type": ["number", "null"] },
                "changePercent": { "type": ["number", "null"] },
                "fiftyTwoWeekHigh": { "type": ["number", "null"] },
                "fiftyTwoWeekLow": { "type": ["number", "null"] },
                "url": { "type": "string", "format": "uri", "description": "Markdown page for this index." }
              }
            }
          },
          "sectors": {
            "type": "object",
            "description": "Leading and lagging sectors of the day by cap-weighted move (sectors with at least minStocks stocks trading).",
            "properties": {
              "minStocks": { "type": "integer" },
              "leaders": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "slug": { "type": "string" }, "capWeightedChangePercent": { "type": "number" }, "advances": { "type": "integer" }, "declines": { "type": "integer" }, "url": { "type": "string", "format": "uri" } } } },
              "laggards": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "slug": { "type": "string" }, "capWeightedChangePercent": { "type": "number" }, "advances": { "type": "integer" }, "declines": { "type": "integer" }, "url": { "type": "string", "format": "uri" } } } }
            }
          },
          "institutionalActivity": {
            "type": "object",
            "properties": {
              "date": { "type": ["string", "null"], "format": "date" },
              "unit": { "type": "string", "const": "INR crore" },
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "category": { "type": "string" },
                    "buy": { "type": ["number", "null"] },
                    "sell": { "type": ["number", "null"] },
                    "net": { "type": ["number", "null"] }
                  }
                }
              }
            }
          },
          "source": { "type": "string" },
          "disclaimer": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "IndexLink": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "json": { "type": "string", "format": "uri" },
          "markdown": { "type": "string", "format": "uri" }
        }
      },
      "IndexList": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "count": { "type": "integer" },
          "description": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" },
          "indices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "slug": { "type": "string" },
                "category": { "type": "string" },
                "asOf": { "type": ["string", "null"], "format": "date" },
                "close": { "type": ["number", "null"] },
                "changePercent": { "type": ["number", "null"] },
                "constituentCount": { "type": ["integer", "null"], "description": "Set when the index page lists constituents, breadth and movers." },
                "json": { "type": "string", "format": "uri" },
                "markdown": { "type": "string", "format": "uri" }
              }
            }
          }
        }
      },
      "IndexConstituent": {
        "type": "object",
        "properties": {
          "symbol": { "type": "string" },
          "name": { "type": "string" },
          "industry": { "type": ["string", "null"] },
          "close": { "type": ["number", "null"] },
          "changePercent": { "type": ["number", "null"] },
          "marketCapCrore": { "type": ["number", "null"] },
          "approxWeightPercent": { "type": ["number", "null"], "description": "Share of the constituents' combined full market cap (not NSE's free-float weight)." },
          "estimatedContribution": { "type": ["number", "null"], "description": "approxWeightPercent x changePercent / 100, in percentage points of index move." },
          "url": { "type": ["string", "null"], "format": "uri" }
        }
      },
      "Index": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "name": { "type": "string" },
          "slug": { "type": "string" },
          "category": { "type": "string" },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "latest": {
            "type": ["object", "null"],
            "properties": {
              "date": { "type": "string", "format": "date" },
              "open": { "type": ["number", "null"] },
              "high": { "type": ["number", "null"] },
              "low": { "type": ["number", "null"] },
              "close": { "type": "number" },
              "prevClose": { "type": ["number", "null"] },
              "change": { "type": ["number", "null"] },
              "changePercent": { "type": ["number", "null"] }
            }
          },
          "valuation": {
            "type": "object",
            "properties": {
              "pe": { "type": ["number", "null"] },
              "pb": { "type": ["number", "null"] },
              "dividendYield": { "type": ["number", "null"], "description": "Percent." }
            }
          },
          "fiftyTwoWeek": { "type": "object", "properties": { "high": { "type": ["number", "null"] }, "low": { "type": ["number", "null"] }, "percentFromHigh": { "type": ["number", "null"] }, "percentFromLow": { "type": ["number", "null"] } } },
          "returnsPercent": { "type": "object", "description": "Close-to-close returns for 1W, 1M, 3M, 6M, 1Y, 3Y, 5Y and YTD; null when history does not reach back far enough.", "additionalProperties": { "type": ["number", "null"] } },
          "constituents": {
            "type": ["object", "null"],
            "description": "Null for indices without an NSE constituent list (volatility, strategy, Sensex).",
            "properties": {
              "asOf": { "type": ["string", "null"], "format": "date", "description": "Equity date the constituent moves come from; can trail the index date by a day." },
              "source": { "type": "string", "format": "uri" },
              "count": { "type": "integer" },
              "breadth": { "type": "object", "properties": { "advances": { "type": "integer" }, "declines": { "type": "integer" }, "unchanged": { "type": "integer" }, "noData": { "type": "integer" } } },
              "capWeightedChangePercent": { "type": ["number", "null"] },
              "weightMethod": { "type": "string" },
              "topGainers": { "type": "array", "items": { "$ref": "#/components/schemas/IndexConstituent" } },
              "topLosers": { "type": "array", "items": { "$ref": "#/components/schemas/IndexConstituent" } },
              "biggestLifts": { "type": "array", "items": { "$ref": "#/components/schemas/IndexConstituent" } },
              "biggestDrags": { "type": "array", "items": { "$ref": "#/components/schemas/IndexConstituent" } },
              "members": { "type": "array", "description": "Every constituent, heaviest first.", "items": { "$ref": "#/components/schemas/IndexConstituent" } }
            }
          },
          "history": {
            "type": "object",
            "properties": {
              "description": { "type": "string" },
              "fields": { "type": "array", "items": { "type": "string" }, "example": ["date", "open", "high", "low", "close", "changePercent"] },
              "rows": { "type": "array", "description": "Newest first; values follow `fields`.", "items": { "type": "array" } }
            }
          },
          "links": { "type": "object", "additionalProperties": { "type": "string", "format": "uri" } },
          "source": { "type": "string" },
          "disclaimer": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "SectorList": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "count": { "type": "integer" },
          "description": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" },
          "sectors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "slug": { "type": "string" },
                "stockCount": { "type": "integer" },
                "marketCapCrore": { "type": ["number", "null"] },
                "capWeightedChangePercent": { "type": ["number", "null"] },
                "advances": { "type": "integer" },
                "declines": { "type": "integer" },
                "return1Y": { "type": ["number", "null"], "description": "Cap-weighted 1Y return of the sector's stocks." },
                "json": { "type": "string", "format": "uri" },
                "markdown": { "type": "string", "format": "uri" }
              }
            }
          }
        }
      },
      "SectorStock": {
        "type": "object",
        "properties": {
          "symbol": { "type": "string" },
          "name": { "type": "string" },
          "capCategory": { "type": ["string", "null"] },
          "close": { "type": ["number", "null"] },
          "changePercent": { "type": ["number", "null"] },
          "return1M": { "type": ["number", "null"] },
          "return1Y": { "type": ["number", "null"] },
          "percentFromHigh": { "type": ["number", "null"] },
          "marketCapCrore": { "type": ["number", "null"] },
          "approxWeightPercent": { "type": ["number", "null"] },
          "estimatedContribution": { "type": ["number", "null"] },
          "url": { "type": ["string", "null"], "format": "uri" }
        }
      },
      "Sector": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "name": { "type": "string" },
          "slug": { "type": "string" },
          "appSector": { "type": "string", "description": "The sector's name in the app (ETFs are 'Equity' there)." },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "stockCount": { "type": "integer" },
          "marketCapCrore": { "type": ["number", "null"] },
          "capBreakdown": { "type": "object", "additionalProperties": { "type": "integer" } },
          "day": {
            "type": "object",
            "properties": {
              "breadth": { "type": "object", "properties": { "advances": { "type": "integer" }, "declines": { "type": "integer" }, "unchanged": { "type": "integer" }, "noData": { "type": "integer" } } },
              "capWeightedChangePercent": { "type": ["number", "null"] },
              "medianChangePercent": { "type": ["number", "null"] },
              "topGainers": { "type": "array", "items": { "$ref": "#/components/schemas/IndexConstituent" } },
              "topLosers": { "type": "array", "items": { "$ref": "#/components/schemas/IndexConstituent" } },
              "biggestLifts": { "type": "array", "items": { "$ref": "#/components/schemas/IndexConstituent" } },
              "biggestDrags": { "type": "array", "items": { "$ref": "#/components/schemas/IndexConstituent" } }
            }
          },
          "returnsPercent": {
            "type": "object",
            "properties": {
              "capWeighted": { "type": "object", "additionalProperties": { "type": ["number", "null"] } },
              "median": { "type": "object", "additionalProperties": { "type": ["number", "null"] } }
            }
          },
          "method": { "type": "string" },
          "members": { "type": "array", "description": "Every stock, largest market cap first.", "items": { "$ref": "#/components/schemas/SectorStock" } },
          "links": { "type": "object", "additionalProperties": { "type": "string", "format": "uri" } },
          "source": { "type": "string" },
          "disclaimer": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "FundList": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "count": { "type": "integer" },
          "description": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" },
          "funds": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "schemeCode": { "type": "string" },
                "name": { "type": "string" },
                "amc": { "type": ["string", "null"] },
                "category": { "type": ["string", "null"] },
                "plan": { "type": ["string", "null"], "description": "Direct, Regular or Other." },
                "option": { "type": ["string", "null"], "description": "Growth, IDCW or Other." },
                "nav": { "type": ["number", "null"] },
                "navDate": { "type": ["string", "null"], "format": "date" },
                "return1Y": { "type": ["number", "null"] },
                "markdown": { "type": "string", "format": "uri" }
              }
            }
          }
        }
      },
      "Rank": {
        "type": "object",
        "properties": {
          "rank": { "type": ["integer", "null"], "description": "1 = best." },
          "of": { "type": "integer" },
          "categoryMedian": { "type": ["number", "null"] }
        }
      },
      "Fund": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "schemeCode": { "type": "string" },
          "name": { "type": "string" },
          "displayName": { "type": "string", "description": "Name with plan and option, e.g. 'Parag Parikh Flexi Cap Fund (Direct plan, Growth)'." },
          "amc": { "type": ["string", "null"] },
          "category": { "type": ["string", "null"] },
          "broadCategory": { "type": ["string", "null"] },
          "structure": { "type": ["string", "null"] },
          "plan": { "type": ["string", "null"] },
          "option": { "type": ["string", "null"] },
          "isinGrowth": { "type": ["string", "null"] },
          "isinReinvestment": { "type": ["string", "null"] },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "latest": {
            "type": "object",
            "properties": {
              "date": { "type": ["string", "null"], "format": "date" },
              "nav": { "type": ["number", "null"] },
              "previousDate": { "type": ["string", "null"], "format": "date" },
              "previousNav": { "type": ["number", "null"] },
              "change": { "type": ["number", "null"] },
              "changePercent": { "type": ["number", "null"] }
            }
          },
          "historyIncluded": { "type": "boolean", "description": "False for plans without daily NAV history; returns, CAGR, 52-week range and rank are then null." },
          "returnsPercent": { "type": ["object", "null"], "description": "Absolute returns for 1W, 1M, 3M, 6M, 1Y and YTD.", "additionalProperties": { "type": ["number", "null"] } },
          "cagrPercent": { "type": ["object", "null"], "description": "Annualised returns for 3Y, 5Y and 10Y.", "additionalProperties": { "type": ["number", "null"] } },
          "fiftyTwoWeek": { "type": ["object", "null"], "properties": { "high": { "type": ["number", "null"] }, "low": { "type": ["number", "null"] }, "percentFromHigh": { "type": ["number", "null"] }, "percentFromLow": { "type": ["number", "null"] } } },
          "categoryStanding": {
            "type": ["object", "null"],
            "properties": {
              "category": { "type": "string" },
              "peerCount": { "type": "integer" },
              "return1Y": { "$ref": "#/components/schemas/Rank" },
              "cagr3Y": { "$ref": "#/components/schemas/Rank" },
              "method": { "type": "string" }
            }
          },
          "otherPlans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "schemeCode": { "type": "string" },
                "plan": { "type": ["string", "null"] },
                "option": { "type": ["string", "null"] },
                "hasReturns": { "type": "boolean" },
                "markdown": { "type": "string", "format": "uri" }
              }
            }
          },
          "history": {
            "type": "object",
            "properties": {
              "description": { "type": "string" },
              "fields": { "type": "array", "items": { "type": "string" }, "example": ["date", "nav"] },
              "rows": { "type": "array", "description": "Newest first; values follow `fields`.", "items": { "type": "array" } }
            }
          },
          "links": { "type": "object", "additionalProperties": { "type": ["string", "null"], "format": "uri" } },
          "source": { "type": "string" },
          "disclaimer": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "FundSummary": {
        "type": "object",
        "properties": {
          "schemeCode": { "type": "string" },
          "name": { "type": "string" },
          "displayName": { "type": "string" },
          "amc": { "type": ["string", "null"] },
          "nav": { "type": ["number", "null"] },
          "return1Y": { "type": ["number", "null"] },
          "cagr3Y": { "type": ["number", "null"] },
          "cagr5Y": { "type": ["number", "null"] },
          "url": { "type": "string", "format": "uri" }
        }
      },
      "FundCategoryList": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "count": { "type": "integer" },
          "description": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" },
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "slug": { "type": "string" },
                "broadCategory": { "type": ["string", "null"] },
                "schemeCount": { "type": "integer" },
                "trackedCount": { "type": "integer" },
                "median1Y": { "type": ["number", "null"] },
                "median3YCagr": { "type": ["number", "null"] },
                "json": { "type": "string", "format": "uri" },
                "markdown": { "type": "string", "format": "uri" }
              }
            }
          }
        }
      },
      "FundCategory": {
        "type": "object",
        "properties": {
          "schemaVersion": { "type": "integer" },
          "name": { "type": "string" },
          "slug": { "type": "string" },
          "broadCategory": { "type": ["string", "null"] },
          "asOf": { "type": ["string", "null"], "format": "date" },
          "schemeCount": { "type": "integer" },
          "trackedCount": { "type": "integer", "description": "Direct Growth schemes with daily NAV history." },
          "medians": { "type": "object", "properties": { "return1Y": { "type": ["number", "null"] }, "cagr3Y": { "type": ["number", "null"] }, "cagr5Y": { "type": ["number", "null"] } } },
          "topBy1Y": { "type": "array", "items": { "$ref": "#/components/schemas/FundSummary" } },
          "bottomBy1Y": { "type": "array", "items": { "$ref": "#/components/schemas/FundSummary" } },
          "topBy3YCagr": { "type": "array", "items": { "$ref": "#/components/schemas/FundSummary" } },
          "funds": { "type": "array", "description": "Every tracked fund, best 1Y first.", "items": { "$ref": "#/components/schemas/FundSummary" } },
          "method": { "type": "string" },
          "links": { "type": "object", "additionalProperties": { "type": "string", "format": "uri" } },
          "source": { "type": "string" },
          "disclaimer": { "type": "string" },
          "generatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "NotFound": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "const": false },
          "error": { "type": "string" },
          "code": { "type": "string", "const": "AGENTS_NOT_FOUND" },
          "hint": { "type": "string" }
        }
      }
    }
  }
}
