ParseForge Scrapers

Hansard UK Parliament Debates Scraper

parseforge/hansard-uk-debates-scraper

BusinessAutomationOther

Scrapes UK Parliament debate contributions from Hansard by search term, member, party, department, debate type, and date range. Returns each contribution as a flat row with speaker, chamber, full text, and sitting date.

Run this scraper See the API call
Total users
2
Monthly active
0
Total runs
138
Bookmarked
0
Rating
Not rated yet
Last modified
9 days ago

Overview

ParseForge

Hansard UK Parliament Debates Scraper

Scrape UK Parliament debate transcripts from Hansard by keyword, member, party, or date, up to a million contributions per run. Every row returns the speaker, chamber, full text, and sitting date. Export to CSV, JSON, Excel, or XML.

The official Hansard API limits how you can search and filter decades of parliamentary debate. This Actor reads the public transcripts directly, letting you pull contributions by keyword, member name, party ID, department, debate type, or date range. You get a clean, flat dataset without writing a single line of code.

Who uses it What they scrape Hansard UK Parliament for
Political researchers Track how a policy area has been discussed across Commons and Lords over a decade.
Journalists Pull every mention of a specific MP or minister to build a timeline of their public statements.
NGOs and campaign groups Monitor parliamentary sentiment and language around a single issue like climate or housing.
Data scientists Build a corpus of structured political speech for NLP training or sentiment analysis.

What it does

This Actor collects UK Parliament debate contributions from Hansard by search term or direct filter, and returns each one as a flat row with speaker, chamber, party, text, and sitting date.

  • ๐Ÿ” Keyword search: Enter a phrase like 'NHS funding' and get every matching contribution, ranked by Hansard relevance.
  • ๐Ÿ›๏ธ Chamber filter: Restrict results to the House of Commons, the House of Lords, or pull from both in one run.
  • ๐Ÿ—ฃ๏ธ Member filter: Isolate every speech by a named MP or Lord with a case-insensitive substring match.
  • ๐Ÿ“… Date range: Narrow contributions to a specific sitting window with start and end dates in YYYY-MM-DD format.
  • ๐Ÿท๏ธ Debate type: Filter to Debates, Questions, Statements, Urgent Questions, Committee sessions, and more.
  • ๐Ÿ“Š Sort control: Order results by oldest or newest sitting date, or keep the default Hansard relevance ranking.

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

What you can do with Hansard UK Parliament data

๐Ÿ“ˆ Track policy language over time.

A political researcher sets a keyword like 'universal credit', a date range of five years, and both Houses to map how the framing of welfare policy has shifted.

๐Ÿ—ž๏ธ Build a minister's public record.

A journalist enters a cabinet minister's name, filters to the Commons, and exports every oral contribution to fact-check claims or spot contradictions.

๐Ÿ“Š Monitor parliamentary sentiment on a single issue.

An NGO sets the search term to 'fracking', restricts to the last two years, and collects every mention to quantify support and opposition across parties.

๐Ÿค– Create a political speech dataset for AI training.

A data scientist pulls 100,000 contributions across all debate types, with speaker and party labels, to fine-tune a language model on UK parliamentary language.

Why choose this scraper

What you get
Full debate text The complete spoken or written contribution, not a snippet.
Speaker attribution Member name, party, and chamber for every row.
Flexible filtering Combine keyword, member, party ID, department, and debate type in one run.
No API key Reads public Hansard data directly with no registration or rate-limit headaches.

How it compares

This Actor reads the public Hansard website directly, while the alternative below uses the official API. Here is how they compare on the features a buyer would check.

Feature ParseForge UK Hansard Parliamentary Debates
Keyword search across all transcripts Yes Not listed
Filter by member name Yes Not listed
Filter by party ID Yes Not listed
Filter by department Yes Not listed
Filter by debate type Yes Not listed
Include former members Yes Not listed

Configure the run

Drive the Actor from a keyword search, or leave the search term empty to fetch the most recent contributions across all topics. Filters for house, member, party, department, debate type, and date range run as each contribution is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

{
 "maxItems": 10
}

A larger pull:

{
 "maxItems": 200
}

Pricing

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

