# jobdanmark-cli CLI for the [Jobdanmark.dk](https://www.jobdanmark.dk) public job search API. **Base URL**: `https://jobdanmark.dk` **Authentication**: None required. **Format**: All responses are JSON. --- ## Installation ```bash cd skills/jobdanmark-search/cli bun install ``` --- ## Commands | Command | Description | |---------|-------------| | `search` | Search job listings with filters | | `detail` | Full detail for a single job posting (by slug) | | `categories` | List all job categories with live counts | | `autocomplete` | Suggest job titles and categories for a query | | `locations` | Suggest municipalities, zip codes, and regions for a query | All commands accept `--format json|table|plain` (default: `json`). All errors are written to **stderr** as `{ "error": "...", "code": "..." }` and the process exits with code `1`. --- ## Job Types | Value | Danish | English | |-------|--------|---------| | `fuldtid` | Fuldtid | Full-time | | `deltid` | Deltid | Part-time | | `fleksjob` | Fleksjob | Flex job | | `elev` | Elev | Apprentice | | `studiejob` | Studiejob | Student job | | `praktik` | Praktik | Internship | --- ## Categories | ID | Danish Title | |----|-------------| | 227972 | Pædagogik, Uddannelse og Forskning | | 227973 | Håndværk, Industri, Transport og Landbrug | | 227974 | Salg, Kommunikation, Marketing, og Design | | 227975 | Pleje, Social og Sundhed | | 227976 | Hotel, Service, Restauration og Sikkerhed | | 227977 | Kontor, Finans og Økonomi | | 227978 | IT, Ingeniør og Energi | | 227979 | Ledelse, HR og projektstyring | | 543415 | Kirke, Kultur og Underholdning | | 227980 | Øvrige job | --- ## `search` — Search job listings **Endpoint**: `POST https://jobdanmark.dk/api/jobsearch/search/{page}` ```bash bun run src/cli.ts search [flags] ``` ### Flags | Flag | Type | Default | Description | |------|------|---------|-------------| | `--text` | string | — | Free-text keyword search (job title, keyword) | | `--category` | number | — | Category ID (see table above) | | `--jobtitle-id` | number | — | Job title ID from `autocomplete` results | | `--municipality` | string | — | Municipality name, e.g. `Odense`, `København` | | `--zip` | string | — | Zip code, e.g. `5000` | | `--region` | string | — | Region name | | `--job-type` | string | — | Comma-separated job types: `fuldtid,deltid,fleksjob,elev,studiejob,praktik` | | `--page` | number | `1` | Page number (30 items per page, server-enforced) | | `--limit` | number | — | Cap total results returned by CLI (client-side) | | `--format` | string | `json` | Output format: `json`, `table`, `plain` | > **Note**: Per-page is fixed at 30 by the API. There is no `--per-page` flag. > **Note**: Multiple `--job-type` values are passed as a comma-separated string and split by the CLI into the `jobTypes` array in the request body. ### Example ```bash bun run src/cli.ts search --text "elektriker" --job-type fuldtid --municipality "Odense" bun run src/cli.ts search --category 227978 --job-type "fuldtid,deltid" --page 2 --format table bun run src/cli.ts search --text "sygeplejerske" --zip 8000 --limit 10 ``` ### Request body sent to API ```json { "jobTypes": ["fuldtid"], "filters": [ { "type": "freetext", "value": "elektriker", "displayText": "elektriker" }, { "type": "municipality", "value": "Odense", "displayText": "Odense" } ], "locationMode": "Text", "distance": 50 } ``` > **Important**: All filter objects include a `displayText` field (required by the server). The `value` field is an integer for `category` and `jobtitle` filter types; a string for all others. ### Response shape ```json { "meta": { "currentPage": 1, "totalItems": 15610, "itemsPrPage": 30, "totalPages": 521 }, "results": [ { "title": "IT-chef søges til RAH", "companyName": "Rah Service A/S", "companyLogo": { "key": "71f1c950-abcd-1234-efgh-000000000000", "url": "https://jobdanmark.dk/media/k1epc2kk/rah-service-logo.jpg", "focalPoint": null }, "companyLogoSvgMarkup": null, "overlayColor": "#FFFFFF1F", "companyAddress": "Ndr Ringvej 4 6950 Ringkøbing", "jobTypes": ["fuldtid"], "boostJob": true, "publishedDate": "12-03-2026", "applicationDeadline": "10-04-2026", "url": "https://jobdanmark.dk/job/it-chef-soeges-til-rah", "slug": "it-chef-soeges-til-rah", "coverImage": { "key": "cf06eb46-abcd-1234-efgh-000000000000", "url": "https://jobdanmark.dk/media/idvbnt4y/rah-service-as-billede.png", "focalPoint": { "top": 0.488, "left": 0.499 } }, "silhouetteLogo": false } ] } ``` > **Notes**: > - `url` is normalized to a full URL (CLI prepends `https://jobdanmark.dk` to the relative path from the API). > - `slug` is extracted from the relative `url` field (the path segment after `/job/`). > - `applicationDeadline` can be `null`. > - `companyLogo` can be `null`. > - `publishedDate` format: `"DD-MM-YYYY"`. > - `coverImage` can be `null`. --- ## `detail` — Full job posting detail **Method**: Fetch HTML from `https://jobdanmark.dk/job/{slug}`. The CLI extracts a `