{
  "openapi": "3.0.3",
  "info": {
    "title": "ETF True Holdings Data API",
    "version": "v1",
    "description": "Stored ETF and fund holdings, and a look-through of a whole portfolio down to companies, sectors, countries and asset classes. Customer guide: docs/API.md. Limits (per minute and per month) belong to your key. A call counts when it succeeds. Retry a 503 busy answer after the Retry-After seconds."
  },
  "servers": [
    {
      "url": "https://etftrueholdings.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyAuth": []
    }
  ],
  "paths": {
    "/api/v1/status": {
      "get": {
        "summary": "Data dates, number of funds by source, and the service version",
        "operationId": "getStatus",
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/funds": {
      "get": {
        "summary": "Search the funds we hold data for",
        "operationId": "searchFunds",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "Part of the ticker or the fund name (not case sensitive)."
          },
          {
            "name": "issuer",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "The issuer name, exactly (not case sensitive), for example iShares."
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "SEC",
                "CUSTOM",
                "INDEX",
                "YF"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "Funds per page."
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "How many funds to skip."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Only funds whose list we read on or after this date (YYYY-MM-DD), so a client can refresh only what changed."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of funds sorted by ticker",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/funds/{ticker}/holdings": {
      "get": {
        "summary": "Every holding we store for one fund",
        "description": "Use the exchange suffix for Canadian funds (XEQT.TO, AGSG.NE); US funds have none (VOO). A ticker without a suffix works when exactly one stored fund matches; several matches answer 400 ambiguous with the matches.",
        "operationId": "getFundHoldings",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "weights",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "raw",
                "normalized"
              ],
              "default": "raw"
            },
            "description": "normalized scales every stored line so the list adds up to exactly 100; raw_weight_pct then keeps the stored weight."
          },
          {
            "name": "top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Only the N biggest holdings (all by default). Normalizing always uses every stored line."
          }
        ],
        "responses": {
          "200": {
            "description": "The holdings of the fund",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundHoldings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "We hold nothing for that ticker",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/lookthrough": {
      "post": {
        "summary": "Look through a portfolio",
        "description": "Send each position's market value, all in one currency. Nothing is priced or converted. A position can be a fund we store, a stock, or #CASH. Funds inside funds are followed all the way down.",
        "operationId": "lookThrough",
        "parameters": [
          {
            "name": "top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            },
            "description": "How many of the largest companies to return."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookThroughRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The look-through",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookThrough"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "413": {
            "description": "The request body is larger than 8 MB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP service (streamable HTTP, plain JSON answers) for AI assistants",
        "description": "One JSON-RPC 2.0 message per request (batches are refused). Tools: search_funds, get_fund_holdings, look_through. Every message uses the per-minute limit; only tools/call counts against the monthly quota.",
        "operationId": "mcp",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": [
                      "2.0"
                    ]
                  },
                  "id": {},
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC answer"
          },
          "202": {
            "description": "A notification was accepted"
          },
          "400": {
            "description": "Parse error or a batch"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/companies/{symbol}/holders": {
      "get": {
        "summary": "Which funds hold a company",
        "operationId": "companyHolders",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "The Yahoo symbol of the company, for example NVDA or SHOP.TO."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "Rows per page."
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "How many rows to skip."
          }
        ],
        "responses": {
          "200": {
            "description": "The funds that hold the company, biggest weight first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyHolders"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/securities": {
      "get": {
        "summary": "Search companies and stocks by name, symbol or ISIN",
        "operationId": "searchSecurities",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 40
            },
            "description": "Part of a name or symbol, or a 12-character ISIN."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching companies",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecuritySearch"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/securities/{symbol}": {
      "get": {
        "summary": "What we know about one company",
        "operationId": "getSecurity",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "The Yahoo symbol, for example NVDA or SHOP.TO."
          }
        ],
        "responses": {
          "200": {
            "description": "Name, sector, country, ISINs and how many funds hold it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Security"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/funds/{ticker}/detail": {
      "get": {
        "summary": "A fund's profile with its sector, country and asset-class breakdown",
        "operationId": "fundDetail",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The fund and its breakdown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/overlap": {
      "post": {
        "summary": "How much 2 to 10 funds overlap",
        "operationId": "overlap",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OverlapRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Overlap of each pair and the companies all funds hold",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Overlap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/holdings": {
      "post": {
        "summary": "The holdings of up to 20 funds in one call",
        "operationId": "holdingsBatch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HoldingsBatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One entry per fund: the holdings, or the reason there are none",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HoldingsBatch"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/issuers": {
      "get": {
        "summary": "The fund companies we store, with counts and freshness",
        "operationId": "listIssuers",
        "responses": {
          "200": {
            "description": "The issuers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Issuers"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/exchanges": {
      "get": {
        "summary": "Yahoo exchange suffixes and their countries",
        "operationId": "listExchanges",
        "responses": {
          "200": {
            "description": "The suffixes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Exchanges"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/companies/holders": {
      "get": {
        "summary": "Which funds hold a company, found by NAME (for companies with no market symbol, such as private companies)",
        "operationId": "companyHoldersByName",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 40
            },
            "description": "At least 3 characters of the company name, for example Anthropic."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "Rows per page."
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "How many rows to skip."
          }
        ],
        "responses": {
          "200": {
            "description": "The funds that hold a company whose name contains the text",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NameHolders"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/LimitReached"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your key, which starts with etfth_."
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "responses": {
      "BadRequest": {
        "description": "bad_request or ambiguous",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The key is missing, mistyped or stopped (one answer for all three)",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "LimitReached": {
        "description": "rate_limited (per minute), lookthrough_rate_limited, daily_quota_exceeded, weekly_quota_exceeded or monthly_quota_exceeded",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "Seconds to wait."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unavailable": {
        "description": "unavailable, or busy (all data slots stayed taken for 3 seconds: retry after 1 second; a busy answer is not counted against your per-minute allowance)",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Status": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "string"
          },
          "server_version": {
            "type": "string"
          },
          "data_as_of": {
            "type": "object",
            "properties": {
              "issuer_files_newest": {
                "type": "string",
                "nullable": true
              },
              "issuer_files_oldest": {
                "type": "string",
                "nullable": true
              },
              "sec_filings_oldest": {
                "type": "string",
                "nullable": true
              },
              "sec_filings_newest": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "fund_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "alias_tickers": {
            "type": "integer"
          }
        }
      },
      "Fund": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "SEC",
              "CUSTOM",
              "INDEX",
              "YF"
            ]
          },
          "report_date": {
            "type": "string",
            "nullable": true
          },
          "number_of_holdings": {
            "type": "integer",
            "nullable": true
          },
          "total_weight_pct": {
            "type": "number",
            "nullable": true,
            "description": "The sum of the weights we store."
          },
          "partial": {
            "type": "boolean",
            "description": "true when the list names only the largest holdings of the fund."
          },
          "partial_kind": {
            "type": "string",
            "nullable": true
          },
          "index_via": {
            "type": "string",
            "nullable": true
          },
          "index_name": {
            "type": "string",
            "nullable": true
          },
          "alias_of": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "description": "When we last read the fund's list (a timestamp). Used by updated_since."
          }
        }
      },
      "FundPage": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "funds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fund"
            }
          }
        }
      },
      "Holding": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "weight_pct": {
            "type": "number"
          },
          "raw_weight_pct": {
            "type": "number",
            "description": "Only with weights=normalized."
          },
          "yahoo_symbol": {
            "type": "string",
            "nullable": true
          },
          "sector": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "FundHoldings": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Fund"
          },
          {
            "type": "object",
            "properties": {
              "as_of": {
                "type": "string",
                "nullable": true
              },
              "note": {
                "type": "string"
              },
              "weights": {
                "type": "string"
              },
              "weights_note": {
                "type": "string"
              },
              "lines_stored": {
                "type": "integer"
              },
              "lines_returned": {
                "type": "integer"
              },
              "normalized_total_pct": {
                "type": "number"
              },
              "holdings": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Holding"
                }
              }
            }
          }
        ]
      },
      "LookThroughRequest": {
        "type": "object",
        "required": [
          "positions"
        ],
        "properties": {
          "positions": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "object",
              "required": [
                "symbol",
                "value"
              ],
              "properties": {
                "symbol": {
                  "type": "string",
                  "maxLength": 40
                },
                "value": {
                  "type": "number"
                }
              }
            }
          },
          "options": {
            "type": "object",
            "properties": {
              "base_currency": {
                "type": "string"
              }
            }
          },
          "top": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "LookThrough": {
        "type": "object",
        "properties": {
          "total_value": {
            "type": "number"
          },
          "base_currency": {
            "type": "string"
          },
          "top": {
            "type": "integer"
          },
          "companies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rank": {
                  "type": "integer"
                },
                "ticker": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "asset_type": {
                  "type": "string"
                },
                "asset_class": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                },
                "sector": {
                  "type": "string"
                },
                "value": {
                  "type": "number"
                },
                "pct": {
                  "type": "number"
                }
              }
            }
          },
          "companies_total": {
            "type": "integer"
          },
          "sectors": {
            "type": "object"
          },
          "countries": {
            "type": "object"
          },
          "allocation": {
            "type": "object"
          },
          "missing_weight": {
            "type": "object"
          },
          "unattributed": {
            "type": "number"
          },
          "funds_without_holdings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "not_in_fund_list": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CompanyHolders": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "funds_total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "holders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rank": {
                  "type": "integer"
                },
                "fund": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "issuer": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "SEC",
                    "CUSTOM",
                    "INDEX",
                    "YF"
                  ]
                },
                "weight_pct": {
                  "type": "number",
                  "description": "The weight of the company in the fund as stored (added up when the fund lists it more than once)."
                },
                "report_date": {
                  "type": "string",
                  "nullable": true
                },
                "partial": {
                  "type": "boolean"
                },
                "number_of_holdings": {
                  "type": "integer",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "Security": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "sector": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "isins": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "held_by_funds": {
            "type": "integer",
            "description": "How many stored funds list this company."
          },
          "profile_known": {
            "type": "boolean",
            "description": "false when we asked for a sector profile and none exists."
          }
        }
      },
      "SecuritySearch": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "total_returned": {
            "type": "integer"
          },
          "securities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "symbol": {
                  "type": "string"
                },
                "name": {
                  "type": "string",
                  "nullable": true
                },
                "sector": {
                  "type": "string",
                  "nullable": true
                },
                "country": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "FundDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Fund"
          },
          {
            "type": "object",
            "properties": {
              "renamed_to": {
                "type": "string"
              },
              "breakdown": {
                "type": "object",
                "properties": {
                  "sectors": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "sector": {
                          "type": "string"
                        },
                        "pct": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "country": {
                          "type": "string"
                        },
                        "pct": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "asset_classes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "asset_class": {
                          "type": "string"
                        },
                        "pct": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "unknown_sector_pct": {
                    "type": "number"
                  },
                  "unknown_country_pct": {
                    "type": "number"
                  },
                  "cash_pct": {
                    "type": "number"
                  },
                  "missing_weight_pct": {
                    "type": "number"
                  },
                  "companies_total": {
                    "type": "integer"
                  },
                  "top_companies": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "rank": {
                          "type": "integer"
                        },
                        "ticker": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "pct": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "OverlapRequest": {
        "type": "object",
        "required": [
          "funds"
        ],
        "properties": {
          "funds": {
            "type": "array",
            "minItems": 2,
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 40
            }
          }
        }
      },
      "Overlap": {
        "type": "object",
        "properties": {
          "funds": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Fund"
                },
                {
                  "type": "object",
                  "properties": {
                    "renamed_to": {
                      "type": "string"
                    },
                    "companies_used": {
                      "type": "integer"
                    }
                  }
                }
              ]
            }
          },
          "pairs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fund_a": {
                  "type": "string"
                },
                "fund_b": {
                  "type": "string"
                },
                "overlap_pct": {
                  "type": "number"
                },
                "shared_companies": {
                  "type": "integer"
                },
                "top_shared": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "symbol": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "weight_a_pct": {
                        "type": "number"
                      },
                      "weight_b_pct": {
                        "type": "number"
                      },
                      "overlap_pct": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          },
          "in_all_funds": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer"
              },
              "top": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "weights_pct": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "overlap_pct": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "HoldingsBatchRequest": {
        "type": "object",
        "required": [
          "tickers"
        ],
        "properties": {
          "tickers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 40
            }
          },
          "weights": {
            "type": "string",
            "enum": [
              "raw",
              "normalized"
            ]
          },
          "top": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "HoldingsBatch": {
        "type": "object",
        "properties": {
          "requested": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ticker": {
                  "type": "string"
                },
                "ok": {
                  "type": "boolean"
                },
                "data": {
                  "$ref": "#/components/schemas/FundHoldings"
                },
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Issuers": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "issuers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "issuer": {
                  "type": "string"
                },
                "funds": {
                  "type": "integer"
                },
                "partial_funds": {
                  "type": "integer"
                },
                "sources": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "newest_update": {
                  "type": "string",
                  "nullable": true
                },
                "oldest_update": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "Exchanges": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "exchanges": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yahoo_suffix": {
                  "type": "string",
                  "description": "The ending of a Yahoo symbol (.TO). Empty: a U.S. listing."
                },
                "country": {
                  "type": "string"
                },
                "note": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "NameHolders": {
        "type": "object",
        "properties": {
          "name_query": {
            "type": "string"
          },
          "matched_names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Up to 10 of the company names that matched."
          },
          "matched_names_total": {
            "type": "integer"
          },
          "funds_total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "holders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rank": {
                  "type": "integer"
                },
                "fund": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "issuer": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "SEC",
                    "CUSTOM",
                    "INDEX",
                    "YF"
                  ]
                },
                "weight_pct": {
                  "type": "number"
                },
                "report_date": {
                  "type": "string",
                  "nullable": true
                },
                "partial": {
                  "type": "boolean"
                },
                "number_of_holdings": {
                  "type": "integer",
                  "nullable": true
                },
                "matched_names": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
