{
  "openapi": "3.0.1",
  "info": {
    "title": "Swiss Official Gazette Scraper (SHAB / FOSC / Handelsregister)",
    "description": "Extract real-time Swiss corporate data. Monitor the commercial register (Handelsregister / Registre du commerce) and bankruptcies (Konkurse / Faillites).",
    "version": "0.0",
    "x-build-id": "0Z36W2NZfFgDzfxI2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/actor-x~shab-actor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-actor-x-shab-actor",
        "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/actor-x~shab-actor/runs": {
      "post": {
        "operationId": "runs-sync-actor-x-shab-actor",
        "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/actor-x~shab-actor/run-sync": {
      "post": {
        "operationId": "run-sync-actor-x-shab-actor",
        "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": {
          "rubrics": {
            "title": "Rubrics",
            "type": "array",
            "description": "One or more SHAB publication categories. Leave empty to fetch all 16 rubrics.",
            "items": {
              "type": "string",
              "enum": [
                "AB",
                "AW",
                "AZ",
                "BB",
                "BH",
                "EK",
                "ES",
                "FM",
                "HR",
                "KK",
                "LS",
                "NA",
                "SB",
                "SR",
                "UP",
                "UV"
              ],
              "enumTitles": [
                "AB – Arbeit (Employment)",
                "AW – Abhandengekommene Wertpapiere (Lost Securities)",
                "AZ – Anzeigen (Notices)",
                "BB – Weitere Register und Bekanntmachungen Bund (Federal Announcements)",
                "BH – Bekanntmachungen nach Handelsregisterverordnung",
                "EK – Edelmetallkontrolle (Precious Metals Control)",
                "ES – Erbschaft (Inheritance)",
                "FM – Finanzmarkt (Financial Market)",
                "HR – Handelsregistereintragungen (Commercial Register)",
                "KK – Konkurse (Bankruptcies)",
                "LS – Liquidationsschuldenrufe (Liquidation Calls to Creditors)",
                "NA – Nachlassverfahren (Debt Restructuring Proceedings)",
                "SB – Schuldbetreibungen (Debt Enforcement)",
                "SR – Weitere gesellschaftsrechtliche Schuldenrufe (Corporate Law Calls)",
                "UP – Mitteilungen an Gesellschafter (Company Member Notices)",
                "UV – Gerichtliche Entscheide und Vorladungen (Court Rulings & Summons)"
              ]
            },
            "default": [
              "HR",
              "KK",
              "SB"
            ]
          },
          "subRubrics": {
            "title": "Sub-rubrics (optional)",
            "type": "array",
            "description": "Restrict to specific sub-rubric codes. Examples: HR01 = Neueintrag (new entry), HR02 = Mutation (change), HR03 = Löschung (deletion); KK01 = Vorläufige Konkursanzeige, KK02 = Konkurspublikation/Schuldenruf; SB01 = Grundstücksteigerung, SB02 = Zahlungsbefehl. Leave empty for all sub-rubrics of the selected rubrics.",
            "items": {
              "type": "string"
            }
          },
          "publicationStates": {
            "title": "Publication states",
            "type": "array",
            "description": "PUBLISHED covers all active notices. Add CANCELLED to also include withdrawn or annulled entries (dominated by AW – lost securities revocations).",
            "items": {
              "type": "string",
              "enum": [
                "PUBLISHED",
                "CANCELLED"
              ],
              "enumTitles": [
                "Published",
                "Cancelled / Annulled"
              ]
            },
            "default": [
              "PUBLISHED"
            ]
          },
          "language": {
            "title": "Language filter",
            "enum": [
              "",
              "de",
              "fr",
              "it",
              "en"
            ],
            "type": "string",
            "description": "Filter by publication language. German (de) covers roughly 70% of SHAB publications. Leave empty for all languages.",
            "default": ""
          },
          "tenants": {
            "title": "Tenants (gazettes)",
            "type": "array",
            "description": "Which official gazettes to include. The central SHAB (shab) is selected by default. 13 external cantonal gazettes (AG, AI, FR, GE, GL, GR, JU, LU, NE, SG, TG, UR, VD) are not accessible via this API.",
            "items": {
              "type": "string",
              "enum": [
                "shab",
                "neutral",
                "kabar",
                "kabbe",
                "kabbl",
                "kabbs",
                "kabda",
                "kabnw",
                "kabow",
                "kabsh",
                "kabso",
                "kabsz",
                "kabti",
                "kabvs",
                "kabzg",
                "kabzh"
              ],
              "enumTitles": [
                "shab – SHAB / FOSC / FUSC (federal)",
                "neutral – Neutral portal",
                "kabar – Amtsblatt Appenzell Ausserrhoden (AR)",
                "kabbe – Amtsblatt Bern / Feuille officielle BE",
                "kabbl – Amtsblatt Basel-Landschaft (BL)",
                "kabbs – Kantonsblatt Basel-Stadt (BS)",
                "kabda – ePublikation Datenbanken / DA",
                "kabnw – Amtsblatt Nidwalden (NW)",
                "kabow – Amtsblatt Obwalden (OW)",
                "kabsh – Amtsblatt Schaffhausen (SH)",
                "kabso – Amtsblatt Solothurn (SO)",
                "kabsz – Amtsblatt Schwyz (SZ)",
                "kabti – Foglio ufficiale Ticino (TI)",
                "kabvs – Amtsblatt Wallis / Bulletin officiel VS",
                "kabzg – Amtsblatt Zug (ZG)",
                "kabzh – Amtsblatt Zürich (ZH)"
              ]
            },
            "default": [
              "shab"
            ]
          },
          "searchPeriod": {
            "title": "Search period",
            "enum": [
              "TODAY",
              "LAST7DAYS",
              "LAST30DAYS",
              "CUSTOM"
            ],
            "type": "string",
            "description": "Predefined date window. Use 'Custom range' together with Start date and End date for precise control.",
            "default": "LAST7DAYS"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Inclusive lower bound for the publication date. Required when Search period is 'Custom range'. Format: YYYY-MM-DD."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Inclusive upper bound for the publication date. Required when Search period is 'Custom range'. Format: YYYY-MM-DD."
          },
          "includeContent": {
            "title": "Include full publication content",
            "type": "boolean",
            "description": "When enabled, each record includes the full structured content payload (company details, legal text, etc.). Disable to return metadata-only records, which are smaller and faster.",
            "default": true
          },
          "enrichLookups": {
            "title": "Enrich with human-readable names",
            "type": "boolean",
            "description": "Fetches rubric, tenant, and municipality reference data once at startup and adds slim _rubric, _subRubric, _tenant, and _municipality fields to each record (code + multilingual name).",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional Apify proxy settings. The SHAB API has no documented rate limits or geo-restrictions; proxy adds resilience for very large runs."
          },
          "maxItems": {
            "title": "Max items (0 = unlimited)",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on the number of publications pushed to the dataset. Useful for testing. Set to 0 for no limit.",
            "default": 0
          },
          "autoChunkOnLargeResults": {
            "title": "Auto-chunk large date ranges",
            "type": "boolean",
            "description": "When enabled and the query total exceeds 3,000 (the API export ceiling), the actor automatically splits the date range into smaller windows recursively until each fits. Only applies to Custom range queries.",
            "default": true
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Number of publications fetched per API request. The SHAB search endpoint caps this at 100. Reduce only for debugging.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}