---
title: "Cross-period side-by-side of two fiscal years for the same entity"
method: GET
path: "/api/v1/entities/{entity_id}/compare-filings"
tags: ["Entities"]
---

# Cross-period side-by-side of two fiscal years for the same entity

`GET /api/v1/entities/{entity_id}/compare-filings`

## Request

- Base URL: `https://api.hub-equity.com`
- URL: `https://api.hub-equity.com/api/v1/entities/{entity_id}/compare-filings`
- Auth: HTTP bearer

Compares two FISCAL YEARS of the SAME entity side-by-side ("what changed at Apple between FY23 and FY24?"). Returns a per-concept matrix with deltas and the semantic-change flags `is_new_in_b` / `is_removed_in_b` / `is_sign_flip` / `has_restatement_warning`.

It compares two **years as served**, not two filings as filed: each cell is the value served for that year, whichever filing published it. The `filing_a` / `filing_b` references identify the year, they do not restrict the figures to those documents.

Query params :
- `fiscal_year_a` / `fiscal_year_b` (required) — auto-swapped so `a` is the older year.
- `hub_concept_codes` (repeatable) — restrict the matrix to these hubs (up to 50). Omit for the 25 curated primary hubs.
- `form_type` (default: the most recent original annual filing) and `fiscal_period_type` (default `FY`).

DIFFERENT from `POST /compare` (cross-entity, one year) and `/restatements/diff` (10-K vs 10-K/A).

## Path parameters

- `entity_id` string, required

## Query parameters

- `fiscal_year_a` integer, required: First fiscal year (older).
- `fiscal_year_b` integer, required: Second fiscal year (newer).
- `hub_concept_codes` string[], nullable: Repeatable. Restrict to these hub concept codes (up to 50). Omit for the 25 curated primary hubs.
- `form_type` string, nullable: Form of the reference filing of each year (10-K, 20-F, 40-F, annual_report for ESEF, or an amendment such as 10-K/A). Omit for the most recent original annual filing of each year.
- `fiscal_period_type` string: FY (default, annual), Q1-Q4, or H1/H2.

## Response `200`

The cross-period comparison matrix.

- ApiResponseCompareFilingsResult
  - `success` boolean, required
  - `data` CompareFilingsResult
    - `entity_id` string, required
    - `entity_name` string, required
    - `fiscal_period_type` string, required
    - `filing_a` FilingRef: Reference to one of the two filings being compared.
      - `filing_id` string, required
      - `fiscal_year` integer, required
      - `period_end` string, nullable
      - `form_type` string, nullable
      - `filing_date` string, nullable
      - `viewer_url` string, required: Hub-Equity deep link to the filing
      - `external_url` string, nullable
    - `filing_b` FilingRef: Reference to one of the two filings being compared.
      - `filing_id` string, required
      - `fiscal_year` integer, required
      - `period_end` string, nullable
      - `form_type` string, nullable
      - `filing_date` string, nullable
      - `viewer_url` string, required: Hub-Equity deep link to the filing
      - `external_url` string, nullable
    - `rows` CompareFilingsRow[], required
      - `hub_concept_code` string, required
      - `label` string, nullable
      - `category` string, nullable: income_statement | balance_sheet | cash_flow | ratio | equity_info | metadata
      - `value_a` number, nullable
      - `value_b` number, nullable
      - `delta_abs` number, nullable
      - `delta_pct` number, nullable: Signed pct change b vs a. None when value_a is 0/null.
      - `currency_a` string, nullable
      - `currency_b` string, nullable
      - `is_new_in_b` boolean: Concept reported in filing_b but absent from filing_a.
      - `is_removed_in_b` boolean: Concept reported in filing_a but absent from filing_b.
      - `is_sign_flip` boolean: value_a and value_b have opposite signs (P&L drift, eg. net loss → net income).
      - `has_restatement_warning` boolean: filing_b's comparative columns retroactively restate filing_a's value.
      - `restatement_source` RestatementSource: Set when filing_b retroactively restates the value reported in filing_a's comparative columns.
        - `original_value` number, nullable
        - `restated_value` number, nullable
        - `delta_percent` number, nullable
        - `classification` string, nullable: rounding | revised | restated | new_disclosure
    - `summary` CompareFilingsSummary, required
      - `concepts_appeared` integer, required
      - `concepts_disappeared` integer, required
      - `concepts_with_restatement_warning` integer, required
      - `currency_changed` boolean, required
    - `notes` string[]
  - `error` ApiError: API error details.
    - `code` string, required
    - `message` string, required
    - `details` object, nullable
  - `meta` ApiMeta: API response metadata. Pagination fields (``page`` / ``per_page`` / ``total``) are populated on collection endpoints only. They are omitted from the payload on single-resource endpoints.
    - `timestamp` string, date-time
    - `request_id` string, nullable
    - `page` integer, nullable
    - `per_page` integer, nullable
    - `total` integer, nullable
  - `links` ApiLinks: HATEOAS-style pagination cursors. Host-relative path + query links for a collection page. Present on collection endpoints, ``null`` fields where a page doesn't exist (``next`` on the last page, ``prev`` on the first). The whole ``links`` object is omitted from single-resource responses (see ``ApiResponse`` serializer).
    - `self` string, nullable
    - `first` string, nullable
    - `prev` string, nullable
    - `next` string, nullable
    - `last` string, nullable

## Other responses

- `404`: Entity not found.
- `422`: Validation Error

---

[API](https://skmtc.dev/hub-equity/apis/hub-equity-api.md) · [All operations](https://skmtc.dev/hub-equity/apis/hub-equity-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hub-equity/apis/hub-equity-api/revisions/e8eeda5dc13e?raw)
