# SEC EDGAR 10-K / 10-Q Financials & XBRL Scraper API (`autotroph/sec-edgar-xbrl-normalizer`) Actor

Scrape accounting-verified US-GAAP financials (Revenue, Operating Income, Net Income, EPS, Cash, Debt, OCF, CapEx, FCF, derived Q4 & TTM) from SEC EDGAR 10-K/10-Q filings by ticker or CIK. Solves ASC 606 shifts & duplicate amendments. MCP-ready.

- **URL**: https://apify.com/autotroph/sec-edgar-xbrl-normalizer.md
- **Developed by:** [Shuma Fujino](https://apify.com/autotroph) (community)
- **Categories:** Business, Developer tools, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 normalized sec company financials

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## SEC EDGAR XBRL Financial Normalizer (US-GAAP Annual, Quarterly + Derived Q4 & TTM)

Extract clean, deduplicated, **accounting-verified US-GAAP financial statements** directly from **official, zero-proxy SEC EDGAR JSON APIs** (`data.sec.gov/api/xbrl/companyfacts` & `data.sec.gov/submissions`) — built for quant pipelines, equity research, fintech apps, and **AI Agents via Apify MCP**.

### Why This Actor Beats Naive XBRL & HTML Scrapers

| Capability | Naive Single-Tag XBRL Scripts / HTML Scrapers | SEC EDGAR XBRL Financial Normalizer |
|---|---|---|
| **Data Source & Cost** | Scrapes HTML tables or brittle third-party finance sites (rate-limited, proxy fees, broken CSS) | Uses **official zero-proxy SEC EDGAR JSON APIs** with SEC Fair-Access compliance & polite pacing |
| **ASC 606 & Multi-Concept Waterfalls** | Hardcodes `us-gaap:Revenues` (returns stale 2010–2018 values for AAPL/MSFT and `null` for AMZN) | Deterministic per-period US-GAAP waterfalls across Revenue, Operating Income, CapEx (`PP&E` vs `ProductiveAssets`), Cash, and Total Debt |
| **Amendment & Comparative Deduplication** | Duplicates comparative prior-year rows from later 10-Ks (`0.0%` YoY growth bugs) | Deduplicates `(start, end)` frames, preferring latest `filed` date and `/A` amendments |
| **YTD vs. Standalone 3M Isolation** | Mixes 6-month (`181d`) & 9-month (`272d`) YTD numbers into quarterly series | Strict duration isolation (`70–110d` 3M vs `160–200d` 6M vs `250–295d` 9M vs `320–400d` FY) |
| **Derived Q4 & Cash-Flow Un-Cumulation** | Missing Q4 entirely (10-K only reports FY) and cumulative Cash Flows in 10-Q | Deterministically derives standalone **Q4 = FY − 9M YTD** (plus standalone quarterly OCF/CapEx/FCF & TTM) |
| **Accounting Integrity Verification** | Silent scale/unit mismatches and stale balance-sheet tags | Built-in per-company accounting assertions (`integrity_valid`, `integrity_errors`) verifying EPS×Shares, `FCF = OCF − CapEx`, and `Q1+Q2+Q3+Q4 ≈ FY` — **100% pass across 10 diverse S\&P 500 sectors** |
| **AI Agent / MCP Ready** | Raw SEC `companyfacts` JSON files are 5–25 MB per company (overflow LLM context windows) | Compact, flat, typed JSON with `concept_provenance` ready for Claude, Cursor, and Apify MCP |

### Verified Output Schema Example (`AAPL`)

```json
{
  "ticker": "AAPL",
  "cik": "0000320193",
  "entity_name": "Apple Inc.",
  "sic": "3571",
  "sic_description": "Electronic Computers",
  "fiscal_year_end_mmdd": "0925",
  "latest_fiscal_year": 2026,
  "latest_10k_end_date": "2026-09-26",
  "latest_10k_filed_date": "2026-11-03",
  "revenue_usd": 478834000000.0,
  "operating_income_usd": 158063000000.0,
  "net_income_usd": 132175000000.0,
  "diluted_eps_usd": 8.98,
  "cash_and_equivalents_usd": 36305000000.0,
  "total_debt_usd": 80111000000.0,
  "net_debt_usd": 43806000000.0,
  "operating_cash_flow_usd": 145097000000.0,
  "capex_usd": 9041000000.0,
  "free_cash_flow_usd": 136056000000.0,
  "shares_outstanding": 14720306000.0,
  "revenue_yoy_pct": 15.06,
  "operating_margin_pct": 33.01,
  "net_margin_pct": 27.6,
  "fcf_margin_pct": 28.41,
  "derived_q4_revenue_usd": 114477000000.0,
  "ttm_revenue_usd": 478834000000.0,
  "concept_provenance": {
    "revenue": "RevenueFromContractWithCustomerExcludingAssessedTax",
    "operating_income": "OperatingIncomeLoss",
    "net_income": "NetIncomeLoss",
    "diluted_eps": "EarningsPerShareDiluted",
    "cash": "CashAndCashEquivalentsAtCarryingValue",
    "total_debt": "LongTermDebt+CommercialPaper",
    "operating_cash_flow": "NetCashProvidedByUsedInOperatingActivities",
    "capex": "PaymentsToAcquirePropertyPlantAndEquipment",
    "shares": "WeightedAverageNumberOfDilutedSharesOutstanding"
  },
  "edgar_url": "https://www.sec.gov/edgar/browse/?CIK=0000320193",
  "integrity_valid": true,
  "integrity_errors": []
}
```

### Input Configuration

- **`tickers`**: Array of US stock tickers (e.g., `["AAPL", "MSFT", "NVDA", "JPM", "BRK-B"]`).
- **`ciks`**: Optional array of raw or 10-digit SEC CIKs (merged with `tickers`).
- **`years`**: Number of deduplicated annual 10-K periods (default `5`, max `15`).
- **`quarters`**: Number of standalone 3M quarters including derived Q4 (default `8`, max `40`).
- **`strictValidation`**: When `true`, skips records failing deterministic accounting checks.
- **`userAgent`**: Optional custom SEC Fair-Access `User-Agent` header.

### Transparent Pay-Per-Event (PPE) Pricing

- **`apify-actor-start`**: `$0.005` per run start
- **`company-normalized`**: `$0.01` per normalized company (`$10.00 / 1,000 companies`, including multi-year annual history, derived Q4 quarterly history, TTM, and provenance audit)
- **Zero proxy surcharge**: Uses official SEC EDGAR public JSON endpoints only.

### Local Standalone Test (No Apify Credentials Needed)

```bash
python -m src.main --local-test --tickers AAPL,MSFT --years 5 --quarters 8
```

# Actor input Schema

## `tickers` (type: `array`):

List of US public company tickers to normalize (e.g., \['AAPL', 'MSFT', 'NVDA', 'AMZN', 'JPM', 'BRK-B']).

## `ciks` (type: `array`):

Optional list of SEC CIK numbers (zero-padded or raw, e.g., \['0000320193', '789019']). Combined with tickers if both are supplied.

## `years` (type: `integer`):

Number of deduplicated full fiscal years (10-K / 20-F) to include per company (1 to 15).

## `quarters` (type: `integer`):

Number of standalone 3-month quarters (including deterministically derived Q4) to include per company (0 to 40).

## `includeAnnualHistory` (type: `boolean`):

Include the full annual_history array with per-year concept provenance.

## `includeQuarterlyHistory` (type: `boolean`):

Include the standalone 3-month quarterly_history array with derived Q4 periods.

## `strictValidation` (type: `boolean`):

When true, companies failing deterministic accounting integrity checks are logged as warnings instead of billed/pushed to dataset.

## `userAgent` (type: `string`):

Optional custom SEC Fair-Access User-Agent header in 'AppName contact@domain.com' format. Leave blank to use the built-in compliant header.

## Actor input object example

```json
{
  "tickers": [
    "AAPL",
    "MSFT"
  ],
  "ciks": [],
  "years": 5,
  "quarters": 8,
  "includeAnnualHistory": true,
  "includeQuarterlyHistory": true,
  "strictValidation": false,
  "userAgent": ""
}
```

# Actor output Schema

## `companies` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("autotroph/sec-edgar-xbrl-normalizer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("autotroph/sec-edgar-xbrl-normalizer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call autotroph/sec-edgar-xbrl-normalizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,autotroph/sec-edgar-xbrl-normalizer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gh1Q8FQx2ux20REPC/builds/Y0hWDIc6Ky0WAWCDq/openapi.json