Results collected Approximate cost
100 results $3.15
1,000 results $31.50
10,000 results $315.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 to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the Hansard UK Parliament Debates Scraper.
  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 (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

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

claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/hansard-uk-debates-scraper"

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

Troubleshooting

Why am I getting no results?

Check that your search term or filters are not too narrow. Try removing the date range, setting the debate type to 'All types', or using a shorter keyword. Also confirm the Party ID is correct if you are using one.

The Member Name filter is not finding the person I want.

The filter does a substring match, so try a shorter version of the name. Check the spelling and try both the common name and the formal parliamentary name. If the member is no longer sitting, make sure 'Include Former Members' is enabled.

My run is taking a long time.

A wide search with a high maximum contributions count will take longer. Try narrowing the date range or adding a keyword to reduce the number of contributions the Actor needs to check.

The Party ID filter is not working.

Make sure you are using the numeric Party ID from the UK Parliament Members directory, not the party name. For example, use 4 for Labour, not the word 'Labour'.

I am getting results from the wrong chamber.

Double-check the House filter. It defaults to 'Both Houses'. Set it explicitly to 'House of Commons' or 'House of Lords' if you only want one chamber.

FAQ

Question Answer
Does this scraper use the official Hansard API? No. It reads the public Hansard website directly, so you do not need an API key, registration, or to worry about rate limits.
Can I get contributions from both the Commons and the Lords in one run? Yes. Set the House filter to 'Both Houses' and the Actor will return matching contributions from the Commons and the Lords combined.
How do I filter by a specific MP or Lord? Use the Member Name field. It does a case-insensitive substring match, so 'Keir Starmer', 'starmer', or 'keir' will all work.
What is a Party ID and where do I find it? The Party ID is a numeric identifier from the UK Parliament Members directory. For example, 4 is Labour, 15 is Conservative, and 8 is Independent. You can look up the ID for any party on the official members site.
Can I scrape written statements and urgent questions, or only debates? You can filter by debate type to include Debates, Questions, Statements, Written Statements, Urgent Questions, Committee sessions, and more.
How far back does the data go? The Actor returns whatever is available on the public Hansard site, which covers many years of parliamentary records. Use the date range filter to narrow your search to a specific period.
What format is the data exported in? You can export your dataset in CSV, JSON, Excel, or XML from the Apify platform.
Can I include former MPs and Lords who no longer sit in Parliament? Yes. Enable the 'Include Former Members' checkbox and the Actor will also return contributions from members who have left their seat.
What happens if I leave the search term empty? The Actor fetches the most recent contributions across all topics, which you can then narrow with the other filters like house, member, or date range.
Is there a limit to how many contributions I can scrape? You can set the maximum contributions per run up to 1,000,000. The Actor will stop once it reaches that number or runs out of matching results.

Related actors

Browse the full ParseForge collection 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.

Input

FieldTypeWhat it doesDefault
searchTerm string Keyword or phrase to search across UK Parliament transcripts (e.g. 'climate change', 'NHS funding'). Leave empty to fetch the most recent contributions across all topics. not set
house string (3 options) Filter to a single chamber. Both = Commons + Lords combined. Both
memberName string Filter contributions to a specific MP or Lord by name (case-insensitive substring match, e.g. 'Keir Starmer'). not set
department string Filter by department name (e.g. 'Treasury', 'Department for Education'). Case-insensitive substring match. not set
debateType string (10 options) Restrict to a specific Hansard debate type (e.g. 'Debate', 'Question', 'Statement', 'WrittenStatement'). not set
partyId integer Restrict to contributions from members of a single party. Use the numeric Party ID from the UK Parliament Members directory (e.g. 4 = Labour, 8 = Independent, 15 = Conservative). not set
includeFormer boolean When enabled, include contributions from members who no longer sit in either House. false
startDate string Only include contributions on or after this sitting date. not set
endDate string Only include contributions on or before this sitting date. not set
orderBy string (3 options) Order in which contributions are returned. not set
maxItems integer How many debate contributions to collect per run. 10

Pricing

from $23.63 per 1,000 results

Charged forWhat it isPrice each
result Single result in the default dataset. $0.02363 to $0.0315

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

API

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST ยท run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~hansard-uk-debates-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "helloWorld": 123
  }'

Examples

Input that runs as-is.

input.json
{
  "helloWorld": 123
}

Reviews

No reviews yet. Be the first.

Issues

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

Related scrapers

Run Hansard UK Parliament Debates Scraper on Apify All scrapers