# UK Civil Service Jobs Scraper (`govjobsdata/uk-civil-service-jobs-scraper`) Actor

Scrape every UK Civil Service Jobs vacancy from civilservicejobs.service.gov.uk: title, department, grade, salary band, location, closing date, reference and apply link. No login, no official API needed. Export to JSON/CSV or call via MCP for AI agents. Pay per result.

- **URL**: https://apify.com/govjobsdata/uk-civil-service-jobs-scraper.md
- **Developed by:** [GovJobs Data](https://apify.com/govjobsdata) (community)
- **Categories:** Jobs
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 job results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## UK Civil Service Jobs Scraper

Scrape **civil service jobs** and **UK government jobs** from [civilservicejobs.service.gov.uk](https://www.civilservicejobs.service.gov.uk) into clean, structured JSON — **no API key and no login required**. Get every live Civil Service vacancy with title, department, grade, salary band, location, closing date, reference number and a direct apply link.

> There is no official Civil Service Jobs API, and the popular free GitHub scraper stopped working in February 2025. This Actor is the maintained, structured way to get the data — export to JSON/CSV/Excel or call it from an AI agent via MCP.

### What does UK Civil Service Jobs Scraper do?

It scrapes live UK Civil Service vacancies straight from the official `civilservicejobs.service.gov.uk` recruitment site and returns each one as a structured record. Run it with no configuration to pull **every current vacancy**, or filter by keyword, department or location. The site sits behind an ALTCHA browser check and has no public API — this Actor handles that for you and gives you analysis-ready data.

- ✅ Every live vacancy, refreshed on each run (no stale cache)
- ✅ Structured fields: title, department, grade, salary (min/max + raw), location, contract type, working pattern, closing date, reference, apply URL
- ✅ Export to **JSON, CSV, Excel, XML** or stream via API & webhooks
- ✅ **MCP-ready** — callable by Claude, ChatGPT and other AI agents
- ✅ Zero-config: just press **Start**

### What data can I extract?

| Field | Type | Example |
|---|---|---|
| `title` | string | `Senior Data Scientist` |
| `department` | string | `Department for Work and Pensions` |
| `grade` | string | `Grade 7` |
| `salaryMin` | number\|null | `54358` |
| `salaryMax` | number\|null | `65000` |
| `salaryText` | string | `£54,358 - £65,000` |
| `location` | string | `Leeds, Manchester` |
| `contractType` | string | `Permanent` |
| `workingPattern` | string | `Full-time` |
| `closingDate` | string (ISO) | `2026-07-04` |
| `reference` | string | `388291` |
| `applyUrl` | string | `https://www.civilservicejobs.service.gov.uk/csr/jobs.cgi?jcode=388291` |
| `description` | string | full job summary, person spec, selection process… |
| `scrapedAt` | string (ISO) | `2026-06-17T09:12:00Z` |

### Why scrape Civil Service Jobs? (use cases)

- 📊 Track UK government hiring trends and headcount growth by department
- 💷 Benchmark Civil Service salary bands and grades
- 🔔 Monitor new vacancies daily and trigger alerts / Slack / email
- 🤖 Feed structured gov-jobs data to an AI job-search or research agent via MCP
- 🏛️ Fill the analytical gap — even the Institute for Government lacks vacancy-level data

### Is there an official Civil Service Jobs API?

No. A Civil Service Jobs API existed around 2009 but was retired around 2012, and the `data.gov.uk` dataset was discontinued (last updated 2016). Today the data is only available as HTML on the live site, behind an ALTCHA browser check. **This Actor is the only maintained, structured way to access it** — it returns the same vacancies as the website, as JSON/CSV.

### Why did the free GitHub Civil Service jobs scraper stop working?

The well-known open-source scraper (`heathd/civil_service_jobs`) **stopped collecting data on 19 February 2025**, when the site added a CAPTCHA its HTTP-only approach couldn't pass. This Actor is the maintained, ALTCHA-solved replacement: it runs a real browser, clears the check automatically, and keeps a stable, named output schema.

### How to use it (Quick Start)

1. Click **Start** with the default input to scrape all current vacancies (or set **Max results** to cap spend while testing).
2. Optionally add a **Search keyword**, **Department** or **Location** filter.
3. Wait for the run to finish (a capped test run returns in ~2–3 minutes).
4. Download results as **JSON / CSV / Excel**, or pull them via the API.

### Input

```json
{
  "searchKeyword": "data",
  "departments": ["Department for Work and Pensions"],
  "location": "Manchester",
  "maxResults": 100,
  "includeFullDescription": true,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
````

All fields are optional. An empty input `{}` scrapes every live vacancy.

### Output sample

```json
{
  "title": "Senior Data Scientist",
  "department": "Department for Work and Pensions",
  "grade": "Grade 7",
  "salaryMin": 54358,
  "salaryMax": 65000,
  "salaryText": "£54,358 - £65,000",
  "location": "Leeds, Manchester",
  "contractType": "Permanent",
  "workingPattern": "Full-time",
  "closingDate": "2026-07-04",
  "closingText": "11:55 pm on Sunday 4th July 2026",
  "reference": "388291",
  "applyUrl": "https://www.civilservicejobs.service.gov.uk/csr/jobs.cgi?jcode=388291",
  "scrapedAt": "2026-06-17T09:12:00Z"
}
```

Exports: JSON, CSV, Excel, XML, plus API access and webhooks.

### Pricing

**$0.005 per result.** Failed runs are not charged, and the **first 25 results are free** so you can try it risk-free. A full scrape of every live vacancy (~2,000) costs roughly **$5–$20** — there is no other structured source for this data.

### How fresh is the data?

Every run fetches **live data at execution time** — there is no cached copy. Schedule a daily run to keep a continuously fresh feed of UK government vacancies.

### Use it with AI agents (MCP)

This Actor is exposed through Apify's MCP server at **`https://mcp.apify.com`**, so AI agents (Claude, ChatGPT, LangChain, custom agents) can call it per query — e.g. *"find current Grade 7 data roles in DEFRA closing this month."*

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com",
      "headers": { "Authorization": "Bearer <YOUR_APIFY_TOKEN>" }
    }
  }
}
```

### Is it legal to scrape Civil Service Jobs?

This Actor collects **public job postings only** — no personal data. The vacancy content is Crown copyright, published under the **Open Government Licence v3.0**, and collection is supported by a documented Legitimate Interest Assessment.

> **Disclaimer:** This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by the UK Civil Service, the Cabinet Office, or any government department.

### Why GovJobs Data?

- **Reliability is the product.** Government sites change layouts and add bot-checks — we maintain this scraper so it keeps working, including the CAPTCHA handling that breaks DIY scripts.
- **Clean, predictable output.** Flat JSON, stable field names, ISO dates — ready for spreadsheets, databases, and AI agents, every time.
- **Compliance-first.** Public, non-personal job postings only, under the Open Government Licence — and recruiter contact details are automatically redacted.
- **We respond.** Need an extra field, a new filter, or hit a problem? Open an issue — we take requests and fix breakages fast.

*Built and maintained by **GovJobs Data** — structured, reliable UK government & public-sector datasets.*

### FAQ

<details>
<summary>Do I need a paid Apify plan?</summary>
No. You can run it on the free plan; pay-per-result charges only apply beyond the first 25 free results.
</details>

<details>
<summary>What happens if a run fails?</summary>
Failed runs are not charged. The Actor retries and resumes, deduplicating by reference number.
</details>

<details>
<summary>Can I limit how much I spend?</summary>
Yes — set <code>maxResults</code>, and/or set a maximum total charge on the run.
</details>

<details>
<summary>Can I call it from code or an AI agent?</summary>
Yes — via the Apify API, scheduler, webhooks, or MCP (see above).
</details>

### Related Actors

- UK Tool & Plant Hire Rates Scraper *(coming soon)*
- Toolstation Price & Stock Scraper *(coming soon)*

### Changelog

- **v1.0.0** — Initial release (2026-06). Full live-vacancy scrape, ALTCHA handling, structured schema, MCP support.

***

*Maintained by **GovJobs Data**. Questions, a missing field, or a dataset request → open an issue on this Actor and we'll respond.*

# Actor input Schema

## `searchKeyword` (type: `string`):

Optional free-text keyword to filter vacancies by title/department (e.g. 'data', 'policy'). Leave empty to scrape ALL live postings.

## `departments` (type: `array`):

Optional list of department names to filter by (matched as substrings). Empty = all departments.

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

Optional city or region filter (e.g. 'Manchester', 'London'). Empty = all locations.

## `maxResults` (type: `integer`):

Maximum vacancies to return. Caps your spend. 0 = no limit (scrape everything).

## `includeFullDescription` (type: `boolean`):

Visit each vacancy detail page to extract the full description and side-panel fields (slower, more pages). Turn off for a fast listing-only scrape.

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

Proxy settings. The default datacenter proxy works out of the box; UK residential (GB) is recommended for large or frequent runs.

## Actor input object example

```json
{
  "searchKeyword": "software",
  "departments": [],
  "maxResults": 100,
  "includeFullDescription": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "searchKeyword": "",
    "departments": [],
    "location": "",
    "maxResults": 100,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("govjobsdata/uk-civil-service-jobs-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 = {
    "searchKeyword": "",
    "departments": [],
    "location": "",
    "maxResults": 100,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("govjobsdata/uk-civil-service-jobs-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchKeyword": "",
  "departments": [],
  "location": "",
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call govjobsdata/uk-civil-service-jobs-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=govjobsdata/uk-civil-service-jobs-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "UK Civil Service Jobs Scraper",
        "description": "Scrape every UK Civil Service Jobs vacancy from civilservicejobs.service.gov.uk: title, department, grade, salary band, location, closing date, reference and apply link. No login, no official API needed. Export to JSON/CSV or call via MCP for AI agents. Pay per result.",
        "version": "1.0",
        "x-build-id": "WQWkxb0nWwI4gv2KX"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/govjobsdata~uk-civil-service-jobs-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-govjobsdata-uk-civil-service-jobs-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/govjobsdata~uk-civil-service-jobs-scraper/runs": {
            "post": {
                "operationId": "runs-sync-govjobsdata-uk-civil-service-jobs-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/govjobsdata~uk-civil-service-jobs-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-govjobsdata-uk-civil-service-jobs-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchKeyword": {
                        "title": "Search keyword",
                        "type": "string",
                        "description": "Optional free-text keyword to filter vacancies by title/department (e.g. 'data', 'policy'). Leave empty to scrape ALL live postings."
                    },
                    "departments": {
                        "title": "Departments / agencies",
                        "type": "array",
                        "description": "Optional list of department names to filter by (matched as substrings). Empty = all departments.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "location": {
                        "title": "Location / region",
                        "type": "string",
                        "description": "Optional city or region filter (e.g. 'Manchester', 'London'). Empty = all locations."
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum vacancies to return. Caps your spend. 0 = no limit (scrape everything).",
                        "default": 0
                    },
                    "includeFullDescription": {
                        "title": "Include full job description",
                        "type": "boolean",
                        "description": "Visit each vacancy detail page to extract the full description and side-panel fields (slower, more pages). Turn off for a fast listing-only scrape.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Proxy settings. The default datacenter proxy works out of the box; UK residential (GB) is recommended for large or frequent runs.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
