{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC Fundamentals: Revenue, EPS and Cash Flow",
    "description": "Annual and quarterly financials from the XBRL data companies file with SEC: revenue, profit, EPS, balance sheet and cash flow by ticker or CIK, with the source tag next to each value. Screen mode lists every company that reported a metric for a calendar period.",
    "version": "0.1",
    "x-build-id": "KyH5SkMiFZNY63y1c"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lone_rachis~sec-xbrl-fundamentals/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lone_rachis-sec-xbrl-fundamentals",
        "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/lone_rachis~sec-xbrl-fundamentals/runs": {
      "post": {
        "operationId": "runs-sync-lone_rachis-sec-xbrl-fundamentals",
        "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/lone_rachis~sec-xbrl-fundamentals/run-sync": {
      "post": {
        "operationId": "run-sync-lone_rachis-sec-xbrl-fundamentals",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "companies",
              "screen"
            ],
            "type": "string",
            "description": "companies: the fiscal periods of the companies listed below, one row per company and period. screen: every company that reported the first chosen metric for one calendar period, one row per company, from SEC's frames.",
            "default": "companies"
          },
          "companies": {
            "title": "Companies",
            "maxItems": 500,
            "type": "array",
            "description": "Tickers (AAPL, BRK.B) or CIKs (320193 or CIK0000320193), one per line, up to 500. A ticker is looked up in SEC's ticker list; a company that is no longer listed can still be read by its CIK. Used in companies mode.",
            "default": [
              "AAPL",
              "MSFT",
              "JPM"
            ],
            "items": {
              "type": "string"
            }
          },
          "periods": {
            "title": "Periods",
            "enum": [
              "annual",
              "quarterly",
              "both"
            ],
            "type": "string",
            "description": "annual: one row per fiscal year, from the 10-K (or 20-F, 40-F). quarterly: one row per fiscal quarter, from the 10-Q, plus Q4 from the 10-K. both: the two together.",
            "default": "annual"
          },
          "years": {
            "title": "Years",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many of the latest fiscal years to return per company. Annual gives that many rows per company; quarterly gives four times as many. Counted from the company's latest filed period, so a company that stopped filing still returns its last years.",
            "default": 5
          },
          "valueRule": {
            "title": "Which filing's value",
            "enum": [
              "latest-filed",
              "first-filed"
            ],
            "type": "string",
            "description": "A figure appears again in later filings as a comparative, sometimes restated. latest-filed takes the value from the newest filing that reports the period, so restatements win. first-filed takes the value as first reported.",
            "default": "latest-filed"
          },
          "metrics": {
            "title": "Metrics to screen on",
            "uniqueItems": true,
            "type": "array",
            "description": "The metrics to return in screen mode. The first one decides which companies are in the screen, sorts them from high to low, and is the one minValue and maxValue apply to. Each metric needs one SEC request per XBRL tag it can come from (revenue needs 6).",
            "items": {
              "type": "string",
              "enum": [
                "revenue",
                "grossProfit",
                "operatingIncome",
                "netIncome",
                "dilutedEps",
                "totalAssets",
                "totalLiabilities",
                "stockholdersEquity",
                "cash",
                "operatingCashFlow",
                "capitalExpenditure",
                "freeCashFlow",
                "sharesOutstanding"
              ],
              "enumTitles": [
                "Revenue",
                "Gross profit",
                "Operating income",
                "Net income",
                "Diluted EPS",
                "Total assets",
                "Total liabilities",
                "Stockholders' equity",
                "Cash",
                "Operating cash flow",
                "Capital expenditure",
                "Free cash flow",
                "Shares outstanding"
              ]
            },
            "default": [
              "revenue"
            ]
          },
          "period": {
            "title": "Calendar period",
            "pattern": "^[Cc][Yy]\\d{4}([Qq][1-4])?$",
            "type": "string",
            "description": "CY2024 for a calendar year, CY2025Q2 for a calendar quarter. SEC places each company's fiscal period in the calendar period it fits best, so a fiscal year ending in September 2024 counts as CY2024. Balances (assets, cash, shares) are read on the last day of the period. Used in screen mode.",
            "default": "CY2024"
          },
          "minValue": {
            "title": "Minimum value of the first metric",
            "type": "number",
            "description": "Keep companies whose first metric is at least this much, in US dollars (dollars per share for diluted EPS). Leave empty for no lower limit."
          },
          "maxValue": {
            "title": "Maximum value of the first metric",
            "type": "number",
            "description": "Keep companies whose first metric is at most this much. Leave empty for no upper limit."
          },
          "maxResults": {
            "title": "Maximum rows per run",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after delivering this many rows, 1,000 unless you change it. In screen mode the companies with the highest values come first; a full CY2024 revenue screen holds about 5,100 companies. Clear the field for no limit, and use Maximum cost per run to cap spending.",
            "default": 1000
          },
          "contactEmail": {
            "title": "Contact email for SEC",
            "type": "string",
            "description": "Optional. SEC asks every automated tool to name a contact in the User-Agent header of its requests. Leave it empty to use the Actor developer's address. Give your own if you want SEC to reach you about your runs. It is sent to SEC only, in that header, and is not stored in the output."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}