# SEC EDGAR 8-K Filings Cleaner (`diamondlike_buttonhole/sec-edgar-8k-cleaner`) Actor

Fetches recent SEC EDGAR Form 8-K filings (current reports / material events) for the companies you choose and returns each filing cleaned to structured JSON — plain-text bodies, document links and one record per filing.

- **URL**: https://apify.com/diamondlike_buttonhole/sec-edgar-8k-cleaner.md
- **Developed by:** [Sharf Abutaleb](https://apify.com/diamondlike_buttonhole) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.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/actors/running/actors-in-store.md#pay-per-usage

## 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 8-K Filings Cleaner — Apify Actor

**Status: PUBLISHED 2026-11-10 — live on the Apify Store at https://apify.com/diamondlike_buttonhole/sec-edgar-8k-cleaner (account: sharfremote@outlook.com, username diamondlike_buttonhole, free plan). One Console test run succeeded 2026-11-10 (AAPL + MSFT, 10 cleaned 8-K records). NOT YET MONETIZED — $0.05/event pricing is declared in actor.json but not enforced until the user completes Apify billing details + payment method + KYC; Apify credit is not cash in hand (withdrawal minimums $20 PayPal / $100 bank, monthly).**

A pay-per-event Apify Actor that fetches recent SEC EDGAR Form 8-K filings
(current reports / material events) for the companies you list and returns
each filing cleaned to structured JSON.

### Niche chosen — and why

**SEC EDGAR Form 8-K filings, cleaned to JSON.**

- **Free source, no login, no API key, no paywall:** the EDGAR APIs
  (`data.sec.gov/submissions`, `sec.gov/files/company_tickers.json`,
  `sec.gov/Archives`) are free public endpoints. The only requirement is
  identifying yourself in the `User-Agent` header (the Actor takes a
  `contactEmail` input for exactly this) and staying under 10 requests/sec
  (the Actor sleeps 250 ms between requests).
- **Licence-clean:** US federal filings are public-domain records. The Actor
  prices the *cleaning and structuring* (HTML/XBRL stripping, item
  detection, normalised fields, stable URLs) — it does not resell raw data.
- **Real, recurring demand:** 8-Ks are the filings investors, analysts,
  journalists and researchers check first after a material event (earnings,
  leadership changes, M\&A, bankruptcies). Raw EDGAR HTML is painful to
  consume; a clean JSON record per filing is the useful product.
- **Why not the alternatives:** data.gov's catalogue is mostly metadata
  about datasets (thin per-record value); SAM.gov federal awards overlap
  the user's separate Ohio/government track and were deliberately avoided.
  8-Ks are the cleanest fit: one filing = one obvious billable event.

### What a caller gets

One JSON record per filing, pushed to the Apify dataset. Fields
(see `OUTPUT_SCHEMA.json`):

| Field | Meaning |
|---|---|
| `ticker`, `cik`, `companyName` | Who filed |
| `form` | `8-K` or `8-K/A` |
| `filingDate`, `reportDate` | When filed / report date |
| `accessionNumber` | EDGAR accession number |
| `primaryDocument`, `primaryDocumentUrl` | Filing document + direct SEC URL |
| `fileSizeBytes` | Document size, if reported |
| `items` | 8-K item numbers detected, e.g. `["2.02", "9.01"]` |
| `bodyText`, `bodyChars`, `bodyTruncated`, `bodyError` | Cleaned plain-text body (HTML/XBRL stripped, truncated to `maxBodyChars`), or the error if the download failed |
| `source`, `fetchedAt` | Provenance + timestamp |

Set `includeBodyText: false` for metadata + URLs only (faster, lighter).

### Sample input

`example_input.json`:

```json
{
  "contactEmail": "you@example.com",
  "tickers": ["AAPL", "MSFT"],
  "formTypes": ["8-K"],
  "maxFilingsPerCompany": 2,
  "includeBodyText": true,
  "maxBodyChars": 20000
}
```

You can use `tickers` OR `ciks` (e.g. `"ciks": [320193]`) or both.
Max 20 companies per run, max 20 filings per company. Optional
`startDate` / `endDate` (`YYYY-MM-DD`) filter by filing date.

### Sample output

`example_output.json` — two records (Apple + Microsoft), one per 8-K.
Abbreviated first record:

```json
{
  "ticker": "AAPL",
  "cik": "0000320193",
  "companyName": "Apple Inc.",
  "form": "8-K",
  "filingDate": "2024-11-01",
  "reportDate": "2024-10-31",
  "accessionNumber": "0000320193-24-000123",
  "primaryDocument": "aapl-20240928.htm",
  "primaryDocumentUrl": "https://www.sec.gov/Archives/edgar/data/320193/000032019324000123/aapl-20240928.htm",
  "items": ["2.02", "9.01"],
  "bodyText": "UNITED STATES SECURITIES AND EXCHANGE COMMISSION ... Item 2.02 Results of Operations and Financial Condition. ...",
  "bodyChars": 612,
  "bodyTruncated": false,
  "bodyError": null,
  "source": "SEC EDGAR (data.sec.gov / sec.gov Archives) — US public-domain filings",
  "fetchedAt": "2026-11-05T06:00:00.000Z"
}
```

**Honesty note on the example:** the *structure, field names, CIKs,
company names and item numbers* match real EDGAR records; the accession
numbers, document filenames and body excerpts in `example_output.json`
are illustrative sample values, not a claim about a specific live filing.
Real runs fetch live data from EDGAR, so real output is always genuine.

### Pricing — pay per event

- **$0.05 per cleaned 8-K filing record** (one filing = one event).
  Priced at the top of the $0.01–$0.05 range because each event includes a
  document download + HTML/XBRL cleaning, not just a metadata lookup.
- Runs returning zero filings cost $0.
- Developer receives 80% of event revenue minus Apify compute costs
  (per Apify Store pay-per-event terms); payout minimums are $20 via
  PayPal / $100 via bank transfer (per the brief — confirm live in the
  Store terms at publish time).

#### Honest $1,000 math — do NOT expect $1,000 from this overnight

| Target | Events needed at $0.05 gross | Developer share (80%, before compute) |
|---|---|---|
| $1 credited | 25 events | $0.80 |
| $20 PayPal payout minimum | 500 events | $16.00 |
| $100 bank payout minimum | 2,500 events | $80.00 |
| **$1,000 gross** | **20,000 paid events** | $800.00 |
| $1,000 to the developer (80%) | 25,000 paid events | $1,000.00 |

$1,000 would need **25,000 paid events** at $0.05 — i.e. thousands of
paying users/runs, Store discovery, reviews and time. This Actor is a
**conditional test of the Apify route** (does a real, working, Store-ready
Actor exist and can it earn its first paid events?), not a plausible
overnight $1,000. No revenue is expected tonight; the first realistic
milestone is a first paid event / first $20 PayPal payout, after
publication, Store review and discovery — all of which are still ahead.

### Run locally

```bash
node --check main.js          # syntax check
npm test                       # exercises cleanBodyText, detectItems, padCik, validateInput (no network)
node main.js                   # runs with example_input.json, writes output.json (needs network to EDGAR)
```

No dependencies, no credentials, no API keys. Node ≥ 18 (native `fetch`).
On Apify, `@apify/sdk` is used if installed (`Actor.getInput()` /
`Actor.pushData()`); without it the Actor falls back to `INPUT.json` /
`APIFY_INPUT` env / `example_input.json` and writes `output.json`.

### Files

| File | Purpose |
|---|---|
| `actor.json` | Actor metadata, input schema, pay-per-event pricing ($0.05/event) |
| `main.js` | Actor code — fetch, validate, clean, push |
| `INPUT_SCHEMA.json` | Input schema (same as in `actor.json`) |
| `OUTPUT_SCHEMA.json` | Output record schema (one record per filing) |
| `example_input.json` | Sample input (AAPL + MSFT, 2 filings each) |
| `example_output.json` | Sample output (2 records, real-shaped) |
| `package.json` | Metadata + `npm test` / `npm start` |
| `Dockerfile` | Apify build (`apify/actor-node:20`) |
| `STORE_LISTING.md` | Store listing draft (text only) |

### Live verification — DONE 2026-11-09 (after explicit user go-ahead for the test)

End-to-end run against live EDGAR completed 2026-11-09 ~09:46 CST
(`node main.js` with `INPUT.json`: AAPL + MSFT, 2 filings each,
contactEmail sharfremote@outlook.com). Result: **4 real 8-K records in
`output.json`** — Apple 8-K filed 2026-11-02 (items 2.02, 9.01, accession
0000320193-26-000024), Apple 8-K filed 2026-07-30 (2.02, 9.01), Microsoft
8-K filed 2026-11-05 (item 5.02), Microsoft 8-K filed 2026-11-04 (items
8.01, 9.01). All bodies are cleaned plain text (2,652–8,401 chars),
no HTML left, no body errors, no truncation. One accession was
independently re-confirmed against a fresh `data.sec.gov` submissions
fetch (0000320193-26-000024 = Apple 8-K, filed 2026-11-02). `node --check`
and `npm test` pass. All JSON files parse.

Not verified locally: the Docker image build (`docker` is not installed
in this VM — Apify builds `Dockerfile` in its cloud at publish time;
the Actor has zero npm dependencies, so build risk is low). Not done:
publication — needs the user's Apify account in their real name + KYC +
payout (see `PUBLICATION_CHECKLIST.md`).

# Actor input Schema

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

SEC CIK numbers (with or without leading zeros), e.g. \[320193]. Use tickers OR ciks (or both). Max 20 companies per run.

## `contactEmail` (type: `string`):

SEC EDGAR's fair-access rules ask API users to identify themselves in the User-Agent header. Provide a contact email, e.g. you@example.com. Required.

## `endDate` (type: `string`):

Only include filings on or before this date. Leave blank for no upper bound.

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

Filing forms to include. Default is 8-K only. 8-K/A (amendments) is the only other supported value.

## `includeBodyText` (type: `boolean`):

If true, downloads each filing's primary document and returns plain-text body (truncated to maxBodyChars). If false, returns metadata + document URL only (faster, cheaper).

## `maxBodyChars` (type: `integer`):

Truncation limit for the cleaned body text per filing.

## `maxFilingsPerCompany` (type: `integer`):

How many of the most recent matching 8-K filings to return per company.

## `startDate` (type: `string`):

Only include filings on or after this date. Leave blank for no lower bound.

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

Stock tickers to fetch 8-K filings for, e.g. \["AAPL", "MSFT"]. Use tickers OR ciks (or both). Max 20 companies per run.

## Actor input object example

```json
{
  "formTypes": [
    "8-K"
  ],
  "includeBodyText": true,
  "maxBodyChars": 20000,
  "maxFilingsPerCompany": 5,
  "tickers": [
    "AAPL"
  ]
}
```

# Actor output Schema

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

One JSON record per cleaned 8-K filing, stored in the default dataset.

# 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("diamondlike_buttonhole/sec-edgar-8k-cleaner").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("diamondlike_buttonhole/sec-edgar-8k-cleaner").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 diamondlike_buttonhole/sec-edgar-8k-cleaner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,diamondlike_buttonhole/sec-edgar-8k-cleaner"
        }
    }
}
```

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/ApHKwAezEgd2F6Ksf/builds/8ubA5r96RJoNIdl4I/openapi.json
