# Zefix Switzerland Company Search Scraper (`crawlerbros/zefix-company-search-scraper`) Actor

Search zefix.ch - the Swiss Central Business Names Index (Zentraler Firmenindex). Find companies by name, UID/CHE number, or FCRO-ID, and get legal form, registered address, canton, status, SOGC/SHAB publication history, auditors, branches, and merger history.

- **URL**: https://apify.com/crawlerbros/zefix-company-search-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Zefix Switzerland Company Search Scraper

Search **Zefix** — the Swiss Central Business Names Index (Zentraler Firmenindex, zefix.ch) — the official federal registry of every company registered in Switzerland's 26 cantonal commercial registers. Find companies by name, UID/CHE business number, or FCRO-ID, and pull legal form, registered address, canton, status, SOGC/SHAB publication history, auditors, branches, and merger/predecessor history. No auth, no proxy, no cookies required.

### What this actor does

- **Three modes:** `search` (by company name), `byUid` (exact lookup by Swiss UID/CHE number), `byEhraid` (exact lookup by Zefix's internal FCRO-ID)
- **Search types:** contains / starts with / exact match
- **Filters:** legal form (19 types), canton (all 26), registration status (active / deleted / in liquidation), municipality / legal seat (free-text, accent-insensitive)
- **Full company details on demand:** registered address, business purpose, SOGC/SHAB publication history, auditors, branch offices, head offices, merger history (who took over whom), and prior company names
- **Empty fields are omitted** — you only ever see fields Zefix actually has data for

### Output per company

**Always present:**

- `ehraid` — Zefix's internal firm ID (FCRO-ID)
- `name`, `uid` (formatted `CHE-123.456.789`), `chid` (formatted `CH-...`)
- `legalForm`, `legalFormId`, `legalFormShort`
- `legalSeat` — registered municipality, `canton`, `cantonName`
- `status` (`Active` / `Deleted` / `In liquidation`), `statusCode`
- `shabDate` — date of last SOGC/SHAB (Swiss Official Gazette of Commerce) publication
- `registryExcerptUrl` / `sourceUrl` — official cantonal commercial-register excerpt page

**Present when applicable:**

- `deleteDate` — if the company was struck off the register
- `tradeNames[]` — foreign-language name translations
- `purpose` — registered business purpose (German/French/Italian, as filed)
- `address` — `street`, `houseNumber`, `poBox`, `careOf`, `town`, `swissZipCode`, `country`, `fullAddress`
- `shabPublications[]` (up to 30 most recent) — `publicationDate`, `shabId`, `publicationUrl`, `message` (cleaned, unescaped), `mutationTypes[]`
- `shabPublicationCount` — total publication count (may exceed the 30 shown)
- `auditFirms[]` / `auditFirmFor[]` — statutory auditors / companies this firm audits
- `mainOffices[]` / `furtherMainOffices[]` / `branchOffices[]` — related registrations
- `hasTakenOver[]` / `wasTakenOverBy` — merger/succession history
- `oldNames[]` — prior registered company names

Every record also includes `recordType: "company"` and `scrapedAt` (UTC timestamp).

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | `search` / `byUid` / `byEhraid` |
| `searchQuery` | string | `Nestle` | Company name query (mode=search) |
| `searchType` | string | `contains` | `contains` / `starts` / `exact` (mode=search) |
| `uids` | array | – | Swiss UID/CHE numbers (mode=byUid), e.g. `CHE-191.546.434` |
| `ehraids` | array | – | Zefix FCRO-IDs (mode=byEhraid), e.g. `1009345` |
| `legalFormIds` | array | – | Restrict to one or more of 19 legal forms (mode=search) |
| `cantons` | array | – | Restrict to one or more of the 26 cantons (mode=search) |
| `statuses` | array | – | Restrict to `EXISTIEREND` / `GELOESCHT` / `IN_AUFLOESUNG` (mode=search). Note: Zefix's name-search index only covers active/in-liquidation companies — deleted (`GELOESCHT`) companies never appear via name search; look them up directly with `byUid`/`byEhraid` instead. |
| `legalSeatQuery` | string | – | Restrict to companies whose registered municipality contains this text, e.g. `Zurich` (mode=search) |
| `includeFullDetails` | bool | `false` | Fetch full detail (address, purpose, auditors, branches, publications) per result — always on for byUid/byEhraid |
| `shabPublicationLimit` | int | `30` | Max SOGC/SHAB publications to include per company (1–200), when full details are fetched |
| `maxItems` | int | `50` | Hard cap on emitted records (1–1000) |

#### Example: search by name

```json
{
  "mode": "search",
  "searchQuery": "Nestle",
  "searchType": "contains",
  "maxItems": 50
}
```

#### Example: search restricted to Zürich AGs (corporations)

```json
{
  "mode": "search",
  "searchQuery": "swiss",
  "searchType": "contains",
  "cantons": ["ZH"],
  "legalFormIds": [3],
  "statuses": ["EXISTIEREND"],
  "includeFullDetails": true,
  "maxItems": 25
}
```

#### Example: lookup by UID / CHE number

```json
{
  "mode": "byUid",
  "uids": ["CHE-191.546.434", "CHE-101.329.561"]
}
```

#### Example: lookup by FCRO-ID

```json
{
  "mode": "byEhraid",
  "ehraids": [1009345, 1184151]
}
```

### Use cases

- **KYB / KYC due diligence** — verify a Swiss counterparty's legal status, registered address, and signatories before onboarding
- **Company registry enrichment** — bulk-enrich a list of Swiss UIDs with legal form, canton, and status
- **Compliance monitoring** — track SOGC/SHAB publications (director changes, capital changes, liquidations) for a watchlist of companies
- **M\&A / corporate research** — trace merger and predecessor-company history (`hasTakenOver` / `wasTakenOverBy` / `oldNames`)
- **Sales & lead generation** — find active companies by canton and legal form for market mapping
- **Auditor mapping** — see which firms a given auditor (e.g. a Big Four Swiss office) audits, via `auditFirmFor`

### FAQ

**What's Zefix?**  The Swiss Central Business Names Index — the federal government's public, canonical index of every company registered in a Swiss commercial register (Handelsregister/Registre du commerce/Registro di commercio). Maintained by the Federal Commercial Registry Office (FCRO). See [zefix.ch](https://www.zefix.ch).

**What's the difference between UID and FCRO-ID (EHRAID)?**  The UID (`CHE-xxx.xxx.xxx`) is Switzerland's official business identification number, used across all federal registers (VAT, social security, commercial register). The FCRO-ID/EHRAID is Zefix's own internal database key for a firm record — use it for exact, stable lookups within this actor.

**Can two different companies share the same UID?**  Rare, but yes — during some historical mergers (e.g. bank restructurings), a successor entity's Zefix record can carry over a legacy UID. `ehraid` is always the unique key; `byUid` returns every firm record matching that UID.

**Why do `cantons` / `legalFormIds` / `statuses` filters apply client-side?**  Zefix's public search endpoint doesn't honor server-side filter parameters for these fields, so this actor fetches a large batch of name matches and filters them locally — the filtered results are exactly as accurate, just computed after the fetch.

**Why is `shabPublications` capped at 30 by default?**  Long-established companies (banks, insurers) can accumulate hundreds of SOGC/SHAB filings over decades. The 30 most recent are included per record by default to keep payloads manageable; raise `shabPublicationLimit` (up to 200) to fetch more, and `shabPublicationCount` always shows the true total regardless of the cap.

**Is `purpose` translated to English?**  No — it's the company's officially filed purpose text, in whichever official Swiss language (German/French/Italian) it was registered in.

**How fresh is the data?**  Real-time — every request reads live from Zefix's own public search/detail API, the same one the zefix.ch website itself uses.

**Is authentication required?**  No. This actor uses Zefix's public, unauthenticated search endpoints — no API key, login, or proxy needed.

**Can I search for deleted (struck-off) companies by name?**  No — Zefix's name-search index only covers active and in-liquidation companies. Deleted (`GELOESCHT`) companies are still fully retrievable, but only via a direct `byUid` or `byEhraid` lookup (e.g. from a UID you already have on file); the `statuses: ["GELOESCHT"]` filter in `mode=search` will never match, since the upstream search API itself excludes deleted firms.

# Actor input Schema

## `mode` (type: `string`):

What to fetch.

## `searchQuery` (type: `string`):

Free-text company name query.

## `searchType` (type: `string`):

How the company name query is matched.

## `uids` (type: `array`):

Swiss business identification numbers, e.g. `CHE-191.546.434` or `CHE191546434`.

## `ehraids` (type: `array`):

Zefix internal firm IDs (FCRO-ID / EHRAID), e.g. `1009345`.

## `legalFormIds` (type: `array`):

Restrict search results to one or more legal forms. Empty = no filter. Applied client-side after fetching results.

## `cantons` (type: `array`):

Restrict search results to one or more cantons (registry office). Empty = no filter. Applied client-side after fetching results.

## `statuses` (type: `array`):

Restrict search results to one or more registration statuses. Empty = no filter. Note: Zefix's name-search index only covers active (EXISTIEREND) and in-liquidation (IN\_AUFLOESUNG) companies — deleted (GELOESCHT) companies never appear via name search and can only be retrieved directly via mode=byUid or mode=byEhraid.

## `legalSeatQuery` (type: `string`):

Restrict search results to companies whose registered municipality (legal seat) contains this text, e.g. `Zurich` or `Genève`. Case-insensitive; accented and unaccented forms both match. Empty = no filter. Applied client-side after fetching results.

## `includeFullDetails` (type: `boolean`):

Fetch the full detail record (address, purpose, auditors, branches, SOGC/SHAB publication history) for each matched company. Slower (1 extra request per result) but much richer output. byUid and byEhraid modes always return full details.

## `shabPublicationLimit` (type: `integer`):

How many of the most recent SOGC/SHAB (Swiss Official Gazette of Commerce) publications to include per company, when full details are fetched. Only applies to records with detail data (byUid, byEhraid, or search with includeFullDetails=true).

## `maxItems` (type: `integer`):

Hard cap on emitted records.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "Nestle",
  "searchType": "contains",
  "uids": [],
  "ehraids": [],
  "legalFormIds": [],
  "cantons": [],
  "statuses": [],
  "legalSeatQuery": "",
  "includeFullDetails": false,
  "shabPublicationLimit": 30,
  "maxItems": 50
}
```

# Actor output Schema

## `companies` (type: `string`):

Dataset containing all scraped Zefix companies.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "search",
    "searchQuery": "Nestle",
    "searchType": "contains",
    "uids": [],
    "ehraids": [],
    "legalFormIds": [],
    "cantons": [],
    "statuses": [],
    "legalSeatQuery": "",
    "includeFullDetails": false,
    "shabPublicationLimit": 30,
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/zefix-company-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "search",
    "searchQuery": "Nestle",
    "searchType": "contains",
    "uids": [],
    "ehraids": [],
    "legalFormIds": [],
    "cantons": [],
    "statuses": [],
    "legalSeatQuery": "",
    "includeFullDetails": False,
    "shabPublicationLimit": 30,
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/zefix-company-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "search",
  "searchQuery": "Nestle",
  "searchType": "contains",
  "uids": [],
  "ehraids": [],
  "legalFormIds": [],
  "cantons": [],
  "statuses": [],
  "legalSeatQuery": "",
  "includeFullDetails": false,
  "shabPublicationLimit": 30,
  "maxItems": 50
}' |
apify call crawlerbros/zefix-company-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlerbros/zefix-company-search-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/EUEfNkLYKIOuu2bnu/builds/BSDOrETlemkgKxwKm/openapi.json
