Secedgar Compare Companies
secedgar_compare_companiesCompare 2-10 named companies across 1-8 XBRL concepts, aligned on calendar periods. This is the middle shape between secedgar_get_financials (one company, one concept, full history) and secedgar_fetch_frames (one concept, one period, every reporting company) — reach for it when the question names the companies. One companyfacts read per company, resolved through the same frame dedup and tag priority as secedgar_get_financials so the numbers agree. Balance-sheet and entity-info concepts are filed as point-in-time values and align on the calendar year (annual) or quarter (quarterly) their snapshot falls in, so they sit in the same matrix as income-statement lines. The inline matrix covers the most recent periods up to periods, trimmed further when companies x concepts x periods is too large to return in one response; the full aligned series is materialized as df_ for growth rates and spreads via secedgar_dataframe_query. A company that fails to resolve is reported in failed_companies and the comparison proceeds with the rest, and a company that does not report a concept is reported in gaps with the tags that were tried — never interpolated or zero-filled. Off-calendar filers and unit mismatches are surfaced in caveats rather than silently mixed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| periods | No | Upper bound on how many recent periods the inline matrix covers, newest first — not a guarantee. The matrix is companies x concepts x periods cells, and the inline window drops further older periods when that product is too large to return in one response. The full aligned series is always registered to the dataframe, so dropped periods stay queryable via secedgar_dataframe_query. | |
| concepts | Yes | Concepts to compare — friendly names like "revenue" or "net_income" (discover them with secedgar_search_concepts) or raw XBRL tags. | |
| taxonomy | No | XBRL taxonomy to resolve concepts under. Use ifrs-full only when every company in the list reports under IFRS; mixing IFRS and US GAAP filers in one call resolves them all under the same taxonomy. | us-gaap |
| companies | Yes | Companies to compare, as ticker symbols (preferred) or CIK numbers. A company that does not resolve is reported in failed_companies and the rest of the comparison still runs. | |
| period_type | No | Align on full calendar years (annual) or calendar quarters (quarterly). Quarterly comparisons of off-calendar filers are missing at least one calendar quarter per year — see caveats. | annual |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | The periods cap applied. | |
| gaps | No | Company-concept pairs with no data. Deliberately explicit — a missing value is never interpolated or zero-filled. | |
| cells | No | Inline matrix values, covering the periods listed in periods[]. | |
| error | No | Present when the call failed. Absent on success. | |
| shown | No | Number of periods shown inline. | |
| caveats | No | Comparability warnings: a filer missing one or two calendar quarters from the frame-tagged series, a concept whose values stop at least two full years behind the rest of that company's reporting (either an XBRL tag SEC has retired, or a current tag the filer stopped using), period ends that differ inside one aligned period, and concepts whose unit differs across companies. Company-specific warnings are prefixed with the company name. Empty when nothing needs flagging. | |
| dataset | No | Canvas dataframe holding the full aligned series across every period, not just the inline window. Columns match cells[]. Absent when canvas is unavailable. | |
| periods | No | Calendar period keys covered by the inline matrix, newest first. Shorter than the requested periods when the cell count forced the window to shrink — the enrichment trailer reports the drop. | |
| concepts | No | Concepts covered, in the order supplied. | |
| taxonomy | No | Taxonomy the concepts were resolved under, echoed from input. | |
| companies | No | Companies included in the comparison. | |
| truncated | No | True when the aligned series has more periods than the inline matrix shows. | |
| period_type | No | Period alignment used, echoed from input. | |
| failed_companies | No | Companies excluded from the matrix. The comparison proceeds with the rest rather than failing the whole call. |