# 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, NaN 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 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

![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.

> 🕒 **Last updated:** 2026-05-15 · **📊 31 fields** per record · **🏛️ 1,450+ current members** · **🇬🇧 Both Houses** · **📜 Historic + current**

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.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded MP and Lords dataset._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>name</code></td><td>string</td><td><code>""</code></td><td>Substring match on the member's display name.</td></tr>
<tr><td><code>house</code></td><td>string</td><td><code>""</code></td><td>One of: empty (both), <code>Commons</code>, <code>Lords</code>.</td></tr>
<tr><td><code>party</code></td><td>string</td><td><code>""</code></td><td>One of 20+ parties (Labour, Conservative, Liberal Democrat, SNP, Reform UK, Crossbench, Bishops, and more).</td></tr>
<tr><td><code>gender</code></td><td>string</td><td><code>""</code></td><td>Empty (all), <code>M</code>, or <code>F</code>.</td></tr>
<tr><td><code>membershipStatus</code></td><td>string</td><td><code>"current"</code></td><td>Currently sitting, former, or all (current + former).</td></tr>
<tr><td><code>constituency</code></td><td>string</td><td><code>""</code></td><td>Substring match on the Commons constituency name (ignored for Lords).</td></tr>
<tr><td><code>fetchDetails</code></td><td>boolean</td><td><code>true</code></td><td>When enabled, pulls biography (committees, posts, representations) and contact details per member.</td></tr>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Records to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
</tbody>
</table>

**Example: every currently sitting Labour MP with full biography and contact.**

```json
{
    "maxItems": 500,
    "house": "Commons",
    "party": "Labour",
    "membershipStatus": "current",
    "fetchDetails": true
}
````

**Example: female peers in the House of Lords.**

```json
{
    "maxItems": 200,
    "house": "Lords",
    "gender": "F",
    "membershipStatus": "current"
}
```

> ⚠️ **Good to Know:** with `fetchDetails: true` (default) the Actor makes additional lookups per member to gather biography and contact records. That's the canonical experience but it's slower than a names-only pull. Set `fetchDetails: false` for a quick directory listing.

***

### 📊 Output

Each member record carries up to **31 fields**. Download the dataset as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🆔 `id` | number | `172` |
| 🖼️ `imageUrl` | string | `"https://members-api.parliament.uk/api/Members/172/Thumbnail"` |
| 🔗 `profileUrl` | string | `"https://members.parliament.uk/member/172"` |
| 📌 `nameDisplayAs` | string | `"Ms Diane Abbott"` |
| 📌 `nameFullTitle` | string | `"Rt Hon Diane Abbott MP"` |
| 📌 `nameListAs` | string | `"Abbott, Ms Diane"` |
| 📌 `nameAddressAs` | string | `"Ms Abbott"` |
| 👤 `gender` | string | `"F"` |
| 🏛️ `house` | string | `"Commons"` |
| 📍 `constituency` | string | null | `"Hackney North and Stoke Newington"` |
| 🆔 `constituencyId` | number | null | `4074` |
| 📅 `membershipStartDate` | ISO 8601 | `"1987-06-11T00:00:00"` |
| 📅 `membershipEndDate` | ISO 8601 | null | `null` |
| 📝 `membershipEndReason` | string | null | `null` |
| 🚦 `isCurrentMember` | boolean | `true` |
| 📝 `membershipStatusDescription` | string | `"Current Member"` |
| 🏛️ `partyName` | string | `"Independent"` |
| 🏷️ `partyAbbreviation` | string | `"Ind"` |
| 🆔 `partyId` | number | `8` |
| 🎨 `partyColor` | string | `"#909090"` |
| 📜 `constituencyHistory` | array | `[{house, constituency, startDate, endDate, note}]` |
| 💼 `governmentPosts` | array | `[{name, startDate, endDate, department}]` |
| 💼 `oppositionPosts` | array | `[{name, startDate, endDate, department}]` |
| 💼 `committeeMemberships` | array | `[{name, startDate, endDate}]` |
| 📞 `phoneNumbers` | array | `["020 7219 4426"]` |
| 📧 `emails` | array | `["diane.abbott.office@parliament.uk"]` |
| 🔗 `websites` | array | `["http://www.dianeabbott.org.uk"]` |
| 🔗 `socialLinks` | array | `[{type: "X", url: "https://twitter.com/HackneyAbbott"}]` |
| 🏠 `parliamentaryAddress` | string | `"House of Commons, London"` |
| 📮 `parliamentaryPostcode` | string | `"SW1A 0AA"` |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-15T18:33:41.998Z"` |

#### 📦 Sample record

<details>
<summary><strong>🏛️ Sitting MP: Diane Abbott (Hackney North & Stoke Newington)</strong></summary>

```json
{
    "id": 172,
    "imageUrl": "https://members-api.parliament.uk/api/Members/172/Thumbnail",
    "profileUrl": "https://members.parliament.uk/member/172",
    "nameDisplayAs": "Ms Diane Abbott",
    "nameFullTitle": "Rt Hon Diane Abbott MP",
    "nameListAs": "Abbott, Ms Diane",
    "nameAddressAs": "Ms Abbott",
    "gender": "F",
    "house": "Commons",
    "constituency": "Hackney North and Stoke Newington",
    "constituencyId": 4074,
    "membershipStartDate": "1987-06-11T00:00:00",
    "isCurrentMember": true,
    "membershipStatusDescription": "Current Member",
    "partyName": "Independent",
    "partyAbbreviation": "Ind",
    "partyId": 8,
    "partyColor": "#909090",
    "constituencyHistory": [
        {"house": "Commons", "constituency": "Hackney North and Stoke Newington", "startDate": "2024-07-04T00:00:00", "note": "Elected 1 time"},
        {"house": "Commons", "constituency": "Hackney North and Stoke Newington", "startDate": "2010-05-06T00:00:00", "endDate": "2024-05-30T00:00:00", "note": "Elected 4 times"}
    ],
    "oppositionPosts": [
        {"name": "Shadow Home Secretary", "startDate": "2016-10-06T00:00:00", "endDate": "2020-04-05T00:00:00", "department": "Home Office"}
    ],
    "committeeMemberships": [
        {"name": "Home Affairs Committee", "startDate": "2020-05-11T00:00:00", "endDate": "2024-05-30T00:01:00"}
    ],
    "phoneNumbers": ["020 7219 4426"],
    "emails": ["diane.abbott.office@parliament.uk"],
    "websites": ["http://www.dianeabbott.org.uk"],
    "socialLinks": [{"type": "X", "url": "https://twitter.com/HackneyAbbott"}],
    "parliamentaryAddress": "House of Commons, London",
    "parliamentaryPostcode": "SW1A 0AA",
    "scrapedAt": "2026-05-15T18:33:41.998Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🏛️ | **Both Houses.** 1,450+ current MPs and Lords plus historic former members in a single run. |
| 🎯 | **Multi-dimensional filters.** House, party, gender, constituency, current / former, and name combine freely. |
| 💼 | **Career history included.** Government posts, opposition posts, committee memberships, and constituency history per member. |
| 📞 | **Contact-ready.** Parliamentary address, phone, email, websites, and X / Facebook / Instagram per record. |
| ⚡ | **Fast.** 100 members in seconds, full directory in a few minutes. |
| 🔁 | **Always fresh.** Every run hits the official directory, so the dataset reflects current members. |
| 🚫 | **No authentication.** Public open-government data. No login needed. |

> 📊 Structured Parliament member data sits at the heart of every public-affairs CRM, lobbyist register, and political-research dashboard in the UK.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ UK Parliament Members Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **1,450+ current + historic** | **Live per run** | house, party, gender, constituency, status, name | ⚡ 2 min |
| Commercial public-affairs platforms | $15k - $80k/year | Comparable + voting records | Daily | Many | 🐢 Weeks (procurement) |
| TheyWorkForYou scraping | Free | Limited fields | Daily | Few | 🕒 Days |
| Manual copy-paste from members.parliament.uk | Free | Whole directory | Live | Site-side | ⏳ Forever |

Pick this Actor when you want a structured, contact-ready directory of every UK parliamentarian without writing a parser.

***

### 🚀 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.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 🏛️ Public Affairs & Lobbying

- Stakeholder mapping for policy campaigns
- Outreach lists by party, House, or committee
- Refresh CRM contact records each session
- Track Cabinet and Shadow Cabinet posts in real time

</td>
<td width="50%" valign="top">

#### 📰 Political Journalism & Research

- Build party-composition snapshots after elections
- Track committee membership changes by session
- Cross-join with Hansard transcripts for speech analysis
- Power explainer dashboards on cabinet reshuffles

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 🎯 Constituency Targeting

- Map MPs to constituencies for civic-tech tools
- Build "Find your MP" widgets with structured contact info
- Surface party-coloured visuals in dashboards
- Power email-your-MP workflows for campaign sites

</td>
<td width="50%" valign="top">

#### 📊 Civic Analytics & NGOs

- Diversity reporting by gender, party, and House
- Tenure analysis across constituency histories
- Committee participation patterns over decades
- Open-data dashboards for civic-tech communities

</td>
</tr>
</table>

***

### 🔌 Automating UK Parliament Members Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Daily refreshes keep your stakeholder map and CRM in sync automatically.

***

### 🌟 Beyond business use cases

Open Parliament data powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Quantitative studies of parliamentary careers and turnover
- Politics coursework on party composition over time
- Reproducible datasets for representation and diversity research
- Historical archives of constituency boundary changes

</td>
<td width="50%">

#### 🎨 Personal and creative

- Side projects mapping MPs to constituencies on a UK map
- Personal newsletters that profile newly elected members
- Visualisations of party colours in the Commons chamber
- Data-art pieces on the demographics of Parliament

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Civic-tech tools that connect citizens with their MP
- Watchdog dashboards tracking ministerial appointments
- Investigative journalism on committee compositions
- Accessibility projects that present member data clearly

</td>
<td width="50%">

#### 🧪 Experimentation

- Train named-entity models with UK political figures
- Build agent pipelines that summarise career histories
- Prototype recommender systems for civic engagement
- Stress-test contact-form workflows with real member data

</td>
</tr>
</table>

***

### 🤖 Ask an AI assistant about this scraper

Open a ready-to-send prompt about this ParseForge actor in the AI of your choice:

- 💬 [**ChatGPT**](https://chat.openai.com/?q=How%20do%20I%20use%20the%20UK%20Parliament%20Members%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🧠 [**Claude**](https://claude.ai/new?q=How%20do%20I%20use%20the%20UK%20Parliament%20Members%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🔍 [**Perplexity**](https://perplexity.ai/search?q=How%20do%20I%20use%20the%20UK%20Parliament%20Members%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🅒 [**Copilot**](https://copilot.microsoft.com/?q=How%20do%20I%20use%20the%20UK%20Parliament%20Members%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

Pick a House, party, gender, or constituency substring, click Start, and the Actor pages through the official Parliament directory, optionally fetches biography and contact records per member, and emits a clean structured row. No browser automation, no captchas, no setup.

#### 📏 How accurate is the data?

Every record comes from the official UK Parliament Members directory used by members.parliament.uk itself, so names, parties, constituencies, posts, and contact channels match what you see on the page.

#### 🔁 How often is the dataset refreshed?

The directory is updated continuously as elections, by-elections, peerage creations, ministerial reshuffles, and resignations take place. Every run hits the live directory.

#### 🏛️ Does it include both MPs and Lords?

Yes. Leave the `house` filter empty to return both Houses, or set it to `Commons` for MPs only and `Lords` for peers only.

#### 💼 Are committees and government posts included?

Yes. Set `fetchDetails: true` (default) and each record will include constituency history, government posts, opposition posts, and committee memberships with dates and departments.

#### 📞 Are contact details included?

Yes. Parliamentary address, postcode, phone numbers, emails, websites, and X / Facebook / Instagram links are emitted when present. Some members opt out of publishing certain channels, in which case those fields are omitted.

#### 🕰️ Can I get former members?

Yes. Set `membershipStatus` to `former` for former members only or `all` for current + former.

#### ⏰ Can I schedule regular runs?

Yes. Use Apify Schedules to run this Actor on any cron interval (daily, weekly) and keep your CRM stakeholder map in sync.

#### ⚖️ Is this data legal to use?

UK Parliament publishes member directory data under the Open Parliament Licence, which permits commercial reuse with attribution. Review the licence terms for your specific application.

#### 💼 Can I use this data commercially?

Yes. The Open Parliament Licence explicitly allows commercial reuse with attribution. You remain responsible for following the licence in your product.

#### 💳 Do I need a paid Apify plan to use this Actor?

No. The free Apify plan is enough for testing and small runs (10 records per run). A paid plan lifts the limit and gives you scheduling, higher concurrency, and larger datasets.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

UK Parliament Members Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step stakeholder workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get reshuffle alerts in your channels
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe member data into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

You can also use webhooks to trigger downstream actions when a run finishes. Push fresh member records into your CRM, or alert your public-affairs team in Slack.

***

### 🔗 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.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ 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.

# 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`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "UK Parliament Members Scraper (MPs & Lords)",
        "description": "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.",
        "version": "0.0",
        "x-build-id": "GTCqbuFycBDbjGa0F"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~members-uk-parliament-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-members-uk-parliament-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/parseforge~members-uk-parliament-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-members-uk-parliament-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/parseforge~members-uk-parliament-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-members-uk-parliament-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": {
                    "name": {
                        "title": "Name Filter",
                        "type": "string",
                        "description": "Substring match on the member's display name. Leave empty to browse all members.",
                        "default": ""
                    },
                    "house": {
                        "title": "House",
                        "enum": [
                            "",
                            "Commons",
                            "Lords"
                        ],
                        "type": "string",
                        "description": "Restrict to one chamber. Default returns both.",
                        "default": ""
                    },
                    "party": {
                        "title": "Party",
                        "enum": [
                            "",
                            "Alliance",
                            "Conservative",
                            "Democratic Unionist Party",
                            "Green Party",
                            "Independent",
                            "Labour",
                            "Labour (Co-op)",
                            "Liberal Democrat",
                            "Plaid Cymru",
                            "Reform UK",
                            "Scottish National Party",
                            "Sinn Fein",
                            "Social Democratic & Labour Party",
                            "Speaker",
                            "Traditional Unionist Voice",
                            "UK Independence Party",
                            "Bishops",
                            "Crossbench",
                            "Lord Speaker",
                            "Non-affiliated"
                        ],
                        "type": "string",
                        "description": "Restrict to a single party.",
                        "default": ""
                    },
                    "gender": {
                        "title": "Gender",
                        "enum": [
                            "",
                            "M",
                            "F"
                        ],
                        "type": "string",
                        "description": "Filter by recorded gender.",
                        "default": ""
                    },
                    "membershipStatus": {
                        "title": "Current or Former",
                        "enum": [
                            "all",
                            "current",
                            "former"
                        ],
                        "type": "string",
                        "description": "Filter to currently sitting members, former members, or include both. Defaults to 'all' so historical members are included.",
                        "default": "all"
                    },
                    "constituency": {
                        "title": "Constituency Substring (Commons only)",
                        "type": "string",
                        "description": "Substring match on the Commons constituency name (ignored for Lords).",
                        "default": ""
                    },
                    "fetchDetails": {
                        "title": "Fetch Detailed Profile",
                        "type": "boolean",
                        "description": "When enabled, makes an extra request per member to retrieve biography (committees, posts, representations) and contact details. Slower but much richer output.",
                        "default": true
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
