{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC EDGAR Filings & Fundamentals API — RAG-Ready",
    "description": "Turn any ticker into clean, citation-tagged RAG chunks of SEC filings (10-K, 10-Q, 8-K, Form 4, 13F) plus normalized XBRL fundamentals. Official SEC EDGAR data, no API key. Full-text search, watch mode for new filings. Built for finance AI agents and RAG.",
    "version": "1.0",
    "x-build-id": "YaaqKihpDgGsX1jS2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/commonelements~sec-edgar-ai/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-commonelements-sec-edgar-ai",
        "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/commonelements~sec-edgar-ai/runs": {
      "post": {
        "operationId": "runs-sync-commonelements-sec-edgar-ai",
        "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/commonelements~sec-edgar-ai/run-sync": {
      "post": {
        "operationId": "run-sync-commonelements-sec-edgar-ai",
        "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",
        "properties": {
          "tickers": {
            "title": "Tickers",
            "type": "array",
            "description": "Ticker symbols, e.g. AAPL, MSFT. Resolved to CIK via company_tickers.json.",
            "items": {
              "type": "string"
            }
          },
          "ciks": {
            "title": "CIKs",
            "type": "array",
            "description": "Raw CIK numbers (any length; zero-padded internally). Use instead of/with tickers.",
            "items": {
              "type": "string"
            }
          },
          "filingTypes": {
            "title": "Filing types",
            "type": "array",
            "description": "EDGAR form types to include. e.g. 10-K, 10-Q, 8-K, S-1, DEF 14A, 20-F.",
            "default": [
              "10-K",
              "10-Q",
              "8-K"
            ],
            "items": {
              "type": "string"
            }
          },
          "since": {
            "title": "Since date",
            "type": "string",
            "description": "Only filings with filingDate >= this ISO date (YYYY-MM-DD)."
          },
          "until": {
            "title": "Until date",
            "type": "string",
            "description": "Only filings with filingDate <= this ISO date (YYYY-MM-DD). Optional."
          },
          "fullTextQuery": {
            "title": "Full-text search",
            "type": "string",
            "description": "Optional. Phrase search across ALL EDGAR filings via efts.sec.gov. Runs in addition to (or instead of) per-company listing."
          },
          "maxFilingsPerCompany": {
            "title": "Max filings per company",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of filings to list per company before applying the global total cap.",
            "default": 25
          },
          "maxFilingsTotal": {
            "title": "Max filings total",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap across all companies/searches. 0 = unlimited.",
            "default": 0
          },
          "extractChunks": {
            "title": "Extract RAG chunks",
            "type": "boolean",
            "description": "Fetch each filing's primary document, convert to Markdown, split by Item, and chunk.",
            "default": true
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 64,
            "type": "integer",
            "description": "Target tokens per RAG chunk. Larger = fewer, longer chunks.",
            "default": 512
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "type": "integer",
            "description": "Token overlap between adjacent chunks to preserve context across boundaries.",
            "default": 64
          },
          "splitByItem": {
            "title": "Split by Item section",
            "type": "boolean",
            "description": "Pre-segment the filing on SEC Item boundaries before chunking, so every chunk carries its Item anchor.",
            "default": true
          },
          "includeFundamentals": {
            "title": "Include XBRL fundamentals",
            "type": "boolean",
            "description": "Attach top GAAP concept facts per company via the XBRL companyconcept/companyfacts API.",
            "default": true
          },
          "xbrlConcepts": {
            "title": "GAAP concepts",
            "type": "array",
            "description": "Override the default ~20-concept allowlist (us-gaap taxonomy tag names). Empty = built-in list.",
            "items": {
              "type": "string"
            }
          },
          "xbrlSource": {
            "title": "XBRL fetch strategy",
            "enum": [
              "companyconcept",
              "companyfacts"
            ],
            "type": "string",
            "description": "companyconcept = N small requests (one per concept, exact allowlist). companyfacts = 1 big request, filtered client-side.",
            "default": "companyconcept"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "chunks-jsonl",
              "langchain",
              "jsonl-bulk",
              "filings-only"
            ],
            "type": "string",
            "description": "RAG record shape. 'filings-only' emits filing metadata + fundamentals with no chunking.",
            "default": "chunks-jsonl"
          },
          "userAgentEmail": {
            "title": "Contact email for User-Agent",
            "type": "string",
            "description": "SEC requires a descriptive User-Agent with a contact. Sent as 'CommonElements sec-edgar-ai/1.0 <email>'.",
            "default": "admin@commonelements.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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}