# NHS Jobs Search Scraper (`jobsapi/nhs-jobs-search-scraper`) Actor

Extract rich NHS Jobs records with clean job sections, person-specification criteria, employer and contact details, structured locations, pay bands, salaries, contracts, dates, regulatory checks, documents, and application links.

- **URL**: https://apify.com/jobsapi/nhs-jobs-search-scraper.md
- **Developed by:** [Jobs API](https://apify.com/jobsapi) (community)
- **Categories:** Jobs, Automation, Developer tools
- **Stats:** 1 total users, 0 monthly users, 22.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 job details

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

## NHS Jobs Search Scraper

This Apify Actor extracts complete, publicly visible job adverts from [NHS Jobs](https://www.jobs.nhs.uk). It uses bounded direct HTTPS requests and Cheerio against the official search-results and `candidate/jobadvert` pages. No login, proxy, browser fingerprint spoofing, CAPTCHA solver, cloud call, or publish action is used.

### Supported modes

- `search`: one `query` and optional `location` (the default).
- `searchMultiple`: several `queries`, deduplicated by NHS job ID while retaining `matchedQueries`.
- `single`: one official detail URL in `jobUrl`.
- `multiple`: several official detail URLs in `jobUrls`.
- `startUrls`: official NHS Jobs search-results and/or detail URLs in `startUrls`.

Every search candidate is verified through its official detail page before it is written. Search and detail work is bounded by `maxItems`, `maxCandidates`, `maxPages`, `maxDetailRequests`, and `maxRequests`.

### Input examples

Search:

```json
{
  "mode": "search",
  "query": "nurse",
  "location": "London",
  "maxItems": 3,
  "maxPages": 2
}
```

Single detail:

```json
{
  "mode": "single",
  "jobUrl": "https://www.jobs.nhs.uk/candidate/jobadvert/A5412-26-0001"
}
```

The repository also contains `INPUT-multiple.json`, `INPUT-search-multiple.json`, `INPUT-start-urls.json`, and `INPUT-negative.json` for bounded local checks.

### Output

Job records contain the stable NHS job ID, canonical/detail/source URLs, title, employer, public employer website/address, location parts, summary, duties, employer information, detailed description text and HTML, parsed description sections, person-specification criteria, regulatory notices, pay scheme/band/salary, contract and working pattern, dates, public supporting-document links, source-backed application URL when present, search attribution, request receipts, and data-quality metadata.

Direct personal contact fields are intentionally omitted. Placeholder criteria such as “Please see Job Description”, blank strings, nulls, empty arrays, and empty objects are omitted rather than turned into fabricated values. Failed public requests are represented as structured `diagnostic` records and KVS evidence rather than invalid job rows.

### Local validation

Run from this directory:

```powershell
npm ci --ignore-scripts --no-audit --no-fund
npm test
npm run check
apify validate-schema .actor/input_schema.json
apify run --purge --input-file INPUT.json
npm run validate
```

The run writes the default dataset and `RUN_SUMMARY`, `OUTPUT_SUMMARY`, `RUN_DIAGNOSTICS`, `RUN_METADATA`, and `RUN_HEALTH` to local storage. The workflow is bounded local and cloud; do not use `apify call` or `apify push`.

### Runtime and output contract

The Actor supports bounded local and Apify cloud runs. The default dataset contains only complete job records; request failures and other diagnostics are retained in RUN\_DIAGNOSTICS in the default key-value store. maxRequests caps total HTTP attempts, and deadlineSeconds caps wall-clock runtime. Raw input is not persisted in run metadata.

# Actor input Schema

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

Search one query, search several queries, fetch one or many detail URLs, or process official listing/detail start URLs.

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

Job title, profession, specialty, or keyword for search mode.

## `queries` (type: `array`):

Queries used by searchMultiple mode; searchQueries is accepted as an alias.

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

UK city, region, or postcode used to narrow search results.

## `startUrls` (type: `array`):

Official https://www.jobs.nhs.uk candidate search-results or jobadvert URLs for startUrls mode.

## `jobUrl` (type: `string`):

One official NHS Jobs candidate/jobadvert URL for single mode.

## `jobUrls` (type: `array`):

Official NHS Jobs candidate/jobadvert URLs for multiple mode.

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

Maximum complete job records to save.

## `maxCandidates` (type: `integer`):

Maximum distinct listing candidates considered before detail enrichment.

## `maxPages` (type: `integer`):

Maximum listing pages per search task.

## `maxDetailRequests` (type: `integer`):

Bound on official detail requests during one run.

## `maxRequests` (type: `integer`):

Hard total request budget including listing and detail pages.

## `timeoutMs` (type: `integer`):

Timeout for each public NHS Jobs request.

## `retries` (type: `integer`):

Limited retries for transient failures only.

## `deadlineSeconds` (type: `integer`):

Hard wall-clock limit for this bounded run.

## Actor input object example

```json
{
  "mode": "search",
  "query": "nurse",
  "location": "London",
  "maxItems": 3,
  "maxCandidates": 12,
  "maxPages": 2,
  "maxDetailRequests": 12,
  "maxRequests": 24,
  "timeoutMs": 20000,
  "retries": 1,
  "deadlineSeconds": 120
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

## `runHealth` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jobsapi/nhs-jobs-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("jobsapi/nhs-jobs-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 '{}' |
apify call jobsapi/nhs-jobs-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jobsapi/nhs-jobs-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/Wj2ilnZDaiov9Y4uP/builds/oVirlaqp93dNAR2Fw/openapi.json
