{
  "openapi": "3.0.1",
  "info": {
    "title": "Zefix Scraper: Swiss Company Register, Handelsregister CH",
    "description": "Search the Swiss Handelsregister (Zefix) by company name and get every new company, change and deletion from SHAB with UID, legal form, seat, purpose, capital and persons.",
    "version": "0.2",
    "x-build-id": "EdNg1KqYuYfTh0cav"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/swissalpinedata~swiss-company-register-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-swissalpinedata-swiss-company-register-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/swissalpinedata~swiss-company-register-scraper/runs": {
      "post": {
        "operationId": "runs-sync-swissalpinedata-swiss-company-register-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/swissalpinedata~swiss-company-register-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-swissalpinedata-swiss-company-register-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "new-companies",
              "search"
            ],
            "type": "string",
            "description": "\"new-companies\" lists commercial register notices published in SHAB in a date range (new registrations, changes, deletions). \"search\" looks up companies in Zefix by name.",
            "default": "new-companies"
          },
          "name": {
            "title": "Company name (search mode)",
            "type": "string",
            "description": "Search mode only: company name or part of it, e.g. \"Migros\", \"Treuhand\", \"AG Zürich\". Zefix returns at most 2000 matches per search."
          },
          "legalForms": {
            "title": "Legal forms (search mode)",
            "type": "array",
            "description": "Optional legal form filter for the Zefix search. Leave empty for all legal forms.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "10",
                "11",
                "12"
              ],
              "enumTitles": [
                "Einzelunternehmen (sole proprietorship)",
                "Kollektivgesellschaft (general partnership)",
                "Aktiengesellschaft (AG, SA)",
                "GmbH (Sarl, Sagl)",
                "Genossenschaft (cooperative)",
                "Verein (association)",
                "Stiftung (foundation)",
                "Institut des oeffentlichen Rechts (public law institution)",
                "Zweigniederlassung (branch of a Swiss company)",
                "Kommanditgesellschaft (limited partnership)",
                "Zweigniederlassung einer ausl. Gesellschaft (branch of a foreign company)",
                "Kommanditaktiengesellschaft"
              ]
            },
            "default": []
          },
          "activeOnly": {
            "title": "Active companies only (search mode)",
            "type": "boolean",
            "description": "Only return companies that still exist in the register. Untick to include deleted companies (status geloescht).",
            "default": true
          },
          "subRubrics": {
            "title": "Publication types (new-companies mode)",
            "type": "array",
            "description": "Which SHAB commercial register notices to return. HR01 = new registration, HR02 = mutation (change), HR03 = deletion.",
            "items": {
              "type": "string",
              "enum": [
                "HR01",
                "HR02",
                "HR03"
              ],
              "enumTitles": [
                "HR01 New registration",
                "HR02 Mutation",
                "HR03 Deletion"
              ]
            },
            "default": [
              "HR01"
            ]
          },
          "cantons": {
            "title": "Cantons",
            "type": "array",
            "description": "Optional list of 2 letter canton codes, e.g. [\"ZH\", \"BE\", \"GE\"]. Works in both modes. Leave empty for all of Switzerland.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Date from (new-companies mode)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "New-companies mode: first publication date, format YYYY-MM-DD, e.g. \"2026-10-01\". Defaults to 7 days before today."
          },
          "dateTo": {
            "title": "Date to (new-companies mode)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "New-companies mode: last publication date, format YYYY-MM-DD. Defaults to today."
          },
          "fetchDetails": {
            "title": "Fetch details",
            "type": "boolean",
            "description": "Search mode: fetch the Zefix detail record for each company (address, purpose). New-companies mode: fetch and parse the publication XML for each notice (company name, UID, seat, legal form, address, purpose, capital, persons, full text). One extra request per record, so slower but much richer.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of records (1 to 5000). You pay per record, so this also caps the cost. Default 100.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "amtsblattportal.ch (new-companies mode) blocks direct connections from the Apify platform's IP range, so a proxy is needed there; the default Apify datacenter proxy works. Zefix (search mode) works with or without a proxy.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}