{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC EDGAR Financial Data Scraper",
    "description": "Scrape SEC EDGAR filings and XBRL financial data for public companies.",
    "version": "0.1",
    "x-build-id": "moAX3b1DZa4bgIbB2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kelvinosse~sec-edgar-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kelvinosse-sec-edgar-scraper",
        "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/kelvinosse~sec-edgar-scraper/runs": {
      "post": {
        "operationId": "runs-sync-kelvinosse-sec-edgar-scraper",
        "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/kelvinosse~sec-edgar-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-kelvinosse-sec-edgar-scraper",
        "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": "Stock Tickers",
            "type": "array",
            "description": "Enter one or more stock tickers (e.g. AAPL, MSFT, TSLA). The actor will resolve them to SEC CIK numbers automatically.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "ciks": {
            "title": "CIK Numbers (alternative)",
            "type": "array",
            "description": "If you know the SEC CIK numbers, enter them directly. You can use tickers OR CIKs — no need for both.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "filingTypes": {
            "title": "Filing Types",
            "type": "array",
            "description": "Types of SEC filings to include. Common types:\n- **10-K** — Annual report\n- **10-Q** — Quarterly report\n- **8-K** — Current events report\n- **DEF 14A** — Proxy statement",
            "items": {
              "type": "string"
            },
            "default": [
              "10-K",
              "10-Q",
              "8-K"
            ]
          },
          "maxFilingsPerCompany": {
            "title": "Max Filings Per Company",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of filings to return per company. Lower values = faster runs.",
            "default": 10
          },
          "dateFrom": {
            "title": "Filing Date From",
            "type": "string",
            "description": "Only include filings from this date onwards. Format: YYYY-MM-DD (e.g. 2024-01-01)."
          },
          "dateTo": {
            "title": "Filing Date To",
            "type": "string",
            "description": "Only include filings up to this date. Format: YYYY-MM-DD."
          },
          "extractFinancials": {
            "title": "Extract Financial Metrics",
            "type": "boolean",
            "description": "Enable to extract XBRL financial data (revenue, income, assets, etc.) for each company. Disabling this makes the run faster but only returns filing metadata.",
            "default": true
          },
          "financialMetrics": {
            "title": "Metrics to Extract",
            "type": "array",
            "description": "Which financial metrics to extract. Available metrics:\n- **Revenue** — Total revenue / sales\n- **NetIncome** — Net income / profit\n- **Assets** — Total assets\n- **Liabilities** — Total liabilities\n- **Equity** — Stockholders' equity\n- **CashAndEquivalents** — Cash and short-term investments\n- **OperatingIncome** — Operating income/loss\n- **EPS** — Earnings per share (basic)\n- **SharesOutstanding** — Common shares outstanding",
            "items": {
              "type": "string"
            },
            "default": [
              "Revenue",
              "NetIncome",
              "Assets",
              "Liabilities"
            ]
          },
          "compareCompanies": {
            "title": "Compare Companies",
            "type": "boolean",
            "description": "When enabled and multiple tickers are provided, generates a side-by-side comparison of the selected financial metrics across all companies.",
            "default": false
          },
          "userAgentEmail": {
            "title": "Contact Email (SEC requirement)",
            "type": "string",
            "description": "SEC requires a contact email in the User-Agent header. This is used to identify your requests. SEC may contact you if your usage causes issues.",
            "default": "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}