{
  "openapi": "3.0.1",
  "info": {
    "title": "SEC XBRL Financials Scraper — Revenue, Assets & EPS",
    "description": "Pull structured financial facts from SEC's keyless XBRL API — Revenue, Assets, NetIncomeLoss and any US-GAAP/IFRS/DEI concept — across every filer for one period (frame mode) or one filer's full reporting history (company mode), as clean JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "x0JDqNzKsUgjocpt6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/devilscrapes~sec-xbrl-financials-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-devilscrapes-sec-xbrl-financials-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/devilscrapes~sec-xbrl-financials-scraper/runs": {
      "post": {
        "operationId": "runs-sync-devilscrapes-sec-xbrl-financials-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/devilscrapes~sec-xbrl-financials-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-devilscrapes-sec-xbrl-financials-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "frame",
              "company"
            ],
            "type": "string",
            "description": "Which SEC XBRL endpoint family to query: frame mode pulls every filer for one concept/period; company mode pulls one or more filers' full history for one or more concepts.",
            "default": "frame"
          },
          "taxonomy": {
            "title": "Taxonomy",
            "type": "string",
            "description": "XBRL taxonomy the concept belongs to, e.g. <code>us-gaap</code>, <code>ifrs-full</code> or <code>dei</code>.",
            "default": "us-gaap"
          },
          "tag": {
            "title": "Concept tag (frame mode)",
            "type": "string",
            "description": "Single XBRL concept for frame mode, e.g. <code>Revenues</code>, <code>Assets</code> or <code>NetIncomeLoss</code>. Required when mode is frame.",
            "default": "Revenues"
          },
          "unit": {
            "title": "Unit",
            "type": "string",
            "description": "XBRL unit for frame mode, e.g. <code>USD</code>, <code>USD-per-shares</code> or <code>shares</code>.",
            "default": "USD"
          },
          "periods": {
            "title": "Frame periods (frame mode)",
            "type": "array",
            "description": "One or more SEC frame ids, e.g. <code>CY2023Q1I</code> (instant), <code>CY2023Q1</code> (quarterly) or <code>CY2023</code> (annual). Required when mode is frame.",
            "default": [
              "CY2023Q1I"
            ],
            "items": {
              "type": "string"
            }
          },
          "tickers_or_ciks": {
            "title": "Tickers or CIKs (company mode)",
            "type": "array",
            "description": "Tickers (e.g. <code>AAPL</code>) or zero-padded 10-digit CIK strings. Required when mode is company.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "title": "Concept tags (company mode)",
            "type": "array",
            "description": "XBRL concept names to fetch per company, all under the same taxonomy. Required when mode is company.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "user_agent": {
            "title": "User-Agent",
            "type": "string",
            "description": "SEC Fair Access requires a descriptive User-Agent naming a contact; unidentified clients get 403'd.",
            "default": "DevilScrapes-XBRL/1.0 (contact: apify.com/DevilScrapes)"
          },
          "max_results": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Stop after this many financial-fact rows. Each row is one billed result.",
            "default": 50
          },
          "proxy_configuration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "data.sec.gov is a plain JSON API with no anti-bot layer and does not need a proxy. Leave this off unless your account requires egress through Apify Proxy.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}