{
  "openapi": "3.0.1",
  "info": {
    "title": "Financial Datasets API",
    "description": "Stock market API with real-time and historical financial data for 30,000+ tickers over 30+ years. Financial statements, equity prices, insider trades, SEC filings, and more.",
    "version": "1.0.0",
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    },
    "contact": {
      "name": "API Support",
      "url": "https://financialdatasets.ai/support",
      "email": "support@financialdatasets.ai"
    },
    "termsOfService": "https://financialdatasets.ai/terms"
  },
  "servers": [
    {
      "url": "https://api.financialdatasets.ai/",
      "description": "Production server"
    }
  ],
  "tags": [
    {
      "name": "Financial Statements",
      "description": "Access to income statements, balance sheets, and cash flow statements"
    },
    {
      "name": "Market Data",
      "description": "Real-time and historical price data"
    },
    {
      "name": "Company Information",
      "description": "Company facts like ticker, name, and description"
    },
    {
      "name": "Earnings",
      "description": "Earnings press releases and related data"
    },
    {
      "name": "Crypto",
      "description": "Cryptocurrency price data and market information"
    },
    {
      "name": "News",
      "description": "Real-time and historical news articles"
    },
    {
      "name": "SEC Filings",
      "description": "SEC filings and regulatory documents"
    },
    {
      "name": "Insider Trades",
      "description": "Insider trading activity and transactions"
    },
    {
      "name": "Institutional Ownership",
      "description": "Equity holdings of investment managers"
    },
    {
      "name": "Financial Metrics",
      "description": "Financial ratios, metrics, and key performance indicators"
    }
  ],
  "security": [
    {
      "X-API-KEY": []
    }
  ],
  "paths": {
    "/financials/search": {
      "post": {
        "tags": [
          "Financial Statements"
        ],
        "operationId": "searchFinancials",
        "summary": "Search financial statements",
        "description": "Search for financial data across income statements, balance sheets, and cash flow statements using filters.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchFiltersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful search response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialsSearchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/financials/search/line-items": {
      "post": {
        "tags": [
          "Financial Statements"
        ],
        "operationId": "searchLineItems",
        "summary": "Search specific financial metrics",
        "description": "Search for specific financial metrics across income statements, balance sheets, and cash flow statements.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchLineItemsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful search response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialsSearchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/insider-trades": {
      "get": {
        "tags": [
          "Insider Trades"
        ],
        "operationId": "getInsiderTrades",
        "summary": "Get insider trades",
        "description": "Get insider trades like buys and sells for a ticker by a company insider.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol of the company.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of transactions to return (default: 10).",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Insider trades response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsiderTradesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/institutional-ownership": {
      "get": {
        "tags": [
          "Institutional Ownership"
        ],
        "operationId": "getInstitutionalOwnership",
        "summary": "Get the equity holdings of an investment manager",
        "description": "Get institutional ownership by investor or ticker. Requires either investor or ticker parameter, but not both.",
        "parameters": [
          {
            "name": "investor",
            "in": "query",
            "description": "The name of the investment manager",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol, if queried by investor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of holdings to return (default: 10).",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Institutional ownership response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstitutionalOwnershipResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/company/facts": {
      "get": {
        "tags": [
          "Company Information"
        ],
        "operationId": "getCompanyFacts",
        "summary": "Get company facts",
        "description": "Get company facts for a ticker.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cik",
            "in": "query",
            "description": "The CIK of the company.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company facts response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyFactsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/filings": {
      "get": {
        "tags": [
          "SEC Filings"
        ],
        "operationId": "getFilings",
        "summary": "Get SEC filings",
        "description": "Get SEC filings for a company.",
        "parameters": [
          {
            "name": "cik",
            "in": "query",
            "description": "The Central Index Key (CIK) of the company.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filing_type",
            "in": "query",
            "description": "The type of filing.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "10-K",
                "10-Q",
                "8-K",
                "4",
                "144"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SEC filings response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilingsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },

    "/filings/items": {
      "get": {
        "tags": [
          "SEC Filings"
        ],
        "operationId": "getFilingItems",
        "summary": "Get SEC filing items",
        "description": "Get SEC filing items for a company.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filing_type",
            "in": "query",
            "description": "The type of filing.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "10-K",
                "10-Q"
              ]
            }
          },
          {
            "name": "year",
            "in": "query",
            "description": "The year of the filing.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "quarter",
            "in": "query",
            "description": "The quarter of the filing if 10-Q.",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "item",
            "in": "query",
            "description": "The item to get.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Item-1",
                "Item-1A",
                "Item-1B",
                "Item-2",
                "Item-3",
                "Item-4",
                "Item-5",
                "Item-6",
                "Item-7",
                "Item-7A",
                "Item-8",
                "Item-9",
                "Item-9A",
                "Item-9B",
                "Item-10",
                "Item-11",
                "Item-12",
                "Item-13",
                "Item-14",
                "Item-15",
                "Item-16"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SEC filing items response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilingItemsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/financials/segmented-revenues": {
      "get": {
        "tags": [
          "Financial Statements"
        ],
        "operationId": "getSegmentedRevenues",
        "summary": "Get segmented revenue data",
        "description": "Get detailed, segmented revenue data for a ticker.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "description": "The date or time period to which the reported revenue data relates in ISO 8601 format (YYYY-MM-DD).",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of revenue statements to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cik",
            "in": "query",
            "description": "The Central Index Key (CIK) of the company.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Segmented revenue response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentedRevenuesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/financials/income-statements": {
      "get": {
        "tags": [
          "Financial Statements"
        ],
        "operationId": "getIncomeStatements",
        "summary": "Get income statements",
        "description": "Get income statements for a ticker.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "description": "The time period of the income statements.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly",
                "ttm"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of income statements to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cik",
            "in": "query",
            "description": "The Central Index Key (CIK) of the company.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Income statements response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomeStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/financials/balance-sheets": {
      "get": {
        "tags": [
          "Financial Statements"
        ],
        "operationId": "getBalanceSheets",
        "summary": "Get balance sheets",
        "description": "Get balance sheets for a ticker.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "description": "The time period of the balance sheets.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly",
                "ttm"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of balance sheets to return",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cik",
            "in": "query",
            "description": "The Central Index Key (CIK) of the company.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Balance sheets response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceSheetResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/financials/cash-flow-statements": {
      "get": {
        "tags": [
          "Financial Statements"
        ],
        "operationId": "getCashFlowStatements",
        "summary": "Get cash flow statements",
        "description": "Get cash flow statements for a ticker.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "description": "The time period of the cash flow statements.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly",
                "ttm"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of cash flow statements to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cik",
            "in": "query",
            "description": "The Central Index Key (CIK) of the company.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cash flow statements response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashFlowStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/earnings/press-releases": {
      "get": {
        "tags": [
          "Earnings"
        ],
        "operationId": "getEarningsPressReleases",
        "summary": "Get earnings press releases",
        "description": "Get earnings press releases for a ticker.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Earnings press releases response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PressReleasesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/prices/snapshot": {
      "get": {
        "tags": [
          "Market Data"
        ],
        "operationId": "getPriceSnapshot",
        "summary": "Get price snapshot",
        "description": "Get the real-time price snapshot for a ticker.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price snapshot response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceSnapshotResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/crypto/prices/snapshot": {
      "get": {
        "tags": [
          "Crypto"
        ],
        "operationId": "getCryptoPriceSnapshot",
        "summary": "Get crypto price snapshot",
        "description": "Get the real-time price snapshot for a cryptocurrency.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The cryptocurrency ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price snapshot response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CryptoPriceSnapshotResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/financials": {
      "get": {
        "tags": [
          "Financial Statements"
        ],
        "operationId": "getAllFinancialStatements",
        "summary": "Get all financial statements",
        "description": "Get all financial statements for a ticker.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "description": "The time period of the financial statements.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly",
                "ttm"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of financial statements to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cik",
            "in": "query",
            "description": "The Central Index Key (CIK) of the company.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Financial statements response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/news": {
      "get": {
        "tags": [
          "News"
        ],
        "operationId": "getNews",
        "summary": "Get real-time and historical news",
        "description": "Get real-time and historical news for a ticker.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "The start date for the news data (format: YYYY-MM-DD).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "The end date for the news data (format: YYYY-MM-DD).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of news articles to return (default: 100, max: 100).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "News response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/prices": {
      "get": {
        "tags": [
          "Market Data"
        ],
        "operationId": "getPrices",
        "summary": "Get historical price data",
        "description": "Get ranged price data for a ticker to power stock charts and analyze price movements.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "description": "The time interval for the price data.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "second",
                "minute",
                "day",
                "week",
                "month",
                "year"
              ]
            }
          },
          {
            "name": "interval_multiplier",
            "in": "query",
            "description": "The multiplier for the interval.",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "The start date for the price data (format: YYYY-MM-DD).",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "The end date for the price data (format: YYYY-MM-DD).",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of price records to return (default: 5000, max: 5000).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000,
              "default": 5000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price data response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/crypto/prices": {
      "get": {
        "tags": [
          "Crypto"
        ],
        "operationId": "getCryptoPrices",
        "summary": "Get historical crypto price data",
        "description": "Get ranged price data for a cryptocurrency to power price charts and analyze price movements.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The cryptocurrency ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "description": "The time interval for the price data.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "minute",
                "day",
                "week",
                "month",
                "year"
              ]
            }
          },
          {
            "name": "interval_multiplier",
            "in": "query",
            "description": "The multiplier for the interval.",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "The start date for the price data (format: YYYY-MM-DD).",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "The end date for the price data (format: YYYY-MM-DD).",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of price records to return (default: 5000, max: 5000).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000,
              "default": 5000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price data response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CryptoPricesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/options": {
      "get": {
        "tags": [
          "Market Data"
        ],
        "operationId": "getOptionPrices",
        "summary": "Get historical option price data",
        "description": "Get ranged option price data for a ticker to power option charts and analyze option price movements.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The option ticker symbol.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "description": "The time interval for the option price data.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "second",
                "minute",
                "day",
                "week",
                "month",
                "year"
              ]
            }
          },
          {
            "name": "interval_multiplier",
            "in": "query",
            "description": "The multiplier for the interval.",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "description": "The start date for the option price data (format: YYYY-MM-DD).",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "description": "The end date for the option price data (format: YYYY-MM-DD).",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of option price records to return (default: 5000, max: 5000).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000,
              "default": 5000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Option price data response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptionPricesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/options/chain": {
      "get": {
        "tags": [
          "Options"
        ],
        "operationId": "getOptionsChain",
        "summary": "Get options chain data",
        "description": "Get real-time options chain data for actively traded equities.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol of the company.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "strike_price",
            "in": "query",
            "description": "The strike price of the options contract.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "option_type",
            "in": "query",
            "description": "The type of option contract (call or put).",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "call",
                "put"
              ]
            }
          },
          {
            "name": "expiration_date",
            "in": "query",
            "description": "The expiration date of the options contract (YYYY-MM-DD).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Options chain response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptionsChainResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/financial-metrics": {
      "get": {
        "tags": [
          "Financial Metrics"
        ],
        "operationId": "getFinancialMetrics",
        "summary": "Get financial metrics",
        "description": "Get financial metrics for a ticker, including valuation, profitability, efficiency, liquidity, leverage, growth, and per share metrics.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol of the company.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "description": "The time period for the financial data.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly",
                "ttm"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of results to return.",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The historical financial metrics and ratios for a ticker",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialMetricsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    },
    "/financial-metrics/snapshot": {
      "get": {
        "tags": [
          "Financial Metrics"
        ],
        "operationId": "getFinancialMetricsSnapshot",
        "summary": "Get financial metrics snapshot",
        "description": "Get a real-time snapshot of key financial metrics and ratios for a ticker, including valuation, profitability, efficiency, liquidity, leverage, growth, and per share metrics.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "description": "The ticker symbol of the company.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The current financial metrics snapshot for a ticker",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialMetricsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequiredError"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "X-API-KEY": {
        "type": "apiKey",
        "name": "X-API-KEY",
        "description": "API key for authentication.",
        "in": "header"
      }
    },
    "schemas": {
      "SearchFiltersRequest": {
        "type": "object",
        "required": [
          "filters"
        ],
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "annual",
              "quarterly",
              "ttm"
            ],
            "default": "ttm",
            "description": "The time period for the financial data."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 100,
            "description": "The maximum number of results to return."
          },
          "order_by": {
            "type": "string",
            "enum": [
              "ticker",
              "-ticker",
              "report_period",
              "-report_period"
            ],
            "default": "ticker",
            "description": "The field to order the results by.  Use -field to order in descending order."
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "EUR",
              "GBP",
              "JPY",
              "CHF",
              "AUD",
              "CAD",
              "SEK"
            ],
            "description": "The currency of the financial data."
          },
          "historical": {
            "type": "boolean",
            "default": false,
            "description": "Whether to return historical financial data."
          },
          "filters": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "operator",
                "value"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "description": "The criteria to filter on.  For financial metric fields, use 'gt', 'lt', 'gte', 'lte', 'eq' operators.  For 'ticker' and 'cik' fields, use the 'in' operator to filter against multiple values."
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "gt",
                    "lt",
                    "gte",
                    "lte",
                    "eq",
                    "in"
                  ],
                  "description": "The comparison operator. The 'in' operator can only be used with a field value of 'ticker' or 'cik' and lets you filter against multiple values."
                },
                "value": {
                  "oneOf": [
                    {
                      "type": "number",
                      "description": "The value to compare against for single-value operators (gt, lt, gte, lte, eq)"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Array of ticker or cik values to compare against when using the 'in' operator"
                    }
                  ]
                }
              }
            },
            "minItems": 1,
            "description": "An array of filter objects to apply to the search."
          }
        }
      },
      "SearchLineItemsRequest": {
        "type": "object",
        "required": [
          "line_items",
          "tickers"
        ],
        "properties": {
          "line_items": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "The financial metric to search for."
            },
            "minItems": 1,
            "description": "An array of line items to apply to the search."
          },
          "tickers": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "The tickers to search for."
            },
            "minItems": 1,
            "description": "An array of tickers to apply to the search."
          },
          "period": {
            "type": "string",
            "enum": [
              "annual",
              "quarterly",
              "ttm"
            ],
            "default": "ttm",
            "description": "The time period for the financial data."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "default": 1,
            "description": "The maximum number of results to return."
          }
        }
      },
      "FinancialsSearchResponse": {
        "type": "object",
        "properties": {
          "search_results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ticker": {
                  "type": "string",
                  "description": "The ticker symbol of the company."
                },
                "report_period": {
                  "type": "string",
                  "format": "date",
                  "description": "The reporting period of the financial data."
                },
                "period": {
                  "type": "string",
                  "enum": [
                    "annual",
                    "quarterly",
                    "ttm"
                  ],
                  "description": "The time period of the financial data."
                },
                "currency": {
                  "type": "string",
                  "description": "The currency of the financial data."
                }
              },
              "additionalProperties": {
                "type": "string",
                "description": "Additional financial metrics based on the search criteria."
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A short error message."
          },
          "message": {
            "type": "string",
            "description": "A more detailed error message."
          }
        }
      },
      "InsiderTradesResponse": {
        "type": "object",
        "properties": {
          "insider_trades": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsiderTrade"
            }
          }
        }
      },
      "InstitutionalOwnershipResponse": {
        "type": "object",
        "properties": {
          "institutional-ownership": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstitutionalOwnership"
            }
          }
        }
      },
      "FinancialsResponse": {
        "type": "object",
        "properties": {
          "financials": {
            "type": "object",
            "properties": {
              "income_statements": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IncomeStatement"
                }
              },
              "balance_sheets": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BalanceSheet"
                }
              },
              "cash_flow_statements": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CashFlowStatement"
                }
              }
            }
          }
        }
      },
      "SegmentedRevenuesResponse": {
        "type": "object",
        "properties": {
          "segmented_revenues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SegmentedRevenues"
            }
          }
        }
      },
      "IncomeStatementResponse": {
        "type": "object",
        "properties": {
          "income_statements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncomeStatement"
            }
          }
        }
      },
      "BalanceSheetResponse": {
        "type": "object",
        "properties": {
          "balance_sheets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceSheet"
            }
          }
        }
      },
      "CashFlowStatementResponse": {
        "type": "object",
        "properties": {
          "cash_flow_statements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CashFlowStatement"
            }
          }
        }
      },
      "CompanyFactsResponse": {
        "type": "object",
        "properties": {
          "company_facts": {
            "$ref": "#/components/schemas/CompanyFacts"
          }
        }
      },
      "FilingsResponse": {
        "type": "object",
        "properties": {
          "filings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Filing"
            }
          }
        }
      },
      "FilingItemsResponse": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol of the company."
          },
          "cik": {
            "type": "string",
            "description": "The Central Index Key (CIK) of the company."
          },
          "filing_type": {
            "type": "string",
            "description": "The type of filing."
          },
          "accession_number": {
            "type": "string",
            "description": "The accession number of the filing."
          },
          "year": {
            "type": "integer",
            "description": "The year of the filing."
          },
          "quarter": {
            "type": "integer",
            "description": "The quarter of the filing."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilingItem"
            }
          }
        }
      },
      "PressReleasesResponse": {
        "type": "object",
        "properties": {
          "press_releases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PressRelease"
            }
          }
        }
      },
      "PriceSnapshotResponse": {
        "type": "object",
        "properties": {
          "snapshot": {
            "$ref": "#/components/schemas/PriceSnapshot"
          }
        }
      },
      "CryptoPriceSnapshotResponse": {
        "type": "object",
        "properties": {
          "snapshot": {
            "$ref": "#/components/schemas/CryptoPriceSnapshot"
          }
        }
      },
      "NewsResponse": {
        "type": "object",
        "properties": {
          "news": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/News"
            }
          }
        }
      },
      "PricesResponse": {
        "type": "object",
        "properties": {
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Price"
            }
          },
          "next_page_url": {
            "type": "string",
            "description": "The URL to the next page of results."
          }
        }
      },
      "CryptoPricesResponse": {
        "type": "object",
        "properties": {
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Price"
            }
          }
        }
      },
      "OptionPricesResponse": {
        "type": "object",
        "properties": {
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OptionPrice"
            }
          }
        }
      },
      "InsiderTrade": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol of the company."
          },
          "issuer": {
            "type": "string",
            "description": "The name of the issuing company."
          },
          "name": {
            "type": "string",
            "description": "The name of the insider."
          },
          "title": {
            "type": "string",
            "description": "The title of the insider."
          },
          "is_board_director": {
            "type": "boolean",
            "description": "Whether the insider is a board director."
          },
          "transaction_date": {
            "type": "string",
            "format": "date",
            "description": "The date of the transaction."
          },
          "transaction_shares": {
            "type": "number",
            "description": "The number of shares involved in the transaction."
          },
          "transaction_price_per_share": {
            "type": "number",
            "description": "The price per share in the transaction."
          },
          "transaction_value": {
            "type": "number",
            "description": "The total value of the transaction."
          },
          "shares_owned_before_transaction": {
            "type": "number",
            "description": "The number of shares owned before the transaction."
          },
          "shares_owned_after_transaction": {
            "type": "number",
            "description": "The number of shares owned after the transaction."
          },
          "security_title": {
            "type": "string",
            "description": "The title of the security involved in the transaction."
          },
          "filing_date": {
            "type": "string",
            "format": "date",
            "description": "The date the transaction was filed."
          }
        }
      },
      "InstitutionalOwnership": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol, if queried by investor."
          },
          "investor": {
            "type": "string",
            "description": "The investor name, if queried by ticker."
          },
          "report_period": {
            "type": "string",
            "format": "date",
            "description": "The reporting period of the institutional ownership."
          },
          "price": {
            "type": "number",
            "description": "The estimated purchase price of the equity position."
          },
          "shares": {
            "type": "number",
            "description": "The number of shares held by the investment manager."
          },
          "market_value": {
            "type": "number",
            "description": "The market value of the equity position."
          }
        }
      },
      "SegmentedRevenues": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol."
          },
          "report_period": {
            "type": "string",
            "format": "date",
            "description": "The reporting period of the revenue."
          },
          "period": {
            "type": "string",
            "enum": [
              "quarterly",
              "annual"
            ],
            "description": "The time period of the revenue."
          },
          "items": {
            "type": "array",
            "description": "An array of revenue segments from SEC filings (10-Ks and 10-Qs) in XBRL format",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The name of the revenue segment."
                },
                "amount": {
                  "type": "number",
                  "description": "The numerical amount reported for the specified financial metric, expressed in the company's reporting currency; default is USD."
                },
                "end_period": {
                  "type": "string",
                  "format": "date",
                  "nullable": true,
                  "description": "The end period of the revenue segment.  Only provided for quarterly data."
                },
                "start_period": {
                  "type": "string",
                  "format": "date",
                  "nullable": true,
                  "description": "The start period of the revenue segment.  Only provided for quarterly data."
                },
                "segments": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string",
                        "description": "The label for the revenue segment."
                      },
                      "type": {
                        "type": "string",
                        "description": "The type of revenue segment."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "IncomeStatement": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol."
          },
          "report_period": {
            "type": "string",
            "format": "date",
            "description": "The reporting period of the income statement."
          },
          "fiscal_period": {
            "type": "string",
            "description": "The fiscal period of the income statement."
          },
          "period": {
            "type": "string",
            "enum": [
              "quarterly",
              "ttm",
              "annual"
            ],
            "description": "The time period of the income statement."
          },
          "currency": {
            "type": "string",
            "description": "The currency in which the financial data is reported."
          },
          "revenue": {
            "type": "number",
            "nullable": false,
            "description": "The total revenue of the company."
          },
          "cost_of_revenue": {
            "type": "number",
            "nullable": false,
            "description": "The cost of revenue of the company."
          },
          "gross_profit": {
            "type": "number",
            "nullable": false,
            "description": "The gross profit of the company."
          },
          "operating_expense": {
            "type": "number",
            "nullable": false,
            "description": "The operating expenses of the company."
          },
          "selling_general_and_administrative_expenses": {
            "type": "number",
            "nullable": false,
            "description": "The selling, general, and administrative expenses of the company."
          },
          "research_and_development": {
            "type": "number",
            "nullable": false,
            "description": "The research and development expenses of the company."
          },
          "operating_income": {
            "type": "number",
            "nullable": false,
            "description": "The operating income of the company."
          },
          "interest_expense": {
            "type": "number",
            "nullable": false,
            "description": "The interest expenses of the company."
          },
          "ebit": {
            "type": "number",
            "nullable": false,
            "description": "The earnings before interest and taxes of the company."
          },
          "income_tax_expense": {
            "type": "number",
            "nullable": false,
            "description": "The income tax expenses of the company."
          },
          "net_income_discontinued_operations": {
            "type": "number",
            "nullable": false,
            "description": "The net income from discontinued operations of the company."
          },
          "net_income_non_controlling_interests": {
            "type": "number",
            "nullable": false,
            "description": "The net income from non-controlling interests of the company."
          },
          "net_income": {
            "type": "number",
            "nullable": false,
            "description": "The net income of the company."
          },
          "net_income_common_stock": {
            "type": "number",
            "nullable": false,
            "description": "The net income available to common stockholders of the company."
          },
          "preferred_dividends_impact": {
            "type": "number",
            "nullable": false,
            "description": "The impact of preferred dividends on the net income of the company."
          },
          "consolidated_income": {
            "type": "number",
            "nullable": false,
            "description": "The consolidated income of the company."
          },
          "earnings_per_share": {
            "type": "number",
            "nullable": false,
            "description": "The earnings per share of the company."
          },
          "earnings_per_share_diluted": {
            "type": "number",
            "nullable": false,
            "description": "The diluted earnings per share of the company."
          },
          "dividends_per_common_share": {
            "type": "number",
            "nullable": false,
            "description": "The dividends per common share of the company."
          },
          "weighted_average_shares": {
            "type": "number",
            "nullable": false,
            "description": "The weighted average shares of the company."
          },
          "weighted_average_shares_diluted": {
            "type": "number",
            "nullable": false,
            "description": "The diluted weighted average shares of the company."
          }
        }
      },
      "BalanceSheet": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol."
          },
          "report_period": {
            "type": "string",
            "format": "date",
            "description": "The reporting period of the balance sheet."
          },
          "fiscal_period": {
            "type": "string",
            "description": "The fiscal period of the balance sheet."
          },
          "period": {
            "type": "string",
            "enum": [
              "quarterly",
              "ttm",
              "annual"
            ],
            "description": "The time period of the balance sheet."
          },
          "currency": {
            "type": "string",
            "description": "The currency in which the financial data is reported."
          },
          "total_assets": {
            "type": "number",
            "nullable": false,
            "description": "The total assets of the company."
          },
          "current_assets": {
            "type": "number",
            "nullable": false,
            "description": "The current assets of the company."
          },
          "cash_and_equivalents": {
            "type": "number",
            "nullable": false,
            "description": "The cash and equivalents of the company."
          },
          "inventory": {
            "type": "number",
            "nullable": false,
            "description": "The inventory of the company."
          },
          "current_investments": {
            "type": "number",
            "nullable": false,
            "description": "The current investments of the company."
          },
          "trade_and_non_trade_receivables": {
            "type": "number",
            "nullable": false,
            "description": "The trade and non-trade receivables of the company."
          },
          "non_current_assets": {
            "type": "number",
            "nullable": false,
            "description": "The non-current assets of the company."
          },
          "property_plant_and_equipment": {
            "type": "number",
            "nullable": false,
            "description": "The property, plant, and equipment of the company."
          },
          "goodwill_and_intangible_assets": {
            "type": "number",
            "nullable": false,
            "description": "The goodwill and intangible assets of the company."
          },
          "investments": {
            "type": "number",
            "nullable": false,
            "description": "The investments of the company."
          },
          "non_current_investments": {
            "type": "number",
            "nullable": false,
            "description": "The non-current investments of the company."
          },
          "outstanding_shares": {
            "type": "number",
            "nullable": false,
            "description": "The outstanding shares of the company."
          },
          "tax_assets": {
            "type": "number",
            "nullable": false,
            "description": "The tax assets of the company."
          },
          "total_liabilities": {
            "type": "number",
            "nullable": false,
            "description": "The total liabilities of the company."
          },
          "current_liabilities": {
            "type": "number",
            "nullable": false,
            "description": "The current liabilities of the company."
          },
          "current_debt": {
            "type": "number",
            "nullable": false,
            "description": "The current debt of the company."
          },
          "trade_and_non_trade_payables": {
            "type": "number",
            "nullable": false,
            "description": "The trade and non-trade payables of the company."
          },
          "deferred_revenue": {
            "type": "number",
            "nullable": false,
            "description": "The deferred revenue of the company."
          },
          "deposit_liabilities": {
            "type": "number",
            "nullable": false,
            "description": "The deposit liabilities of the company."
          },
          "non_current_liabilities": {
            "type": "number",
            "nullable": false,
            "description": "The non-current liabilities of the company."
          },
          "non_current_debt": {
            "type": "number",
            "nullable": false,
            "description": "The non-current debt of the company."
          },
          "tax_liabilities": {
            "type": "number",
            "nullable": false,
            "description": "The tax liabilities of the company."
          },
          "shareholders_equity": {
            "type": "number",
            "nullable": false,
            "description": "The shareholders' equity of the company."
          },
          "retained_earnings": {
            "type": "number",
            "nullable": false,
            "description": "The retained earnings of the company."
          },
          "accumulated_other_comprehensive_income": {
            "type": "number",
            "nullable": false,
            "description": "The accumulated other comprehensive income of the company."
          },
          "total_debt": {
            "type": "number",
            "nullable": false,
            "description": "The total debt of the company."
          }
        }
      },
      "CashFlowStatement": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol."
          },
          "report_period": {
            "type": "string",
            "format": "date",
            "description": "The reporting period of the cash flow statement."
          },
          "fiscal_period": {
            "type": "string",
            "description": "The fiscal period of the cash flow statement."
          },
          "period": {
            "type": "string",
            "enum": [
              "quarterly",
              "ttm",
              "annual"
            ],
            "description": "The time period of the cash flow statement."
          },
          "currency": {
            "type": "string",
            "description": "The currency in which the financial data is reported."
          },
          "net_income": {
            "type": "number",
            "nullable": false,
            "description": "The net income of the company."
          },
          "depreciation_and_amortization": {
            "type": "number",
            "nullable": false,
            "description": "The depreciation and amortization of the company."
          },
          "share_based_compensation": {
            "type": "number",
            "nullable": false,
            "description": "The share-based compensation of the company."
          },
          "net_cash_flow_from_operations": {
            "type": "number",
            "nullable": false,
            "description": "The net cash flow from operations of the company."
          },
          "capital_expenditure": {
            "type": "number",
            "nullable": false,
            "description": "The capital expenditure of the company."
          },
          "business_acquisitions_and_disposals": {
            "type": "number",
            "nullable": false,
            "description": "The business acquisitions and disposals of the company."
          },
          "investment_acquisitions_and_disposals": {
            "type": "number",
            "nullable": false,
            "description": "The investment acquisitions and disposals of the company."
          },
          "net_cash_flow_from_investing": {
            "type": "number",
            "nullable": false,
            "description": "The net cash flow from investing of the company."
          },
          "issuance_or_repayment_of_debt_securities": {
            "type": "number",
            "nullable": false,
            "description": "The issuance or repayment of debt securities of the company."
          },
          "issuance_or_purchase_of_equity_shares": {
            "type": "number",
            "nullable": false,
            "description": "The issuance or purchase of equity shares of the company."
          },
          "dividends_and_other_cash_distributions": {
            "type": "number",
            "nullable": false,
            "description": "The dividends and other cash distributions of the company."
          },
          "net_cash_flow_from_financing": {
            "type": "number",
            "nullable": false,
            "description": "The net cash flow from financing of the company."
          },
          "change_in_cash_and_equivalents": {
            "type": "number",
            "nullable": false,
            "description": "The change in cash and equivalents of the company."
          },
          "effect_of_exchange_rate_changes": {
            "type": "number",
            "nullable": false,
            "description": "The effect of exchange rate changes of the company."
          },
          "ending_cash_balance": {
            "type": "number",
            "nullable": false,
            "description": "The ending cash balance of the company."
          },
          "free_cash_flow": {
            "type": "number",
            "nullable": false,
            "description": "The free cash flow of the company."
          }
        }
      },
      "CompanyFacts": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol of the company."
          },
          "name": {
            "type": "string",
            "description": "The name of the company."
          },
          "cik": {
            "type": "string",
            "description": "The Central Index Key (CIK) of the company."
          },
          "industry": {
            "type": "string",
            "description": "The industry of the company."
          },
          "sector": {
            "type": "string",
            "description": "The sector of the company."
          },
          "category": {
            "type": "string",
            "description": "The category of the company."
          },
          "exchange": {
            "type": "string",
            "description": "The exchange of the company."
          },
          "is_active": {
            "type": "boolean",
            "description": "Whether the company is currently active."
          },
          "listing_date": {
            "type": "string",
            "format": "date",
            "description": "The date the company was listed on the stock exchange."
          },
          "location": {
            "type": "string",
            "description": "The location of the company."
          },
          "market_cap": {
            "type": "number",
            "description": "The market capitalization of the company."
          },
          "number_of_employees": {
            "type": "number",
            "description": "The number of employees at the company."
          },
          "sec_filings_url": {
            "type": "string",
            "format": "uri",
            "description": "The URL of the company's SEC filings."
          },
          "sic_code": {
            "type": "string",
            "description": "The Standard Industrial Classification (SIC) code of the company."
          },
          "sic_industry": {
            "type": "string",
            "description": "The industry of the company based on the SIC code."
          },
          "sic_sector": {
            "type": "string",
            "description": "The sector of the company based on the SIC code."
          },
          "website_url": {
            "type": "string",
            "format": "uri",
            "description": "The URL of the company's website."
          },
          "weighted_average_shares": {
            "type": "number",
            "description": "The weighted average shares of the company."
          }
        }
      },
      "Filing": {
        "type": "object",
        "properties": {
          "cik": {
            "type": "integer",
            "description": "The Central Index Key (CIK) of the company."
          },
          "accession_number": {
            "type": "string",
            "description": "The accession number of the filing."
          },
          "filing_type": {
            "type": "string",
            "description": "The type of the SEC filing (e.g., 10-Q, 8-K)."
          },
          "report_date": {
            "type": "string",
            "format": "date",
            "description": "The date of the report."
          },
          "ticker": {
            "type": "string",
            "description": "The ticker symbol."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The URL of the SEC filing."
          }
        }
      },
      "FilingItem": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "The item number."
          },
          "name": {
            "type": "string",
            "description": "The item name."
          },
          "text": {
            "type": "string",
            "description": "The item text."
          }
        }
      },
      "PressRelease": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol of the company."
          },
          "title": {
            "type": "string",
            "description": "The title of the press release."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The URL of the press release."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "The date the press release was published."
          },
          "text": {
            "type": "string",
            "description": "The full text of the press release."
          }
        }
      },
      "PriceSnapshot": {
        "type": "object",
        "properties": {
          "price": {
            "type": "number",
            "description": "The current price of the stock."
          },
          "ticker": {
            "type": "string",
            "description": "The ticker symbol."
          },
          "day_change": {
            "type": "number",
            "description": "The price change since the previous trading day's close."
          },
          "day_change_percent": {
            "type": "number",
            "description": "The percentage price change since the previous trading day's close."
          },
          "market_cap": {
            "type": "number",
            "description": "The market capitalization of the company."
          },
          "time": {
            "type": "string",
            "description": "The timestamp of the price snapshot in human-readable format in UTC."
          },
          "time_milliseconds": {
            "type": "number",
            "description": "The timestamp of the price snapshot in milliseconds since epoch."
          }
        }
      },
      "CryptoPriceSnapshot": {
        "type": "object",
        "properties": {
          "price": {
            "type": "number",
            "description": "The current price of the cryptocurrency."
          },
          "ticker": {
            "type": "string",
            "description": "The ticker symbol."
          },
          "day_change": {
            "type": "number",
            "description": "The price change over the last 24 hours."
          },
          "day_change_percent": {
            "type": "number",
            "description": "The percentage price change over the last 24 hours."
          },
          "time": {
            "type": "string",
            "description": "The timestamp of the price snapshot in human-readable format in UTC."
          }
        }
      },
      "News": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol."
          },
          "title": {
            "type": "string",
            "description": "The title of the news article."
          },
          "author": {
            "type": "string",
            "description": "The author of the news article."
          },
          "source": {
            "type": "string",
            "description": "The source of the news article."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "The date the news article was published."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The URL of the news article."
          },
          "sentiment": {
            "type": "string",
            "description": "The sentiment of the news article."
          }
        }
      },
      "Price": {
        "type": "object",
        "properties": {
          "open": {
            "type": "number",
            "description": "The open price of the ticker in the given time period."
          },
          "close": {
            "type": "number",
            "description": "The close price of the ticker in the given time period."
          },
          "high": {
            "type": "number",
            "description": "The high price of the ticker in the given time period."
          },
          "low": {
            "type": "number",
            "description": "The low price of the ticker in the given time period."
          },
          "volume": {
            "type": "integer",
            "format": "number",
            "description": "The volume of the ticker in the given time period."
          },
          "time": {
            "type": "string",
            "description": "The human-readable time format of the price in UTC."
          },
          "time_milliseconds": {
            "type": "number",
            "description": "The timestamp of the price in milliseconds since epoch."
          }
        }
      },
      "OptionPrice": {
        "type": "object",
        "properties": {
          "open": {
            "type": "number",
            "description": "The open price of the option in the given time period."
          },
          "close": {
            "type": "number",
            "description": "The close price of the option in the given time period."
          },
          "high": {
            "type": "number",
            "description": "The high price of the option in the given time period."
          },
          "low": {
            "type": "number",
            "description": "The low price of the option in the given time period."
          },
          "volume": {
            "type": "integer",
            "format": "number",
            "description": "The volume of the option in the given time period."
          },
          "time": {
            "type": "string",
            "description": "The human-readable time format of the price in UTC."
          }
        }
      },
      "OptionsChainResponse": {
        "type": "object",
        "properties": {
          "options_chain": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ticker": {
                  "type": "string",
                  "description": "The option contract identifier."
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "Call",
                    "Put"
                  ],
                  "description": "The type of option contract."
                },
                "strike_price": {
                  "type": "number",
                  "description": "The strike price of the option contract."
                },
                "expiration_date": {
                  "type": "string",
                  "format": "date",
                  "description": "The expiration date of the option contract."
                },
                "shares_per_contract": {
                  "type": "integer",
                  "description": "The number of shares per contract."
                },
                "volume": {
                  "type": "integer",
                  "description": "The trading volume of the option contract."
                },
                "open_interest": {
                  "type": "integer",
                  "description": "The number of open contracts."
                },
                "bid_price": {
                  "type": "number",
                  "description": "The highest price a buyer is willing to pay."
                },
                "bid_size": {
                  "type": "integer",
                  "description": "The quantity of contracts at the bid price."
                },
                "ask_price": {
                  "type": "number",
                  "description": "The lowest price a seller is willing to accept."
                },
                "ask_size": {
                  "type": "integer",
                  "description": "The quantity of contracts at the ask price."
                },
                "last_trade_price": {
                  "type": "number",
                  "description": "The price of the last executed trade."
                },
                "last_trade_size": {
                  "type": "integer",
                  "description": "The size of the last executed trade."
                },
                "last_trade_time": {
                  "type": "string",
                  "description": "The time of the last trade in human-readable format in UTC."
                }
              }
            }
          }
        }
      },
      "FinancialMetricsResponse": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string",
            "description": "The ticker symbol of the company."
          },
          "market_cap": {
            "type": "number",
            "description": "The market capitalization of the company."
          },
          "enterprise_value": {
            "type": "number",
            "description": "The total value of the company (market cap + debt - cash)."
          },
          "price_to_earnings_ratio": {
            "type": "number",
            "description": "Price to earnings ratio."
          },
          "price_to_book_ratio": {
            "type": "number",
            "description": "Price to book ratio."
          },
          "price_to_sales_ratio": {
            "type": "number",
            "description": "Price to sales ratio."
          },
          "enterprise_value_to_ebitda_ratio": {
            "type": "number",
            "description": "Enterprise value to EBITDA ratio."
          },
          "enterprise_value_to_revenue_ratio": {
            "type": "number",
            "description": "Enterprise value to revenue ratio."
          },
          "free_cash_flow_yield": {
            "type": "number",
            "description": "Free cash flow yield."
          },
          "peg_ratio": {
            "type": "number",
            "description": "Price to earnings growth ratio."
          },
          "gross_margin": {
            "type": "number",
            "description": "Gross profit as a percentage of revenue."
          },
          "operating_margin": {
            "type": "number",
            "description": "Operating income as a percentage of revenue."
          },
          "net_margin": {
            "type": "number",
            "description": "Net income as a percentage of revenue."
          },
          "return_on_equity": {
            "type": "number",
            "description": "Net income as a percentage of shareholders' equity."
          },
          "return_on_assets": {
            "type": "number",
            "description": "Net income as a percentage of total assets."
          },
          "return_on_invested_capital": {
            "type": "number",
            "description": "Net operating profit after taxes as a percentage of invested capital."
          },
          "asset_turnover": {
            "type": "number",
            "description": "Revenue divided by average total assets."
          },
          "inventory_turnover": {
            "type": "number",
            "description": "Cost of goods sold divided by average inventory."
          },
          "receivables_turnover": {
            "type": "number",
            "description": "Revenue divided by average accounts receivable."
          },
          "days_sales_outstanding": {
            "type": "number",
            "description": "Average accounts receivable divided by revenue over the period."
          },
          "operating_cycle": {
            "type": "number",
            "description": "Inventory turnover + receivables turnover."
          },
          "working_capital_turnover": {
            "type": "number",
            "description": "Revenue divided by average working capital."
          },
          "current_ratio": {
            "type": "number",
            "description": "Current assets divided by current liabilities."
          },
          "quick_ratio": {
            "type": "number",
            "description": "Quick assets divided by current liabilities."
          },
          "cash_ratio": {
            "type": "number",
            "description": "Cash and cash equivalents divided by current liabilities."
          },
          "operating_cash_flow_ratio": {
            "type": "number",
            "description": "Operating cash flow divided by current liabilities."
          },
          "debt_to_equity": {
            "type": "number",
            "description": "Total debt divided by shareholders' equity."
          },
          "debt_to_assets": {
            "type": "number",
            "description": "Total debt divided by total assets."
          },
          "interest_coverage": {
            "type": "number",
            "description": "EBIT divided by interest expense."
          },
          "revenue_growth": {
            "type": "number",
            "description": "Year-over-year growth in revenue."
          },
          "earnings_growth": {
            "type": "number",
            "description": "Year-over-year growth in earnings."
          },
          "book_value_growth": {
            "type": "number",
            "description": "Year-over-year growth in book value."
          },
          "earnings_per_share_growth": {
            "type": "number",
            "description": "Growth in earnings per share over the period."
          },
          "free_cash_flow_growth": {
            "type": "number",
            "description": "Growth in free cash flow over the period."
          },
          "operating_income_growth": {
            "type": "number",
            "description": "Growth in operating income over the period."
          },
          "ebitda_growth": {
            "type": "number",
            "description": "Growth in EBITDA over the period."
          },
          "payout_ratio": {
            "type": "number",
            "description": "Dividends paid as a percentage of net income."
          },
          "earnings_per_share": {
            "type": "number",
            "description": "Net income divided by weighted average shares outstanding."
          },
          "book_value_per_share": {
            "type": "number",
            "description": "Shareholders' equity divided by shares outstanding."
          },
          "free_cash_flow_per_share": {
            "type": "number",
            "description": "Free cash flow divided by shares outstanding."
          }
        }
      }
    },
    "responses": {
      "BadRequestError": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": "Bad Request",
              "message": "Invalid request parameters"
            }
          }
        }
      },
      "UnauthorizedError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": "Unauthorized",
              "message": "Invalid API key provided"
            }
          }
        }
      },
      "NotFoundError": {
        "description": "The specified resource was not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": "Not Found",
              "message": "Ticker XXXX not found"
            }
          }
        }
      },
      "PaymentRequiredError": {
        "description": "The request requires a paid subscription",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": "Payment Required",
              "message": "This endpoint requires a paid subscription. Please upgrade your plan."
            }
          }
        }
      }
    }
  }
}