{
  "openapi": "3.0.1",
  "info": {
    "title": "Swedish Company Financials & Annual Reports (årsredovisningar)",
    "description": "Multi-year financials for any Swedish aktiebolag — nettoomsättning, årets resultat, rörelseresultat, summa tillgångar, eget kapital, medelantal anställda — keyed on organisationsnummer, parsed from the official Bolagsverket annual reports (iXBRL).",
    "version": "0.1",
    "x-build-id": "bD1XcSel9rA8GtUeu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vhsgreed~swedish-company-financials/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vhsgreed-swedish-company-financials",
        "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/vhsgreed~swedish-company-financials/runs": {
      "post": {
        "operationId": "runs-sync-vhsgreed-swedish-company-financials",
        "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/vhsgreed~swedish-company-financials/run-sync": {
      "post": {
        "operationId": "run-sync-vhsgreed-swedish-company-financials",
        "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": {
          "organisationNumbers": {
            "title": "Organisationsnummer",
            "type": "array",
            "description": "One or more Swedish organisation numbers, format NNNNNN-NNNN (the hyphen is optional on input; the actor always normalises it). Each company produces one dataset record.",
            "items": {
              "type": "string",
              "pattern": "^\\d{6}-?\\d{4}$"
            }
          },
          "companyNames": {
            "title": "Company names (not wired yet)",
            "type": "array",
            "description": "Optional. Intended for name -> organisation number resolution. NOT IMPLEMENTED in v0.1.0: the public archive carries no name index, so names are logged and ignored. Supply organisationNumbers instead (see PLAN.md open question 7).",
            "items": {
              "type": "string"
            }
          },
          "archiveKeys": {
            "title": "Explicit archive keys (fast, deterministic)",
            "type": "array",
            "description": "Advanced. Pin the exact weekly archive objects to search, e.g. arsredovisningar/2025/47_4.zip. This is the fast, deterministic path: it skips the bucket listing and reads only the archives given (a single archive is typically a few hundred KB to a few MB via range requests). Use it when you know the filing period, or to keep run time and download volume predictable.",
            "items": {
              "type": "string"
            }
          },
          "scanMode": {
            "title": "Archive scan mode",
            "enum": [
              "all",
              "newest"
            ],
            "type": "string",
            "description": "How to choose archives when archiveKeys is empty. 'all' searches every archive (complete coverage; archives are read lazily by range request, newest first, stopping as soon as every company has enough fiscal years). 'newest' searches only the newest maxArchivesToScan archives (cheapest, partial coverage).",
            "default": "all"
          },
          "maxArchivesToScan": {
            "title": "Max archives to scan (scanMode=newest)",
            "minimum": 1,
            "type": "integer",
            "description": "Only used when scanMode is 'newest': cap how many of the newest archives are searched. Ignored when scanMode is 'all' or archiveKeys is set.",
            "default": 50
          },
          "fiscalYears": {
            "title": "Fiscal years (optional filter)",
            "type": "array",
            "description": "Only return reports whose fiscal period ends in these years (e.g. [\"2023\", \"2024\"]). Also restricts which archives are listed. Leave empty for all available years.",
            "items": {
              "type": "string"
            }
          },
          "maxYearsPerCompany": {
            "title": "Max fiscal years per company",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the multi-year series per company (newest first). A single annual report already contains several fiscal years, so this is usually satisfied by the first filing found. 0 = no cap.",
            "default": 5
          },
          "includeSeries": {
            "title": "Include the multi-year series",
            "type": "boolean",
            "description": "Emit financials_by_year — the multi-year series taken from the filing's own flerarsoversikt (typically ~5 years of revenue/result and 2-5 years of balance items). Off = headline figures for the latest year only.",
            "default": true
          },
          "downloadDocuments": {
            "title": "Download and parse the annual report documents",
            "type": "boolean",
            "description": "Fetch the iXBRL (Inline XBRL) filing and parse the financial statement line items. When off, the actor only locates the filing and returns its metadata (archive key, object name, period) with no figures — much cheaper, no numbers.",
            "default": true
          },
          "includePersons": {
            "title": "Include CEO / board (personal data - see README)",
            "type": "boolean",
            "description": "OFF by default. When on, returns the CEO and board signatories published in the filing. These are personal data; only enable when you have a lawful basis (see the legal/GDPR notes in README.md). Beneficial owners (verkliga huvudman) are never returned.",
            "default": false
          },
          "reportDocumentRef": {
            "title": "Include report document reference",
            "type": "boolean",
            "description": "Include the archive key, filing object name, document name and download URL for each filing found, so every figure can be traced back to its source document.",
            "default": true
          },
          "enrichWithApi": {
            "title": "Enrich identity via the Bolagsverket API (requires credentials)",
            "type": "boolean",
            "description": "OFF by default. When on, fills legal_form, registration_date, address and sni_codes from the free Bolagsverket 'Vardefulla datamangder' API. Requires BOLAGSVERKET_CLIENT_ID / BOLAGSVERKET_CLIENT_SECRET in the environment. Fails soft: without credentials the fields stay null.",
            "default": false
          },
          "concurrency": {
            "title": "Archive concurrency",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many archives to read in parallel. Higher is faster but uses more connections.",
            "default": 6
          },
          "maxRunSeconds": {
            "title": "Maximum seconds for the archive scan",
            "minimum": 30,
            "maximum": 780,
            "type": "integer",
            "description": "Soft wall-clock budget for the archive scan. When reached, the actor stops scanning and emits what it has found (companies with nothing found become honest no_filing records). Keeps a run comfortably inside a 5-minute slot.",
            "default": 210
          },
          "maxDownloadMb": {
            "title": "Maximum download volume (MB)",
            "minimum": 1,
            "type": "number",
            "description": "Hard cap on bytes downloaded in one run. Reached = the actor stops scanning and reports what it has. Guards against runaway cost/time.",
            "default": 4096
          },
          "allowFullArchiveDownload": {
            "title": "Allow full archive download as a fallback",
            "type": "boolean",
            "description": "The actor normally reads only the ZIP central directory and the members it needs via HTTP range requests. Set this off to forbid falling back to a full download if a server ignores range requests.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}