{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ko-io/json-schema/ko-io-financials-historical-response-schema.json",
  "title": "FinancialsHistoricalResponse",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ko-io-openapi.yaml#/components/schemas/FinancialsHistoricalResponse",
  "type": "object",
  "required": [
    "data",
    "meta"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "ticker",
        "quarterly",
        "annual"
      ],
      "properties": {
        "ticker": {
          "type": "string"
        },
        "quarterly": {
          "type": "array",
          "description": "Fiscal quarters, oldest first (up to 48). Free plan and demo mode: only the latest quarter.",
          "items": {
            "$ref": "#/$defs/FinancialsRow"
          }
        },
        "annual": {
          "type": "array",
          "description": "Fiscal years, oldest first (up to 12). Free plan and demo mode: empty; annual statements require Pro.",
          "items": {
            "$ref": "#/$defs/FinancialsRow"
          }
        }
      },
      "additionalProperties": false
    },
    "meta": {
      "type": "object",
      "required": [
        "query_time_ms"
      ],
      "properties": {
        "query_time_ms": {
          "type": "number"
        },
        "softwall": {
          "type": "object",
          "description": "Present when the caller's plan limited the series (Free plan and demo mode)."
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": false,
  "$defs": {
    "FinancialsRow": {
      "type": "object",
      "description": "One fiscal period from the issuer's SEC XBRL facts (a 10-Q quarter or a 10-K fiscal year). Money fields are USD, not thousands; null means not reported or not derivable, never 0. Income-statement and cash-flow fields cover the period: a quarter is three months. A filed three-month value is used as is; only a year-to-date value is differenced, against the previous year-to-date value of the same fiscal year. Q4 is the 10-K three-month value when filed, else the fiscal year minus the nine-month value, else the fiscal year minus Q1 + Q2 + Q3 when all three are known; otherwise null. Balance-sheet fields are as of `period_end`.",
      "required": [
        "ticker",
        "entity_name",
        "fiscal_year",
        "fiscal_period",
        "period_end",
        "filed_date",
        "revenue",
        "cost_of_revenue",
        "gross_profit",
        "operating_expenses",
        "sg_and_a",
        "r_and_d",
        "operating_income",
        "income_before_tax",
        "net_income",
        "eps_basic",
        "eps_diluted",
        "depreciation_amortization",
        "total_assets",
        "current_assets",
        "cash_and_equivalents",
        "accounts_receivable",
        "inventory",
        "ppe_net",
        "total_liabilities",
        "current_liabilities",
        "noncurrent_liabilities",
        "accounts_payable",
        "stockholders_equity",
        "retained_earnings",
        "long_term_debt",
        "short_term_debt",
        "operating_cashflow",
        "investing_cashflow",
        "financing_cashflow",
        "capex",
        "stock_repurchase",
        "dividends_paid"
      ],
      "properties": {
        "ticker": {
          "type": "string"
        },
        "entity_name": {
          "type": "string"
        },
        "fiscal_year": {
          "type": "number"
        },
        "fiscal_period": {
          "type": "string"
        },
        "period_end": {
          "type": "string"
        },
        "filed_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "revenue": {
          "type": [
            "number",
            "null"
          ]
        },
        "cost_of_revenue": {
          "type": [
            "number",
            "null"
          ]
        },
        "gross_profit": {
          "type": [
            "number",
            "null"
          ]
        },
        "operating_expenses": {
          "type": [
            "number",
            "null"
          ]
        },
        "sg_and_a": {
          "type": [
            "number",
            "null"
          ]
        },
        "r_and_d": {
          "type": [
            "number",
            "null"
          ]
        },
        "operating_income": {
          "type": [
            "number",
            "null"
          ]
        },
        "income_before_tax": {
          "type": [
            "number",
            "null"
          ]
        },
        "net_income": {
          "type": [
            "number",
            "null"
          ]
        },
        "eps_basic": {
          "type": [
            "number",
            "null"
          ],
          "description": "Basic EPS, USD per share, as filed. Per-share values are never derived by subtraction: a Q4 value is null unless the 10-K reports a three-month figure."
        },
        "eps_diluted": {
          "type": [
            "number",
            "null"
          ],
          "description": "Diluted EPS, USD per share, as filed. Per-share values are never derived by subtraction: a Q4 value is null unless the 10-K reports a three-month figure."
        },
        "depreciation_amortization": {
          "type": [
            "number",
            "null"
          ]
        },
        "total_assets": {
          "type": [
            "number",
            "null"
          ],
          "description": "`us-gaap:Assets` at `period_end`, USD."
        },
        "current_assets": {
          "type": [
            "number",
            "null"
          ]
        },
        "cash_and_equivalents": {
          "type": [
            "number",
            "null"
          ],
          "description": "`us-gaap:CashAndCashEquivalentsAtCarryingValue` at `period_end`, USD. Excludes short-term investments (MSFT 2026-06-30: 20,935,000,000 here vs 76,843,000,000 `CashCashEquivalentsAndShortTermInvestments`)."
        },
        "accounts_receivable": {
          "type": [
            "number",
            "null"
          ]
        },
        "inventory": {
          "type": [
            "number",
            "null"
          ]
        },
        "ppe_net": {
          "type": [
            "number",
            "null"
          ]
        },
        "total_liabilities": {
          "type": [
            "number",
            "null"
          ],
          "description": "`us-gaap:Liabilities` at `period_end`, USD; null when the filer does not tag the total."
        },
        "current_liabilities": {
          "type": [
            "number",
            "null"
          ]
        },
        "noncurrent_liabilities": {
          "type": [
            "number",
            "null"
          ]
        },
        "accounts_payable": {
          "type": [
            "number",
            "null"
          ]
        },
        "stockholders_equity": {
          "type": [
            "number",
            "null"
          ]
        },
        "retained_earnings": {
          "type": [
            "number",
            "null"
          ]
        },
        "long_term_debt": {
          "type": [
            "number",
            "null"
          ],
          "description": "`us-gaap:LongTermDebt` at `period_end`, USD: total long-term debt INCLUDING the current portion, not the balance-sheet noncurrent line (MSFT 2026-06-30: 40,294,000,000 here vs 31,067,000,000 `LongTermDebtNoncurrent`). A filer that does not tag `LongTermDebt` falls back to `LongTermDebtNoncurrent`. The v1 field name is frozen."
        },
        "short_term_debt": {
          "type": [
            "number",
            "null"
          ],
          "description": "Short-term debt at `period_end`, USD, from `us-gaap:ShortTermBorrowings`, `DebtCurrent`, `CommercialPaper` or `NotesPayableCurrent`. `DebtCurrent` can include the current portion of long-term debt that `long_term_debt` already counts."
        },
        "operating_cashflow": {
          "type": [
            "number",
            "null"
          ],
          "description": "`us-gaap:NetCashProvidedByUsedInOperatingActivities`, USD, signed."
        },
        "investing_cashflow": {
          "type": [
            "number",
            "null"
          ],
          "description": "`us-gaap:NetCashProvidedByUsedInInvestingActivities`, USD, signed: negative means net cash used."
        },
        "financing_cashflow": {
          "type": [
            "number",
            "null"
          ],
          "description": "`us-gaap:NetCashProvidedByUsedInFinancingActivities`, USD, signed: negative means net cash used (buybacks and dividends are part of it)."
        },
        "capex": {
          "type": [
            "number",
            "null"
          ],
          "description": "Capital expenditure: `us-gaap:PaymentsToAcquirePropertyPlantAndEquipment`. Normally a positive cash payment (USD); negative values are passed through as filed or derived. Free cash flow = `operating_cashflow` - `capex` only when both are non-null and `capex` >= 0; ko.io leaves it null otherwise (MCP `free_cash_flow`, the website)."
        },
        "stock_repurchase": {
          "type": [
            "number",
            "null"
          ],
          "description": "Buybacks: `us-gaap:PaymentsForRepurchaseOfCommonStock`, cash paid in the period (settled payments, not the amount authorized). Normally a positive cash payment (USD); negative values are passed through as filed or derived."
        },
        "dividends_paid": {
          "type": [
            "number",
            "null"
          ],
          "description": "Dividends paid: `us-gaap:PaymentsOfDividends` or `PaymentsOfDividendsCommonStock`. Normally a positive cash payment (USD); negative values are passed through as filed or derived."
        }
      },
      "additionalProperties": false
    }
  }
}