# SEC XBRL Financial Statements API - Revenue, EPS, Cash Flow (`zhucl1006/sec-xbrl-financial-statements`) Actor

Standardized annual and quarterly fundamentals for any US-listed company from official SEC XBRL companyfacts: revenue, net income, EPS, margins, assets, debt, cash flow, free cash flow, ROE. Ticker or CIK in, clean JSON/CSV out. No API key. For investors, quants and analysts.

- **URL**: https://apify.com/zhucl1006/sec-xbrl-financial-statements.md
- **Developed by:** [leo zhu](https://apify.com/zhucl1006) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 financial rows

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 XBRL Financial Statements API - Revenue, EPS, Cash Flow by Ticker

Get **standardized income statement, balance sheet and cash-flow data** for any US-listed company straight from the **official SEC XBRL "companyfacts" API** (data.sec.gov). Enter tickers or CIKs, choose annual or quarterly, and get one clean row per company per fiscal period - revenue, gross profit, operating income, net income, EPS, assets, liabilities, equity, cash, debt, operating cash flow, capex, free cash flow, dividends, buybacks plus ready-made margins and ratios. No API key, no scraping of HTML - 3 companies x 5 years in about 1 second.

### Who uses it

- **Investors & stock screeners**: pull 5-15 years of fundamentals for a watchlist into Google Sheets / Excel.
- **Quants & data scientists**: build factor datasets (margins, FCF, ROE, leverage) from primary-source data instead of paying for a terminal.
- **Financial analysts & consultants**: peer comparison tables in seconds.
- **Fintech & AI apps**: feed fundamentals into an LLM agent, dashboard or n8n / Make workflow via the Apify API.
- **Credit & B2B sales teams**: check a prospect's revenue size and balance-sheet health.

### Input

| Field | Description |
|---|---|
| `tickersOrCiks` | Tickers (`AAPL`) or CIK numbers (`320193`). |
| `periodType` | `annual` (10-K / 20-F) or `quarterly` (3-month periods from 10-Q). |
| `yearsBack` | 1-30 (default 5). |
| `outputMode` | `periods` (one wide row per period, standardized) or `facts` (one row per raw XBRL fact). |
| `extraConcepts` | Extra us-gaap concepts, e.g. `InterestExpense`, `InventoryNet`. |
| `allConcepts` | Facts mode: export every concept. |

```json
{ "tickersOrCiks": ["AAPL", "MSFT", "GOOGL", "AMZN", "META"], "periodType": "quarterly", "yearsBack": 3 }
```

### Output (periods mode, one row per company per fiscal period)

```json
{
  "ticker": "AAPL", "cik": "0000320193", "companyName": "Apple Inc.",
  "periodType": "annual", "fiscalYear": 2025, "fiscalPeriod": "FY",
  "periodStart": "2024-09-29", "periodEnd": "2025-09-27", "form": "10-K", "firstFiled": "2025-10-31",
  "revenue": 416161000000, "costOfRevenue": 220960000000, "grossProfit": 195201000000,
  "researchAndDevelopment": 34550000000, "operatingIncome": 133050000000, "netIncome": 112010000000,
  "epsBasic": 7.49, "epsDiluted": 7.46,
  "operatingCashFlow": 111482000000, "capitalExpenditure": 12715000000, "freeCashFlow": 98767000000,
  "dividendsPaid": 15421000000, "shareBuybacks": 90711000000,
  "totalAssets": 359241000000, "totalLiabilities": 285508000000, "stockholdersEquity": 73733000000,
  "cashAndEquivalents": 35934000000, "longTermDebt": 78328000000,
  "grossMargin": 0.4691, "operatingMargin": 0.3197, "netMargin": 0.2692,
  "returnOnEquity": 1.5191, "debtToEquity": 3.8722, "currentRatio": 0.8933,
  "sharesOutstandingLatest": 14594180000,
  "xbrlConcepts": { "revenue": "RevenueFromContractWithCustomerExcludingAssessedTax", "...": "..." }
}
```

`xbrlConcepts` shows exactly which us-gaap tag each number came from, so you can audit it. Values are in USD as reported (EPS in USD per share). Where a company restated a figure, the most recently filed value is used.

### Pricing (pay per event)

- **$0.002 per financial row saved** (`financial-row`) - e.g. 5 companies x 5 years = 25 rows = $0.05.
- Tiny start fee per run (`apify-actor-start`).
- Unknown tickers and companies without XBRL data are not charged. Set "Maximum cost per run" to cap spend.

### Notes

- Data is the official SEC EDGAR XBRL data (public domain). Requests use a declared User-Agent and stay well below SEC's 10 requests/second fair-access limit. Not affiliated with the SEC.
- Companies use different tags for the same line item; the Actor tries several standard tags per metric. A metric is `null` when the company does not report it. Banks and insurers often have no "revenue" or "gross profit" in the industrial sense.
- Quarterly mode returns the 3-month periods reported in 10-Qs (Q4 is usually only inside the annual 10-K).

### FAQ

**Do I need an API key?** No.
**Foreign companies?** Companies filing 20-F / 40-F with XBRL are supported for annual data.
**Want all filings or full-text search instead?** See our SEC EDGAR Filings Search & Monitor Actor.

# Actor input Schema

## `tickersOrCiks` (type: `array`):

US stock tickers (AAPL) or SEC CIK numbers (320193). Any company that files XBRL with the SEC.

## `periodType` (type: `string`):

Period type.

## `yearsBack` (type: `integer`):

Only periods ending within this many years. XBRL data starts around 2009.

## `outputMode` (type: `string`):

Output mode.

## `extraConcepts` (type: `array`):

Optional us-gaap concept names to add (e.g. InterestExpense, IncomeTaxExpenseBenefit, InventoryNet).

## `allConcepts` (type: `boolean`):

In facts mode, export every us-gaap concept the company reports (can be thousands of rows).

## Actor input object example

```json
{
  "tickersOrCiks": [
    "AAPL",
    "MSFT",
    "NVDA"
  ],
  "periodType": "annual",
  "yearsBack": 5,
  "outputMode": "periods",
  "allConcepts": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `runSummary` (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 = {
    "tickersOrCiks": [
        "AAPL",
        "MSFT",
        "NVDA"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhucl1006/sec-xbrl-financial-statements").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 = { "tickersOrCiks": [
        "AAPL",
        "MSFT",
        "NVDA",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("zhucl1006/sec-xbrl-financial-statements").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 '{
  "tickersOrCiks": [
    "AAPL",
    "MSFT",
    "NVDA"
  ]
}' |
apify call zhucl1006/sec-xbrl-financial-statements --silent --output-dataset

```

## MCP server setup

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

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/74FNKVfa9w71GP0ee/builds/SANzHp9GFTCA8gqKn/openapi.json
