# UK Parliament Members Scraper (`parseforge/members-uk-parliament-scraper`) Actor

Scrapes UK Parliament members from the official directory. Returns name, house, party, gender, status, constituency, and optional biography and contact details.

- **URL**: https://apify.com/parseforge/members-uk-parliament-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $23.25 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### UK Parliament Members Scraper

**Scrape every UK MP and peer from the official Parliament directory, with biography and contact details.** Filter by house, party, gender, status, or constituency, and export clean rows to CSV, JSON, Excel, or XML.

The UK Parliament website lists every current and former MP and peer, but browsing it member by member is slow and the data is not exportable. This Actor reads the public directory directly, applies your filters as it goes, and returns each match in one fixed schema. No API key or registration is needed.

| Who uses it | What they scrape UK Parliament for |
|---|---|
| Public affairs consultants | Build a current list of MPs and peers for stakeholder mapping |
| Journalists and researchers | Pull contact details and committee roles for a story |
| NGOs and campaigners | Identify MPs by constituency or party for targeted outreach |
| Data analysts | Create a structured dataset of Parliament membership over time |
| Academic researchers | Study representation by gender, party, or chamber |

### What it does

This Actor collects UK Parliament members by name, house, party, gender, status, or constituency, and returns each one as a flat row with optional biography and contact details.

- 🏛️ **Both chambers:** House of Commons MPs and House of Lords peers, together or separately.
- 🔍 **Flexible filters:** name substring, party, gender, current or former status, and constituency.
- 📇 **Detailed profiles:** optional biography, committees, posts, and contact details per member.
- 📊 **Structured output:** one flat row per member, ready for CSV, JSON, Excel, or XML.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with UK Parliament data

**🗳️ Build a stakeholder map.**

A public affairs team runs the Actor with house=Commons and party filters to get a current list of MPs with contact details for outreach.

**📰 Research a story.**

A journalist filters by constituency to find the local MP and pulls their biography and committee roles for background.

**📈 Track representation.**

An academic researcher collects all members with gender and party to analyse diversity in Parliament over time.

**📋 Update a CRM.**

An NGO runs the Actor weekly with membershipStatus=current to refresh their database of MPs and peers.

### Why choose this scraper

| | What you get |
|---|---|
| **Official source** | Data comes straight from the UK Parliament public directory |
| **No API limits** | Reads the public pages directly, no key or rate limit to manage |
| **Historical coverage** | Includes former members, not current ones |
| **Rich enrichment** | Optional biography and contact details per member |

### How it compares

This Actor offers the same core directory data as the other UK Parliament scraper, with the added option to enrich each member with biography and contact details.

| Feature | ParseForge | UK Parliament Members Scraper - MP and Peer Data |
|---|---|---|
| Name, party, house, status, dates, gender, thumbnail | Yes | Yes |
| Constituency filter | Yes | Not listed |
| Biography and contact details | Yes | Not listed |
| Former members included | Yes | Not listed |
| Party filter | Yes | Not listed |

### Configure the run

Drive the Actor with a name substring, house, party, gender, membership status, or constituency, and filters run as each member is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "maxItems": 10
}
```

A larger pull:

```json
{
 "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.031 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $3.10 |
| 1,000 results | $31.00 |
| 10,000 results | $310.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [UK Parliament Members Scraper](https://apify.com/parseforge/members-uk-parliament-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to UK Parliament through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/members-uk-parliament-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check your filters. The name and constituency fields are substring matches, so a typo or overly specific value can return nothing. Try clearing filters or broadening the substring.

**Why is the run slow?**

If 'Fetch Detailed Profile' is enabled, the Actor makes an extra request per member. Disable it for a faster run, or reduce 'Maximum members'.

**Why are some fields empty?**

Not all members have every field populated on the Parliament website. For example, Lords do not have a constituency, and some former members may lack contact details.

**Can I get only current MPs?**

Yes. Set 'Current or Former' to 'Currently sitting members' and 'House' to 'House of Commons (MPs)'.

### FAQ

| Question | Answer |
|---|---|
| Does this include the House of Lords? | Yes. Set the House filter to 'House of Lords (peers)' to get only peers, or leave it on 'Both Houses' to get MPs and peers together. |
| Can I get former members? | Yes. The 'Current or Former' filter defaults to 'All (current + former)', so historical members are included unless you restrict it. |
| What does 'Fetch Detailed Profile' do? | When enabled, the Actor makes an extra request per member to retrieve their biography, committees, posts, and contact details. It is slower but gives a much richer record. |
| How do I filter by constituency? | Use the 'Constituency Substring' field. It only applies to House of Commons members and matches any part of the constituency name. |
| Is there a rate limit? | No. The Actor reads the public Parliament directory directly, so there is no API key or rate limit to manage. |
| What format is the output? | Each member is returned as a flat row. You can export the dataset to CSV, JSON, Excel, or XML from Apify. |
| Can I filter by party? | Yes. The Party filter includes all major parties, crossbench, bishops, and non-affiliated peers. |
| Does it include contact details? | Only if you enable 'Fetch Detailed Profile'. The basic run returns name, house, party, gender, status, and constituency. |
| How many members can I collect? | You can set 'Maximum members' up to 1,000,000 per run. The full directory is around 1,400 current members plus former ones. |
| Is the data up to date? | The Actor reads the live Parliament website, so it reflects the current directory at the time of the run. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by UK Parliament. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `name` (type: `string`):

Substring match on the member's display name. Leave empty to browse all members.

## `house` (type: `string`):

Restrict to one chamber. Default returns both.

## `party` (type: `string`):

Restrict to a single party.

## `gender` (type: `string`):

Filter by recorded gender.

## `membershipStatus` (type: `string`):

Filter to currently sitting members, former members, or include both. Defaults to 'all' so historical members are included.

## `constituency` (type: `string`):

Substring match on the Commons constituency name (ignored for Lords).

## `fetchDetails` (type: `boolean`):

When enabled, makes an extra request per member to retrieve biography (committees, posts, representations) and contact details. Slower but much richer output.

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

How many members to collect per run.

## Actor input object example

```json
{
  "name": "",
  "house": "",
  "party": "",
  "gender": "",
  "membershipStatus": "all",
  "constituency": "",
  "fetchDetails": true,
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

Overview of scraped data

## `fullData` (type: `string`):

Complete dataset

# 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 = {
    "name": "",
    "constituency": "",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/members-uk-parliament-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 = {
    "name": "",
    "constituency": "",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/members-uk-parliament-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 '{
  "name": "",
  "constituency": "",
  "maxItems": 10
}' |
apify call parseforge/members-uk-parliament-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/members-uk-parliament-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/SNp4RVpAwIhFuWxfp/builds/Ps7SjhWj31daNiDBS/openapi.json
