{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC Filings Scraper",
    "description": "Build a structured dataset of SEC EDGAR filings, company profiles, and XBRL financial facts from sec.gov. Query by ticker, CIK, or company name and receive normalized records with document links, optional filing text, and monitoring alerts via the Apify Dataset API or JSON, CSV, and Excel export.",
    "version": "1.0",
    "x-build-id": "qJgdiLQFVBOVDVWXU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datascrapers~sec-filings-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datascrapers-sec-filings-intelligence",
        "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/datascrapers~sec-filings-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-datascrapers-sec-filings-intelligence",
        "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/datascrapers~sec-filings-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-datascrapers-sec-filings-intelligence",
        "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": [
          "secAccess"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "companyFilings",
              "latestFilings",
              "filingLookup",
              "companyProfile",
              "financialFacts"
            ],
            "type": "string",
            "description": "Operating mode. companyFilings: filings for selected companies. latestFilings: recent market-wide filings. filingLookup: resolve URLs or accession numbers. companyProfile: issuer metadata. financialFacts: XBRL company facts.",
            "default": "companyFilings"
          },
          "companies": {
            "title": "Companies",
            "type": "array",
            "description": "Tickers (AAPL), CIK numbers (320193 or 0000320193), or company names. Ticker and CIK matching is exact; company-name matching is conservative and may return an ambiguity error.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "formTypes": {
            "title": "Form Types",
            "type": "array",
            "description": "SEC form types to include (e.g. 10-K, 10-Q, 8-K). Leave empty or use ALL for every form. Matching is case-insensitive. Amendments use the /A suffix (10-K/A).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startDate": {
            "title": "Start Date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Include filings on or after this date (YYYY-MM-DD). Uses filing date."
          },
          "endDate": {
            "title": "End Date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Include filings on or before this date (YYYY-MM-DD). Uses filing date."
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum dataset items to return. Stop once this limit is reached.",
            "default": 100
          },
          "maxItemsPerCompany": {
            "title": "Max Items Per Company",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Optional per-company cap before the global maxItems limit. Leave empty for no per-company limit."
          },
          "includeAmendments": {
            "title": "Include Amendments",
            "type": "boolean",
            "description": "When false, exclude amended forms that end with /A (e.g. 10-K/A, 8-K/A).",
            "default": true
          },
          "latestOnly": {
            "title": "Latest Only",
            "type": "boolean",
            "description": "When true, return only the latest matching filing per company (or per company+form — see Latest Grouping).",
            "default": false
          },
          "latestGrouping": {
            "title": "Latest Grouping",
            "enum": [
              "company",
              "companyAndForm"
            ],
            "type": "string",
            "description": "How latestOnly groups results: one filing per company, or one filing per company and form type.",
            "default": "companyAndForm"
          },
          "includeCompanyProfile": {
            "title": "Include Company Profile",
            "type": "boolean",
            "description": "Attach normalized issuer metadata to each filing result.",
            "default": true
          },
          "includeDocuments": {
            "title": "Include Document Manifest",
            "type": "boolean",
            "description": "Retrieve the filing document list (primary doc, exhibits, XBRL files) from the filing index.",
            "default": true
          },
          "includePrimaryDocumentText": {
            "title": "Download Primary Document Text",
            "type": "boolean",
            "description": "Download and clean the primary filing document. More expensive — only enable when you need the text body.",
            "default": false
          },
          "documentTextFormat": {
            "title": "Document Text Format",
            "enum": [
              "text",
              "markdown",
              "rawHtml"
            ],
            "type": "string",
            "description": "Format for downloaded primary document content.",
            "default": "text"
          },
          "maxDocumentSizeMb": {
            "title": "Max Document Size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Skip downloading primary document content larger than this size.",
            "default": 20
          },
          "includeExhibits": {
            "title": "Include Exhibits",
            "type": "boolean",
            "description": "Include exhibit metadata (and optionally content) in the document manifest.",
            "default": false
          },
          "exhibitContentMode": {
            "title": "Exhibit Content Mode",
            "enum": [
              "metadataOnly",
              "text",
              "rawHtml"
            ],
            "type": "string",
            "description": "How much exhibit data to return when Include Exhibits is enabled.",
            "default": "metadataOnly"
          },
          "includeXbrlFacts": {
            "title": "Include XBRL Facts",
            "type": "boolean",
            "description": "Retrieve structured financial facts from the SEC company facts API.",
            "default": false
          },
          "xbrlOutputMode": {
            "title": "XBRL Output Mode",
            "enum": [
              "normalized",
              "raw",
              "both"
            ],
            "type": "string",
            "description": "normalized: common metrics with provenance. raw: SEC taxonomy facts. both: include both layers.",
            "default": "normalized"
          },
          "financialMetrics": {
            "title": "Financial Metrics",
            "type": "array",
            "description": "Normalized metrics to extract when XBRL is enabled (revenue, netIncome, assets, etc.). Empty = default metric set.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeLowConfidenceMetrics": {
            "title": "Include Low-Confidence Metrics",
            "type": "boolean",
            "description": "Include XBRL mappings marked low confidence in normalized output.",
            "default": false
          },
          "filingUrls": {
            "title": "Filing URLs",
            "type": "array",
            "description": "SEC filing index, directory, or primary document URLs (filingLookup mode).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "accessionNumbers": {
            "title": "Accession Numbers",
            "type": "array",
            "description": "Accession numbers with or without dashes (filingLookup mode). Pair with a company CIK/ticker in companies when possible.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "outputMode": {
            "title": "Output Mode",
            "enum": [
              "compact",
              "standard",
              "extended"
            ],
            "type": "string",
            "description": "compact: flat webhook-friendly fields. standard: normalized filing object without heavy payloads. extended: include requested document text and full XBRL.",
            "default": "standard"
          },
          "monitoring": {
            "title": "Monitoring",
            "type": "object",
            "description": "Incremental runs for schedules — return only new filings since the last successful run.",
            "properties": {
              "enabled": {
                "title": "Enable Monitoring",
                "type": "boolean",
                "description": "Persist seen accession numbers and filter to new filings on subsequent runs.",
                "default": false
              },
              "monitorId": {
                "title": "Monitor ID",
                "type": "string",
                "description": "Stable identifier for this watchlist (alphanumeric, hyphens, underscores).",
                "default": "default",
                "editor": "textfield"
              },
              "onlyNew": {
                "title": "Only New Filings",
                "type": "boolean",
                "description": "When true, skip filings already stored in monitoring state.",
                "default": true
              },
              "firstRunBehavior": {
                "title": "First Run Behavior",
                "type": "string",
                "description": "What to return on the first monitoring run before any state exists.",
                "enum": [
                  "returnCurrentMatches",
                  "initializeWithoutReturning",
                  "returnLatestPerCompany"
                ],
                "default": "returnCurrentMatches",
                "editor": "select"
              },
              "stateRetentionDays": {
                "title": "State Retention Days",
                "type": "integer",
                "description": "Prune monitoring state older than this many days.",
                "default": 730,
                "minimum": 30,
                "maximum": 3650
              },
              "updateStateAfterSuccessfulDelivery": {
                "title": "Update State After Delivery",
                "type": "boolean",
                "description": "When external delivery is configured, update monitoring state only after successful delivery.",
                "default": false
              }
            },
            "default": {
              "enabled": false,
              "monitorId": "default",
              "onlyNew": true,
              "firstRunBehavior": "returnCurrentMatches",
              "stateRetentionDays": 730,
              "updateStateAfterSuccessfulDelivery": false
            }
          },
          "delivery": {
            "title": "Delivery",
            "type": "object",
            "description": "Optional outbound notifications for discovered filings. Webhook URLs are never written to the dataset.",
            "properties": {
              "enabled": {
                "title": "Enable Delivery",
                "type": "boolean",
                "description": "Master switch for outbound webhook/Discord/Slack delivery.",
                "default": true
              },
              "webhookUrl": {
                "title": "Webhook URL",
                "type": "string",
                "description": "HTTPS endpoint to POST filing-discovered events.",
                "editor": "textfield"
              },
              "discordWebhookUrl": {
                "title": "Discord Webhook URL",
                "type": "string",
                "description": "Discord incoming webhook URL for filing alerts.",
                "editor": "textfield"
              },
              "slackWebhookUrl": {
                "title": "Slack Webhook URL",
                "type": "string",
                "description": "Slack incoming webhook URL for filing alerts.",
                "editor": "textfield"
              },
              "sendEmptyNotification": {
                "title": "Send Empty Notification",
                "type": "boolean",
                "description": "Notify even when no new filings were found.",
                "default": false
              },
              "signingSecret": {
                "title": "Webhook Signing Secret",
                "type": "string",
                "description": "Optional HMAC-SHA256 secret for X-SEC-Actor-Signature header.",
                "editor": "textfield"
              },
              "batchDelivery": {
                "title": "Batch Delivery",
                "type": "boolean",
                "description": "Send one webhook payload containing all filings instead of one request per filing.",
                "default": true
              },
              "customHeaders": {
                "title": "Custom Headers",
                "type": "object",
                "description": "Optional extra HTTPS headers for the generic webhook (size-limited).",
                "editor": "json",
                "default": {}
              }
            },
            "default": {
              "enabled": true,
              "sendEmptyNotification": false,
              "batchDelivery": true,
              "customHeaders": {}
            }
          },
          "secAccess": {
            "title": "SEC Fair Access",
            "required": [
              "organizationName",
              "contactEmail"
            ],
            "type": "object",
            "description": "Required by SEC fair-access policy. Your organization name and contact email are sent in the User-Agent header.",
            "properties": {
              "organizationName": {
                "title": "Organization Name",
                "type": "string",
                "description": "Your company or application name (required by SEC).",
                "editor": "textfield",
                "default": "Apify SEC Filings Scraper"
              },
              "contactEmail": {
                "title": "Contact Email",
                "type": "string",
                "description": "Valid contact email included in the SEC User-Agent (required).",
                "editor": "textfield",
                "prefill": "admin@example.com"
              },
              "requestsPerSecond": {
                "title": "Requests Per Second",
                "type": "integer",
                "description": "Max SEC requests per second (1–9). SEC allows up to 10; this Actor caps at 9.",
                "default": 5,
                "minimum": 1,
                "maximum": 9
              }
            },
            "default": {
              "organizationName": "Apify SEC Filings Scraper",
              "contactEmail": "admin@example.com",
              "requestsPerSecond": 5
            }
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional proxy. Prefer direct access with a valid SEC User-Agent unless your network blocks sec.gov.",
            "default": {
              "useApifyProxy": false
            }
          },
          "debug": {
            "title": "Debug",
            "type": "boolean",
            "description": "Enable verbose debug logging (local development).",
            "default": false
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}