# jobs.ch Jobs Scraper - Switzerland, Salary & Descriptions (`aigrator/jobs-ch-jobs-api`) Actor

Scrape jobs.ch vacancies for all of Switzerland: keyword and city search, structured CHF salary, full description, workload percentage and employment type. One row per job with company, canton, apply URL and monitor mode for new and closed postings.

- **URL**: https://apify.com/aigrator/jobs-ch-jobs-api.md
- **Developed by:** [Ярослав Литовченко](https://apify.com/aigrator) (community)
- **Categories:** Jobs, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 jobs

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

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## jobs.ch Jobs Scraper

Scrapes [jobs.ch](https://www.jobs.ch), the largest Swiss job board, from two public endpoints the site's own frontend uses:

- `GET /api/v1/public/search` — 20 rows per page: id, title, company, city, publication date, teaser, coordinates, employment type ids, workload.
- `GET /{lang}/vacancies/detail/{id}` — the detail page, whose JSON-LD carries the full description, the structured CHF salary, the canton, the exact workload and the employer's website.

No browser, no captcha solving, no proxy on the measured path. One job row per item.

### What you get

| Field | Notes |
| --- | --- |
| `jobId`, `title`, `company` | UUID from the detail URL, used as the monitoring key |
| `location`, `city`, `state`, `postalCode`, `streetAddress` | `state` is the canton from the detail page |
| `coordinates` | lat/lon from the search document |
| `salary`, `salaryText` | `{min, max, currency: CHF, period, annualMin, annualMax}` from JSON-LD, not guessed from text |
| `descriptionText`, `descriptionHtml` | full posting text, HTML kept up to 40 000 characters |
| `employmentType`, `employmentTypes` | permanent, temporary, freelance, internship, apprenticeship |
| `positionLevel` | executive, specialist, employee |
| `workloadMin`, `workloadMax` | percent; derived from weekly hours where the board gives only hours (42 h = 100%) |
| `weeklyHoursMin`, `weeklyHoursMax` | as published |
| `category`, `categoryCode` | occupation path from the detail page |
| `openings`, `postedAt`, `firstPublishedAt`, `startDate` | from JSON-LD |
| `applyUrl`, `detailUrl` | detail page in the chosen language |
| `companyWebsite`, `companyLogoUrl`, `employerOverview` | employer data |
| monitor fields | `changeType`, `firstSeenAt`, `lastSeenAt`, `coreHash`, `descriptionHash`, `changes` |

### Input

| Field | Default | Meaning |
| --- | --- | --- |
| `query` | `software engineer` | keyword, matched by the board; empty with a type filter means the whole board |
| `location` | empty | city or canton; empty means all of Switzerland |
| `maxJobs` | 200 | per-run ceiling, also the cost ceiling; 0 = no limit up to 20 000 |
| `employmentType` | empty | local post-filter, see the limits below |
| `language` | `en` | `en`, `de` or `fr` detail pages |
| `includeDescription` | true | one extra request per job for description, salary, canton |
| `monitorMode`, `stateKey` | false | return only new, updated and closed jobs |
| `proxyConfiguration` | off | the measured path answers a datacenter address |

### Measured runs

Apify datacenter IPs (AWS us-east-1), `language=en`, build 0.1.3–0.1.6, November 2026. Costs are the platform's own accounting, cross-checked against compute units at $0.20/CU plus $5 per 1M dataset writes.

| Input | Rows | Requests | Seconds | Platform cost | Salary | Descriptions |
| --- | --- | --- | --- | --- | --- | --- |
| `software engineer`, max 20 | 20 | 21 | 10.6 | $0.0008 | 17/20 (85%) | 20/20 |
| `software engineer`, max 200 | 200 | 210 | 81.4 | $0.0056 | 188/200 (94%) | 200/200 |
| `software engineer`, whole result set, max 1000 | 779 | 818 | 859.1 | $0.0518 | 340/779 (43.6%) | 779/779 |
| `software engineer`, card-only, max 50 | 50 | 3 | 3.0 | $0.0005 | — | 0 |
| `software`, Zürich, max 20 | 20 | 21 | 9.9 | $0.0008 | 18/20 (90%) | 20/20 |
| `manager` + apprenticeship, card-only, cap hit | 7 | 60 | 19.9 | $0.0012 | — | 0 |
| empty keyword + internship, card-only | 5 | 36 | 12.6 | $0.0008 | — | 0 |

Cost per 1 000 rows: **$0.028** for a 200-row run, **$0.067** for the full 779-row set, where 540 of the 859 seconds were spent waiting out HTTP 403 backpressure. Card-only runs are 20–40× cheaper: three search requests, no detail pages.

200-row run details: 200 unique ids, 199 cantons, 177 employer websites, 176 coordinate pairs, salary range CHF 48 900–160 000/year, 60.2 MB of HTML.

Whole 779-row set: salary range CHF 41 533–172 250/year, 218.9 MB of HTML, 39 search pages. Employment types: 412 permanent, 229 full-time, 131 without a type, 3 temporary, 2 freelance, 1 internship, 1 apprenticeship.

Market size on the same day: 36 974 open jobs, `software` 1 834, `software engineer` 778, Zürich (`software`) 575, Bern 212, Genève 104, Lausanne 28.

### Limits, honestly

- **20 rows per page is a hard maximum.** `rows=25` answers HTTP 422. The whole `software engineer` set is 39 pages; the whole board is 1 849 pages.
- **Only `query`, `location`, `sort`, `page` and `rows` are honoured.** Twenty other parameter names (`employment_type_ids`, `category`, `region`, `company`, `published_since`, …) were tested and silently ignored. Everything else has to be filtered after parsing, which is why `employmentType` is a local filter.
- **The local type filter is capped at 60 pages** (1 200 rows) and says so in `warnings`. Verified: `manager` + `apprenticeship` scanned 1 200 rows, returned 7, warned, in 19.9 s.
- **Long runs do get HTTP 403.** Measured: a 400-request probe at 2.2 req/s finished clean, but the 779-row run was refused twice (after roughly 170 and 540 detail pages) and needed 90 s and 180 s waits. The client treats 403/429 as backpressure, waits and retries; the run completes, it just costs wall-clock time. That is why 779 rows took 859 s instead of ~360 s.
- **Salary coverage depends on how deep you read.** The top 200 rows by relevance are 94% salary; the whole 779-row set is 43.6%, because postings from older batches (roughly rows 500–699) almost never publish pay. `null` means the employer published none, not that parsing failed. The range is always CHF/year after annualisation.
- **No structured remote or hybrid field.** `workplaceType` is `null` and `isRemote` is `false` by design; guessing from the description would be wrong often enough to matter.
- **131 of 779 postings carry no employment type at all**, neither in the search ids nor in the JSON-LD label. Those rows say `null` rather than a guess.
- **Canton coverage drops with depth**: 87/100 in the newest rows, 36–39/100 in the oldest, because older postings omit the structured address.
- **Not every posting is fresh.** The set spans June 2024 to today; the board keeps evergreen listings. Sort by `postedAt` if freshness matters.
- **Descriptions in `en` are the site's translation** of the German or French original. Use `language=de` or `fr` when the original wording matters. All three language versions answered 60/60 on the same 60 jobs; a missing version would keep the card-only row and count as a detail failure rather than fail the run.
- **A detail page is ~280 KB.** 779 jobs cost 219 MB of traffic; the parse is CPU work on the Actor side, not a proxy bill.
- **`robots.txt` disallows `/api/` and `/api_proxy/`.** The search endpoint sits under `/api/`, so this Actor reads a path the operator asks robots not to crawl. That is an operator risk, stated here rather than hidden: the detail pages are allowed and would be the fallback.
- **Rate**: 2 detail requests in parallel with a 300 ms pause each. 5 parallel requests with no pause reach ~8 req/s and are refused after roughly 550 pages.

### Cost and pricing

Platform usage measured **$0.0056 per 200 rows** and **$0.0518 per 779 rows** (compute at $0.20/CU plus dataset writes). The recommended pay-per-event price is a single `job` event at **$1.50 per 1 000 rows** ($0.0015 per job), plus `apify-actor-start` at $0.00005. No dataset-item event. At the worst measured platform cost that is a ~22× margin; at 200 rows, ~53×.

Card-only runs (no description, no salary) cost roughly $0.0005 per 50 rows and are the cheap way to watch a whole market.

### Monitor mode

The first run per state key stores a baseline and returns every row, billed like a snapshot. Later runs return only `new`, `updated` and `closed` rows; only new and updated are charged. Closures need two consecutive empty searches before they are reported, because one empty response is far more often an outage than a board that emptied overnight. The state is scoped to the Task automatically; `stateKey` only matters for direct runs or several profiles inside one Task. Changing the keyword, location, type or language starts a new baseline.

Verified through a Task on build 0.1.5: first run 5 rows with `baseline=true`, second run 0 rows plus a `no_changes` status row, $0.0004 per run.

### Tests

```
npm run check          # syntax
npm run check:salary   # 41 shared salary cases, identical file across the catalogue
npm run test:parser    # 47 assertions on a saved search page and a saved detail page
```

The parser test uses `scripts/fixtures/search-software-en.json` (20 real documents) and `scripts/fixtures/detail-software-en.html` (one real detail page), so a board redesign fails the build instead of silently returning empty rows.

The 403/429 retry path has a separate local test against a fake server (13 assertions: 403 twice then 200, permanent 403 → `BlockedError`, `Retry-After` honoured, 502 retried as transient, 404 passed through). It is not in the repository because it needs a listening socket; run it from `%TEMP%` when the client changes.

### Notes for the operator

- The Actor version is `0.1` with the `latest` tag; a successful `apify push` is live immediately, no republish step.
- `icon.png` is currently a copy of the SEEK Actor icon and must be replaced before the Store listing goes public.
- `src/lib/salary.js` and `scripts/salary-cases.mjs` are byte-identical with the other Actors in this catalogue (SHA-256 `11CE498B…` and `78FEBB7C…`). Do not edit one copy alone.
- Default memory is 1 024 MB. The run peaked at 219 MB of traffic and 779 detail pages without pressure; do not raise it, compute is billed per GB-second.

### Changelog

- **0.1.5** — README rewritten with settled platform costs, salary coverage by depth and the 403 behaviour.
- **0.1.4** — an empty keyword with a type filter no longer falls back to the demo search; it scans the whole board (capped at 60 pages) instead of silently narrowing the filter.
- **0.1.3** — detail pacing set to the measured safe rate (2 in parallel, 300 ms pause) and 403/429 handled as backpressure with a 90 s / 180 s retry, `Retry-After` respected. 779-row run completed through two block windows.
- **0.1.2** — cap the local employment-type scan at 60 pages; warn instead of walking the board.
- **0.1.1** — first working version: search paging, detail enrichment, structured salary, monitor mode, 47 parser assertions.

# Actor input Schema

## `query` (type: `string`):

What to search for: software engineer, Pflegefachfrau, comptable, project manager. The board matches the keyword on its own side. Leave empty with no type filter to run the demo search (software engineer). With a type filter set, an empty keyword means the whole board: the Actor then scans it newest-first and stops at 60 pages.

## `location` (type: `string`):

City or canton as the site writes it: Zurich, Zürich, Bern, Genève, Basel, Lausanne. Leave empty for all of Switzerland. The board matches this loosely, so a misspelled city returns fewer rows rather than an error.

## `maxJobs` (type: `integer`):

Stop after this many jobs. The Actor charges per returned job, so this is also the per-run cost ceiling. Set 0 for no limit, up to 20000.

## `employmentType` (type: `string`):

Keep only one type. Empty means every type. The board ignores this filter, so the Actor collects rows first and drops the other types locally: a run can return fewer than maxJobs. The scan stops at 60 pages (1200 rows); narrow the keyword or add a location to reach the rest.

## `language` (type: `string`):

Language of the detail page and therefore of the description and apply URL. jobs.ch publishes German, French and English versions of most postings; the English one is the site's translation of the original.

## `includeDescription` (type: `boolean`):

On: one extra request per job returns the full description, the structured CHF salary, the canton, the workload and the real employment type. Off: card-only rows from the search page, roughly ten times faster and cheaper, but without description and salary.

## `monitorMode` (type: `boolean`):

On the first run per state key the Actor stores a baseline and returns the full list, billed per row like a snapshot. Later runs return only new, updated and closed jobs; only new and updated are charged. If the search suddenly returns nothing, closures are reported only after a second consecutive empty run. Changing the keyword, location, type or language starts a new baseline.

## `stateKey` (type: `string`):

Leave empty: the state is scoped to the current Apify Task automatically, so different Tasks never share a baseline. Fill it only if you run the Actor directly (without a Task) or need several independent monitoring profiles inside one Task.

## `proxyConfiguration` (type: `object`):

The measured endpoints answer a datacenter address, so no proxy is needed. Enable one only if your own runs start getting HTTP 403. The Actor never switches to a proxy on its own.

## Actor input object example

```json
{
  "query": "software engineer",
  "maxJobs": 200,
  "employmentType": "",
  "language": "en",
  "includeDescription": true,
  "monitorMode": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `jobs` (type: `string`):

One row per job, plus an optional status row when nothing changed or nothing matched. Fields are described in the dataset schema.

# 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 = {
    "query": "software engineer"
};

// Run the Actor and wait for it to finish
const run = await client.actor("aigrator/jobs-ch-jobs-api").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 = { "query": "software engineer" }

# Run the Actor and wait for it to finish
run = client.actor("aigrator/jobs-ch-jobs-api").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 '{
  "query": "software engineer"
}' |
apify call aigrator/jobs-ch-jobs-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,aigrator/jobs-ch-jobs-api"
        }
    }
}
```

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/P5nFjgtU7dDBoS8n7/builds/FM7uvx3PHfG8OKqiM/openapi.json
