# SEC EDGAR Scraper for RAG: 10-K/10-Q/8-K as JSON (`devanshlive/sec-edgar-rag-extractor`) Actor

Extract SEC EDGAR filings (10-K, 10-Q, 8-K). Fixed-token text chunks of primary documents for finance LLMs and compliance RAG. Drop-in for LlamaIndex, LangChain. Skip manual XBRL parsing. $0.03/filing.

- **URL**: https://apify.com/devanshlive/sec-edgar-rag-extractor.md
- **Developed by:** [Devansh Tiwari](https://apify.com/devanshlive) (community)
- **Categories:** AI, Developer tools, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 extracted sec filings

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 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 EDGAR Scraper for RAG: 10-K/10-Q/8-K as JSON

**Extract SEC EDGAR filings into RAG-ready text chunks for finance and compliance LLMs.** Get 10-K annual reports, 10-Q quarterly reports, and 8-K material events pre-chunked as JSON. Drop-in ready for LlamaIndex, LangChain, Pinecone, and Qdrant. Built for AI training data teams, buy-side research assistants, and M&A intelligence platforms. Skip manual HTML/XBRL parsing and messy SEC entity decoding.

### What does SEC EDGAR RAG Extractor do?

This Actor fetches corporate filings directly from the SEC EDGAR database. It pulls the HTML primary document, strips out the noise (like `<ix:header>` metadata and tables styling), extracts the plain text, and slices it into fixed-token chunks with overlap. You get clean, LLM-ready JSON arrays representing the core text of the filing.

Try it with Apple's CIK `0000320193` or search for "artificial intelligence risk factors". Runs reliably on the Apify platform with built-in SEC rate limiting.

### Why use SEC EDGAR RAG Extractor?

- **Finance AI:** Train models on clean corporate disclosures without writing custom HTML parsers.
- **Compliance RAG:** Build chatbots that cite specific regulatory filings accurately.
- **M&A Research:** Feed target company 10-Ks into your intelligence pipeline.
- **Sell-side Research:** Monitor 8-K events and earnings drift automatically.

### How to use SEC EDGAR RAG Extractor

1. Set your **User-Agent**. The SEC requires a real name and email.
2. Provide a list of **CIKs** (e.g., `0000320193` for Apple) or enter a **Search Query** (e.g., "AI risks").
3. Select the **Form Types** you want (10-K, 10-Q, 8-K).
4. Set your **Date Range** and **Max Filings** cap.
5. Click "Start" and download the chunked JSON.

### Input

Provide standard SEC parameters. Here is a JSON example:

```json
{
  "cikList": ["0000320193"],
  "formTypes": ["10-K"],
  "dateFrom": "2024-01-01",
  "dateTo": "2024-12-31",
  "maxFilings": 5,
  "searchQuery": "",
  "userAgent": "Jane Smith jane@acme.com"
}
````

### Output

The Actor outputs one record per filing. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
{
  "accession_no": "0000320193-24-000123",
  "cik": "0000320193",
  "company_name": "Apple Inc.",
  "ticker": "AAPL",
  "form_type": "10-K",
  "filing_date": "2024-11-01",
  "period_of_report": "2024-09-28",
  "filing_url": "https://www.sec.gov/Archives/edgar/data/320193/000032019324000123/aapl-20240928.htm",
  "source": "full_text",
  "chunks": [
    {
      "idx": 0,
      "text": "Item 1. Business...",
      "tokens": 512
    }
  ]
}
```

### Data table

| Field | Type | Description |
|---|---|---|
| `accession_no` | String | Unique SEC identifier for the filing |
| `cik` | String | 10-digit Central Index Key |
| `company_name` | String | Filer name |
| `ticker` | String | Stock ticker (if available) |
| `form_type` | String | 10-K, 10-Q, or 8-K |
| `filing_date` | String | Date submitted to the SEC |
| `source` | String | Indicates extraction depth (`full_text` or `exhibits_stripped`) |
| `filing_url` | String | Link to the SEC Archives primary document |

### Pricing / Cost estimation

This Actor is priced at **$0.03 per filing**.
How much does it cost to scrape SEC EDGAR? If you pull 1000 Apple 10-Ks and 10-Qs, the run will cost exactly $30.00. You only pay for successful extractions.

### User-Agent warning

**The SEC strictly requires a valid User-Agent header containing your name and email.** The default placeholder will be rejected with a 403 Forbidden error, crashing the run. Please override the `userAgent` input field with your real contact information before starting.

### Tips / Advanced options

- **Narrow via search:** Use the full-text search query field to build a highly targeted RAG corpus instead of pulling every filing for a CIK.
- **Filing sizes:** 10-K annual reports are very long. Expect 20 to 50 text chunks (512 tokens each) per filing.
- **Rate limiting:** The Actor automatically paces requests at the SEC ceiling of 10 requests per second for maximum throughput without IP bans.

### Legal disclaimer and limitations

SEC EDGAR data is public domain. Please respect the SEC fair-access policy.
Limitations:

- v1 supports 10-K, 10-Q, and 8-K bodies only. No 13F, S-1, or DEF 14A.
- v1 does not parse inline XBRL tables for numerical extraction.
- Text-format exhibits are concatenated into the main body text; binary exhibits are skipped.

### FAQ

**Why do I need a User-Agent?**
The SEC blocks automated traffic that doesn't identify itself. A valid name and email allow them to contact you if your traffic causes issues.

**Why are some filings marked `source: exhibits_stripped`?**
If a filing contains complex or binary attachments that fail to parse cleanly, the Actor falls back to extracting just the primary document body to ensure you still get data.

**Can I get 13F filings? S-1? DEF 14A?**
Not in v1. We focused on the core financial disclosures first.

### Support

Found a bug or need a feature? Open an issue on our [GitHub repository](https://github.com/actorstack).

# Actor input Schema

## `cikList` (type: `array`):

List of SEC CIK numbers (zero-padded 10 digits, e.g. '0000320193' for Apple). Empty = all filers that match formTypes + date range.

## `formTypes` (type: `array`):

SEC filing types to include.

## `dateFrom` (type: `string`):

Inclusive lower bound of filing\_date.

## `dateTo` (type: `string`):

Inclusive upper bound of filing\_date.

## `maxFilings` (type: `integer`):

Hard cap on returned filings. At 10 req/s and ~20 requests per filing, expect ~3-5 filings/minute.

## `searchQuery` (type: `string`):

EDGAR full-text search. Narrows to filings matching this term in body text. Empty = no keyword filter.

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

SEC requires User-Agent with name and contact email. Format: 'Your Name your@email.com'. Default is generic; please override.

## Actor input object example

```json
{
  "cikList": [
    "0000320193"
  ],
  "formTypes": [
    "10-K"
  ],
  "dateFrom": "2024-01-01",
  "dateTo": "2024-12-31",
  "maxFilings": 50,
  "searchQuery": "",
  "userAgent": "your-name your@email.com"
}
```

# Actor output Schema

## `dataset` (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 = {
    "cikList": [
        "0000320193"
    ],
    "formTypes": [
        "10-K"
    ],
    "dateFrom": "2024-01-01",
    "dateTo": "2024-12-31",
    "maxFilings": 50,
    "searchQuery": "",
    "userAgent": "your-name your@email.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("devanshlive/sec-edgar-rag-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 = {
    "cikList": ["0000320193"],
    "formTypes": ["10-K"],
    "dateFrom": "2024-01-01",
    "dateTo": "2024-12-31",
    "maxFilings": 50,
    "searchQuery": "",
    "userAgent": "your-name your@email.com",
}

# Run the Actor and wait for it to finish
run = client.actor("devanshlive/sec-edgar-rag-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 '{
  "cikList": [
    "0000320193"
  ],
  "formTypes": [
    "10-K"
  ],
  "dateFrom": "2024-01-01",
  "dateTo": "2024-12-31",
  "maxFilings": 50,
  "searchQuery": "",
  "userAgent": "your-name your@email.com"
}' |
apify call devanshlive/sec-edgar-rag-extractor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SEC EDGAR Scraper for RAG: 10-K/10-Q/8-K as JSON",
        "description": "Extract SEC EDGAR filings (10-K, 10-Q, 8-K). Fixed-token text chunks of primary documents for finance LLMs and compliance RAG. Drop-in for LlamaIndex, LangChain. Skip manual XBRL parsing. $0.03/filing.",
        "version": "0.1",
        "x-build-id": "7naYrWk5M8Wlr0pFl"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/devanshlive~sec-edgar-rag-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-devanshlive-sec-edgar-rag-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/devanshlive~sec-edgar-rag-extractor/runs": {
            "post": {
                "operationId": "runs-sync-devanshlive-sec-edgar-rag-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/devanshlive~sec-edgar-rag-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-devanshlive-sec-edgar-rag-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": [
                    "dateFrom",
                    "dateTo"
                ],
                "properties": {
                    "cikList": {
                        "title": "CIK list",
                        "type": "array",
                        "description": "List of SEC CIK numbers (zero-padded 10 digits, e.g. '0000320193' for Apple). Empty = all filers that match formTypes + date range.",
                        "items": {
                            "type": "string",
                            "pattern": "^[0-9]{10}$"
                        },
                        "default": []
                    },
                    "formTypes": {
                        "title": "Form types",
                        "type": "array",
                        "description": "SEC filing types to include.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "10-K",
                                "10-Q",
                                "8-K"
                            ]
                        },
                        "default": [
                            "10-K"
                        ]
                    },
                    "dateFrom": {
                        "title": "From date (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Inclusive lower bound of filing_date.",
                        "default": "2024-01-01"
                    },
                    "dateTo": {
                        "title": "To date (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Inclusive upper bound of filing_date.",
                        "default": "2024-12-31"
                    },
                    "maxFilings": {
                        "title": "Max filings per run",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Hard cap on returned filings. At 10 req/s and ~20 requests per filing, expect ~3-5 filings/minute.",
                        "default": 50
                    },
                    "searchQuery": {
                        "title": "Full-text search query (optional)",
                        "type": "string",
                        "description": "EDGAR full-text search. Narrows to filings matching this term in body text. Empty = no keyword filter.",
                        "default": ""
                    },
                    "userAgent": {
                        "title": "User-Agent (required by SEC)",
                        "type": "string",
                        "description": "SEC requires User-Agent with name and contact email. Format: 'Your Name your@email.com'. Default is generic; please override.",
                        "default": "actorstack-edgar-extractor contact@example.com"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
