{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC XBRL Fundamentals: Financial Statements API & Screener",
    "description": "Official SEC XBRL financials for any US-listed company: revenue, margins, EPS, balance sheet, cash flow and FCF per year, quarter (derived Q4) or TTM, each value traced to its filing. Plus a screener across every filer. $3 per 1,000 periods.",
    "version": "0.1",
    "x-build-id": "QsB9oQhl2ZfbDjmxW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cprussin~sec-xbrl-fundamentals/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cprussin-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/cprussin~sec-xbrl-fundamentals/runs": {
      "post": {
        "operationId": "runs-sync-cprussin-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/cprussin~sec-xbrl-fundamentals/run-sync": {
      "post": {
        "operationId": "run-sync-cprussin-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": [
              "company",
              "screener"
            ],
            "type": "string",
            "description": "<b>Company</b>: normalized financial statements (about 35 metrics) for each company and fiscal year, quarter or TTM period. <b>Screener</b>: one metric for every SEC filer in one calendar period, with value and state filters.",
            "default": "company"
          },
          "companies": {
            "title": "Companies",
            "type": "array",
            "description": "Company mode: stock tickers (AAPL, BRK-B), SEC CIK numbers (320193) or registered company names (Apple Inc.).",
            "items": {
              "type": "string"
            }
          },
          "periodTypes": {
            "title": "Periods",
            "type": "array",
            "description": "Annual (fiscal years from 10-K), quarterly (Q1-Q4; Q4 and cash-flow quarters derived from year-to-date figures) and/or TTM (trailing twelve months at each quarter end).",
            "items": {
              "type": "string",
              "enum": [
                "annual",
                "quarterly",
                "ttm"
              ],
              "enumTitles": [
                "Annual (fiscal year)",
                "Quarterly (Q1-Q4)",
                "TTM"
              ]
            },
            "default": [
              "annual"
            ]
          },
          "fromYear": {
            "title": "From fiscal year",
            "minimum": 2000,
            "maximum": 2100,
            "type": "integer",
            "description": "Only periods in this fiscal year or later. Empty = all years SEC has (XBRL data starts 2009-2011)."
          },
          "toYear": {
            "title": "To fiscal year",
            "minimum": 2000,
            "maximum": 2100,
            "type": "integer",
            "description": "Only periods up to this fiscal year. Empty = latest."
          },
          "metric": {
            "title": "Metric",
            "enum": [
              "revenue",
              "costOfRevenue",
              "grossProfit",
              "researchAndDevelopment",
              "sellingGeneralAdministrative",
              "operatingExpenses",
              "operatingIncome",
              "interestExpense",
              "pretaxIncome",
              "incomeTaxExpense",
              "netIncome",
              "epsBasic",
              "epsDiluted",
              "weightedSharesBasic",
              "weightedSharesDiluted",
              "dividendsPerShare",
              "cash",
              "shortTermInvestments",
              "accountsReceivable",
              "inventory",
              "currentAssets",
              "totalAssets",
              "currentLiabilities",
              "totalLiabilities",
              "stockholdersEquity",
              "longTermDebt",
              "shortTermDebt",
              "sharesOutstanding",
              "operatingCashFlow",
              "capitalExpenditures",
              "depreciationAmortization",
              "stockBasedCompensation",
              "dividendsPaid",
              "shareRepurchases"
            ],
            "type": "string",
            "description": "Screener mode: the metric to list for every filer. All synonym XBRL tags are queried and merged (one row per company).",
            "default": "revenue"
          },
          "period": {
            "title": "Calendar period",
            "type": "string",
            "description": "Screener mode: CY2024 (calendar year), CY2024Q2 (calendar quarter) or CY2024Q4I (balance sheet at the quarter end). Fiscal years are aligned to the nearest calendar period by the SEC. Empty = last calendar year."
          },
          "minValue": {
            "title": "Minimum value",
            "type": "string",
            "description": "Screener mode: only filers with a value at or above this, e.g. 1000000000 for $1B revenue or 2.5 for EPS."
          },
          "maxValue": {
            "title": "Maximum value",
            "type": "string",
            "description": "Screener mode: only filers with a value at or below this."
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Screener mode: only filers whose business address is in these US states (two-letter codes such as CA, NY). Empty = every filer, including non-US.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "valueDesc",
              "valueAsc",
              "name"
            ],
            "type": "string",
            "description": "Screener mode: order of the rows (and which ones are kept when 'Max results' cuts the list).",
            "default": "valueDesc"
          },
          "customTag": {
            "title": "Custom us-gaap tag",
            "type": "string",
            "description": "Screener mode, advanced: any us-gaap XBRL tag (e.g. Goodwill, AdvertisingExpense) instead of a metric. Use a period ending in I (CY2024Q4I) for balance-sheet tags."
          },
          "customUnit": {
            "title": "Custom tag unit",
            "type": "string",
            "description": "Unit of the custom tag: USD, USD/shares, shares or pure.",
            "default": "USD"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum records to return: company periods in company mode, filers in screener mode. Each record is billed as one event.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}