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

Scrape UK House of Commons MPs and House of Lords peers from the official UK Parliament Members directory. Filter by House, party, gender, constituency or current/former status. Returns names, parties, constituencies, contact details, biographies, government posts and committee memberships.

- **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/platform/actors/running/actors-in-store#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 Banner](https://github.com/ParseForge/apify-assets/blob/main/banners/banner-default.jpg?raw=true)

## 🏛️ UK Parliament Members Scraper (MPs & Lords)

> 🚀 **Export the UK Parliament directory in seconds.** Pull every **MP in the House of Commons and every peer in the House of Lords**, with biographies, parties, constituencies, contact details, government posts, and committee memberships. No sign-up, no manual stitching, no parser to maintain.

The **UK Parliament Members Scraper** queries the official UK Parliament Members directory and returns up to **31 structured fields per record**, including the canonical display name and full title, party affiliation with party colour, House of Commons constituency, House of Lords seat type, government and opposition posts, committee memberships, parliamentary contact address, phone, email, websites, and social-media handles.

The directory covers **every currently sitting MP and peer plus every former member** going back through the modern era, across all parties from Labour, Conservative, Liberal Democrat, SNP, Reform UK, Sinn Féin, the Lords Spiritual, Crossbench, and beyond. This Actor makes that data downloadable as CSV, Excel, JSON, or XML in under five minutes. Filters run server-side, so you skip the parser engineering entirely.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Public-affairs and government-relations teams, journalists and political researchers, lobbyists, NGOs, civic-tech projects, academic political scientists, CRM enrichment platforms | Stakeholder mapping, MP and peer outreach lists, constituency contact, committee tracking, voting-record context, party-composition analysis, lobbyist registers |

### 📋 What the UK Parliament Members Scraper does

Six filtering workflows in a single run:

- 🏛️ **House filter.** Restrict to Commons (MPs), Lords (peers), or both chambers.
- 🎗️ **Party filter.** Pick a single party from a curated list of every active and historic UK political party.
- 👤 **Gender filter.** Male, female, or all.
- 📍 **Constituency substring.** Match Commons members whose constituency name contains a substring (e.g. "London", "Glasgow").
- 🚦 **Current vs former.** Currently sitting members, former members only, or all (current + former).
- 🔎 **Name substring.** Match the display name on a case-insensitive substring.

Each record includes the member ID, official photo URL, public profile URL, four name variants (display, full title, list-as, address-as), gender, House, party (name, abbreviation, ID, official party colour), constituency and constituency ID, membership start and end dates, current-member flag, full constituency history, every government post and opposition post with dates and department, committee memberships, parliamentary contact phone numbers, emails, websites, X / Facebook / Instagram links, and the canonical House of Commons / House of Lords address with postcode.

> 💡 **Why it matters:** structured Parliament member data drives stakeholder mapping, public-affairs CRM enrichment, and political-research dashboards. Building your own pipeline means writing a paginated client, fetching three sub-resources per member, normalising contact channels, and refreshing daily. This Actor skips all of that and gives you a clean refreshed snapshot on every run.

### 📊 Data fields

Each record includes: `committeeMemberships`, `constituency`, `constituencyHistory`, `constituencyId`, `emails`, `gender`, `governmentPosts`, `house`, `id`, `imageUrl`, `isCurrentMember`, `membershipEndDate`, `membershipEndReason`, `membershipStartDate`, `membershipStatusDescription`, `nameAddressAs`, `nameDisplayAs`, `nameFullTitle`, `nameListAs`, `oppositionPosts`, `parliamentaryAddress`, `parliamentaryPostcode`, `partyAbbreviation`, `partyBackgroundColor`, `partyColor`, `partyForegroundColor`, `partyId`, `partyName`, `phoneNumbers`, `profileUrl`, `scrapedAt`, `socialLinks`, `websites`. These field names come straight from the actor's dataset schema, so what you see here is what lands in your dataset.

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account w/ $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the UK Parliament Members Scraper page on the Apify Store.
3. 🎯 **Set input.** Pick a House, a party, a gender, a constituency substring, and set `maxItems`. Toggle `fetchDetails` for full biography + contact.
4. 🚀 **Run it.** Click **Start** and let the Actor collect your dataset.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to a downloaded MPs / Lords dataset: **3-5 minutes.** No coding required.

### 🔗 Recommended Actors

- [**🗣️ Hansard UK Parliament Debates Scraper**](https://apify.com/parseforge/hansard-uk-debates-scraper) - Full transcripts of Commons and Lords debates
- [**🇬🇧 GOV.UK Content Search Scraper**](https://apify.com/parseforge/govuk-content-search-scraper) - Search the entire UK government publications catalogue
- [**🛡️ OpenSanctions Sanctions & PEP Scraper**](https://apify.com/parseforge/opensanctions-entities-scraper) - Sanctioned entities and politically exposed persons
- [**⚡ Carbon Intensity UK Scraper**](https://apify.com/parseforge/carbon-intensity-uk-scraper) - National Grid carbon intensity feed
- [**🏛️ Florida Sunbiz Business Registry Scraper**](https://apify.com/parseforge/sunbiz-florida-business-scraper) - Florida corporate registry records

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more reference-data scrapers.

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by the UK Parliament, the House of Commons, or the House of Lords. All trademarks mentioned are the property of their respective owners. Only publicly available open Parliament data is collected, under the Open Parliament Licence.

### 🆘 Need Help?

If you hit a bug, have questions about setup, or need a scraper we haven't built yet, open our [contact form](https://tally.so/r/BzdKgA) or write to parseforge@protonmail.com. We also take on paid custom data projects.

For faster answers, join our [Discord](https://parseforge.co/discord). It's the best place to get support and suggest new actors.

# 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("💾 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 '{
  "name": "",
  "constituency": "",
  "maxItems": 10
}' |
apify call parseforge/members-uk-parliament-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/SNp4RVpAwIhFuWxfp/builds/WtXpMvJeOQvL7UFDJ/openapi.json
