The API always returns 20 results per page (fixed — no `--per-page` flag). The CLI parses the `result_list_box_html` HTML blob from the response to extract structured job records.
"description":"Vi søger en dygtig Data Engineer til at opbygge og vedligeholde vores dataplatform..."
}
]
}
```
**Field notes:**
-`id` — string ID prefixed with `h` (e.g. `h1647303`). Use this with the `detail` command.
-`company` — company name; may be `null` for some aggregated listings.
-`companyUrl` — company homepage URL; may be `null` if not present.
-`location` — city or area; may be `null` if not listed.
-`date` — ISO date string (`YYYY-MM-DD`) from the `datetime` attribute on the `<time>` element; may be `null`.
-`description` — short excerpt from the listing; may be `null` or empty.
-`url` — full Jobindex.dk URL for the listing.
-`total` in `meta` — parsed from `hitcount_html` (Danish thousands separator `.` is stripped before parsing, e.g. `18.903` → `18903`).
> **Note on area filtering**: The Jobindex API does not reliably support area/region filtering via query parameters. `area` and `geoareaid` params are silently ignored. To filter by location, use `--query` with a city name (e.g. `--query "python aarhus"`) or apply `--limit` and filter the JSON output externally.
bun run src/cli.ts detail <id> [--format json|plain]
```
The `id` is the job ID from `search` results (e.g. `h1647303`). The slug is optional — the CLI fetches the canonical URL by first constructing `https://www.jobindex.dk/jobannonce/{id}` and following any redirect, or by using the full URL from the `url` field in `search` results.
You may also pass the full URL directly as the `id` argument.
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: 500 Internal Server Error","code":"API_ERROR"}
{"error":"Failed to parse job listing HTML","code":"PARSE_ERROR"}
{"error":"--query is required","code":"MISSING_REQUIRED"}
```
---
## URL construction
Job detail pages on jobindex.dk:
-`https://www.jobindex.dk/jobannonce/{id}/{slug}`
The slug is part of the `url` returned by `search`. When calling `detail` with just an ID, the CLI fetches `https://www.jobindex.dk/jobannonce/{id}` which redirects to the full URL.
---
## Parsing notes
### Total count from `hitcount_html`
The API returns pagination info as an HTML string like:
```html
<divclass="jix_pagination_total"><strong>1</strong> til <strong>20</strong> af <strong>18.903</strong> resultater.</div>
```
Parse total with: `/af <strong>([\d.]+)<\/strong>/` and strip `.` before converting to integer.
### Job card selectors
Each job card is wrapped in `[data-beacon-tid]`. Inside, select:
| Field | Selector |
|-------|----------|
| `id` | `[data-beacon-tid]` attribute value |
| `title` | `h4 > a` text content |
| `url` | `h4 > a[href]` |
| `company` | `.jix-toolbar-top__company a` text |