Data.parliament.uk API

Free to Use Varies (check documentation)

Overview

Data.parliament.uk provides live datasets from the UK Parliament, including information on MPs, bills, petitions, votes, and attendance records. No API key is required, so you can start querying parliamentary data immediately. It is ideal for civic tech projects, political research, or anyone interested in UK legislative transparency.

💡

Beginner Tip

Use the Members API endpoint with a member's ID to get their biography, party affiliation, and constituency—you can find member IDs by browsing the search interface at explore.data.parliament.uk.

Available Data

Response fields: parliament uk
Data.parliament.uk data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Data.parliament.uk",
    "description": "Contains live datasets including information about petitions, bills, MP votes, attendance and more",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

MemberId Unique numeric identifier for the parliament member.
DisplayAs Full name of the member as displayed in parliament records.
Party Political party the member is affiliated with.
Constituency Name of the constituency the member represents.
House Which house the member belongs to—Commons or Lords.

Implementation Example

const url = "https://explore.data.parliament.uk/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

500 Internal Server Error Some endpoints on data.parliament.uk are occasionally unstable.
Retry the request after a short delay and check the Parliament developer forum for known outages.
XML returned instead of JSON Missing or incorrect format parameter in the request URL.
Always append &format=json to your request URL to ensure you receive a JSON response.
Empty results for a valid member The member name spelling or ID does not match the database.
Use the explore.data.parliament.uk search UI to find the exact spelling or numeric ID for the member.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 5/15
🛠 Developer XP 15/20
✓ Reliability 7/15
Response Time 284ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS NO
CORS UNKNOWN
Category Government
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →