# SEC Company Facts Extractor (`prophed/sec-company-facts-extractor`) Actor

Extract normalized XBRL company facts from the official SEC EDGAR Company Facts API.

- **URL**: https://apify.com/prophed/sec-company-facts-extractor.md
- **Developed by:** [Prophed Com](https://apify.com/prophed) (community)
- **Categories:** Business, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 dataset items

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## SEC Company Facts Extractor

Extract normalized XBRL company facts from the official SEC EDGAR Company Facts API. This Actor turns large nested SEC JSON payloads into row-level Apify datasets that are easier to query, export, schedule, and feed into dashboards or data pipelines.

### Use cases

- Pull financial facts for public companies by CIK.
- Extract common facts such as assets, liabilities, revenue, net income, and shares outstanding.
- Schedule recurring snapshots for watchlists of public companies.
- Export SEC Company Facts into CSV, JSON, Excel, webhooks, warehouses, or downstream automation.

### Input

```json
{
  "ciks": ["0000320193", "0000789019"],
  "taxonomies": ["us-gaap", "dei"],
  "concepts": ["Assets", "Liabilities", "Revenues", "NetIncomeLoss"],
  "forms": ["10-K", "10-Q"],
  "latestOnly": false,
  "maxFactsPerCompany": 250,
  "maxItems": 1000,
  "userAgent": "your-product-name/1.0 contact@example.com"
}
```

SEC asks API users to send a descriptive User-Agent with contact information. The Actor exposes this as an input field so users can identify their own usage.

### Output

Each dataset row is one reported fact:

```json
{
  "source": "sec-companyfacts",
  "cik": "0000320193",
  "entityName": "Apple Inc.",
  "taxonomy": "us-gaap",
  "concept": "Assets",
  "label": "Assets",
  "unit": "USD",
  "value": 352755000000,
  "fy": 2023,
  "fp": "FY",
  "form": "10-K",
  "filed": "2023-11-03",
  "end": "2023-09-30"
}
```

If a CIK request fails, the Actor writes a structured error row with the CIK, source URL, HTTP status, and error message, then continues with the next CIK.

### Notes

This Actor uses public SEC EDGAR endpoints. It is a data extraction and normalization tool, not financial advice. Users are responsible for SEC API usage compliance and for validating any downstream interpretation of financial data.

# Actor input Schema

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

SEC CIKs. Values may include or omit leading zeroes.

## `taxonomies` (type: `array`):

Fact taxonomies to include.

## `concepts` (type: `array`):

Optional concept filter. Leave empty to include all concepts from selected taxonomies.

## `forms` (type: `array`):

Optional SEC form filter.

## `latestOnly` (type: `boolean`):

Keep only the latest fact for each CIK, taxonomy, concept, and unit.

## `maxFactsPerCompany` (type: `integer`):

Maximum normalized fact rows per CIK.

## `maxItems` (type: `integer`):

Hard cap for dataset rows.

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

SEC requires a descriptive User-Agent with contact information.

## `timeoutSecs` (type: `integer`):

Per-request timeout.

## Actor input object example

```json
{
  "ciks": [
    "0000320193",
    "0000789019"
  ],
  "taxonomies": [
    "us-gaap",
    "dei"
  ],
  "concepts": [
    "Assets",
    "Liabilities",
    "Revenues",
    "NetIncomeLoss",
    "EntityCommonStockSharesOutstanding"
  ],
  "forms": [
    "10-K",
    "10-Q"
  ],
  "latestOnly": false,
  "maxFactsPerCompany": 250,
  "maxItems": 1000,
  "userAgent": "prophed-open-data-actor/0.1 support@prophed.com",
  "timeoutSecs": 30
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "ciks": [
        "0000320193",
        "0000789019"
    ],
    "taxonomies": [
        "us-gaap",
        "dei"
    ],
    "concepts": [
        "Assets",
        "Liabilities",
        "Revenues",
        "NetIncomeLoss",
        "EntityCommonStockSharesOutstanding"
    ],
    "forms": [
        "10-K",
        "10-Q"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("prophed/sec-company-facts-extractor").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 = {
    "ciks": [
        "0000320193",
        "0000789019",
    ],
    "taxonomies": [
        "us-gaap",
        "dei",
    ],
    "concepts": [
        "Assets",
        "Liabilities",
        "Revenues",
        "NetIncomeLoss",
        "EntityCommonStockSharesOutstanding",
    ],
    "forms": [
        "10-K",
        "10-Q",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("prophed/sec-company-facts-extractor").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "ciks": [
    "0000320193",
    "0000789019"
  ],
  "taxonomies": [
    "us-gaap",
    "dei"
  ],
  "concepts": [
    "Assets",
    "Liabilities",
    "Revenues",
    "NetIncomeLoss",
    "EntityCommonStockSharesOutstanding"
  ],
  "forms": [
    "10-K",
    "10-Q"
  ]
}' |
apify call prophed/sec-company-facts-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=prophed/sec-company-facts-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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