> **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.
> - Presentation-only keys the API sends (`coverImage`, `companyLogo`, `companyLogoSvgMarkup`, `overlayColor`, `silhouetteLogo`) are dropped from search output — they were ~40% of a live payload and an agent can never use them.
> - Every result also carries the cross-portal contract fields `company`, `location`, `date` and `deadline`, derived from `companyName`, the city after the postal code in `companyAddress`, and the day-first dates converted to `YYYY-MM-DD` — `/scrape` Step 2 expects search output to include title, company, location, date, and URL. Native fields are preserved unchanged.
**Method**: Fetch HTML from `https://jobdanmark.dk/job/{slug}`. The CLI extracts a `<script type="application/ld+json">` JobPosting block when present, and falls back to parsing the rendered job page HTML when Jobdanmark omits JSON-LD.
> **Note**: The `hiringOrganization.logo`, `validThrough`, and `applyUrl` fields may be `null` if not present in the structured data or rendered page. `jobLocation` fields may be `null` if the location data is absent.
bun run src/cli.ts autocomplete --query "sygeplejerske" --format table
```
### Response shape
```json
[
{
"title":"Jobtitler",
"items":[
{
"id":"title__454",
"text":"IT-konsulent",
"value":454,
"category":"jobtitle",
"slug":"it-konsulent"
},
{
"id":"title__123",
"text":"IT-supporter",
"value":123,
"category":"jobtitle",
"slug":"it-supporter"
}
]
},
{
"title":"Kategorier",
"items":[
{
"id":"category__227978",
"text":"IT, Ingeniør og Energi",
"value":227978,
"category":"category",
"slug":"it-ingenioer-og-energi"
}
]
}
]
```
> **Note**: Returns an empty array `[]` when no suggestions match. `value` is a numeric ID usable as `--jobtitle-id` or `--category` in `search`. Groups with no matching items are omitted from the response.
bun run src/cli.ts locations --query "8000" --format table
bun run src/cli.ts locations --query "Sjælland"
```
### Response shape
```json
[
{
"title":"Kommune",
"items":[
{
"id":"municipality__0461",
"text":"Odense",
"value":"Odense",
"category":"municipality",
"slug":"odense"
}
]
},
{
"title":"Postnummer",
"items":[
{
"id":"zip__5000",
"text":"5000 Odense C",
"value":"5000",
"category":"zip",
"slug":"5000-odense-c"
},
{
"id":"zip__5200",
"text":"5200 Odense V",
"value":"5200",
"category":"zip",
"slug":"5200-odense-v"
}
]
}
]
```
> **Note**: Returns `[]` when no locations match. The `value` field for municipalities is the display name (string); for zip codes it is the numeric string. Use `value` directly as `--municipality` or `--zip` in `search`.
---
## Error handling
All errors are written to **stderr** in JSON format and exit with code `1`:
```json
{"error":"Job not found","code":"NOT_FOUND"}
{"error":"API request failed: 400 Bad Request","code":"API_ERROR"}
{"error":"--query is required","code":"MISSING_REQUIRED"}
- Image URLs from the raw API (`companyLogo.url`, `coverImage.url`) are relative; prepend `https://jobdanmark.dk` if you consume the API directly (the CLI drops these keys)