# 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

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SEC Company Facts Extractor",
        "description": "Extract normalized XBRL company facts from the official SEC EDGAR Company Facts API.",
        "version": "0.1",
        "x-build-id": "T7zDUXjFUrq6yRCx5"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/prophed~sec-company-facts-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-prophed-sec-company-facts-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/prophed~sec-company-facts-extractor/runs": {
            "post": {
                "operationId": "runs-sync-prophed-sec-company-facts-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/prophed~sec-company-facts-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-prophed-sec-company-facts-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "ciks"
                ],
                "properties": {
                    "ciks": {
                        "title": "CIKs",
                        "type": "array",
                        "description": "SEC CIKs. Values may include or omit leading zeroes."
                    },
                    "taxonomies": {
                        "title": "Taxonomies",
                        "type": "array",
                        "description": "Fact taxonomies to include."
                    },
                    "concepts": {
                        "title": "Concepts",
                        "type": "array",
                        "description": "Optional concept filter. Leave empty to include all concepts from selected taxonomies."
                    },
                    "forms": {
                        "title": "Forms",
                        "type": "array",
                        "description": "Optional SEC form filter."
                    },
                    "latestOnly": {
                        "title": "Latest only",
                        "type": "boolean",
                        "description": "Keep only the latest fact for each CIK, taxonomy, concept, and unit.",
                        "default": false
                    },
                    "maxFactsPerCompany": {
                        "title": "Max facts per company",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum normalized fact rows per CIK.",
                        "default": 250
                    },
                    "maxItems": {
                        "title": "Max items",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Hard cap for dataset rows.",
                        "default": 1000
                    },
                    "userAgent": {
                        "title": "SEC User-Agent",
                        "type": "string",
                        "description": "SEC requires a descriptive User-Agent with contact information.",
                        "default": "prophed-open-data-actor/0.1 support@prophed.com"
                    },
                    "timeoutSecs": {
                        "title": "Request timeout seconds",
                        "minimum": 5,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Per-request timeout.",
                        "default": 30
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
