UK Parliament Petitions API
Free UK Parliament petitions API with no key: every open petition with signature counts, constituency and country breakdowns, plus government responses and debates. Tested example.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the UK Parliament Petitions API?
The UK Parliament and Government petitions site publishes its full dataset as JSON with no API key. Adding `.json` to any petitions URL returns petitions with live signature counts, per-constituency and per-country breakdowns, and any government response or Petitions Committee debate attached to them.
Two thresholds drive everything on this site: 10,000 signatures obliges a government department to respond in writing, and 100,000 makes a petition eligible for consideration for a Westminster Hall debate. Because the API exposes signature counts broken down by parliamentary constituency and by country, it supports analysis the website itself does not offer — which seats a campaign is concentrated in, whether support is national or regional, how fast a petition is approaching a threshold.
The design is pleasantly predictable: any page on the site becomes an endpoint by appending `.json`, and list responses carry a `links` object with `self`, `first`, `last`, `next` and `prev`, so `last` immediately tells you the page count — 93 for open petitions at the time of testing. Individual petitions nest their substance under `attributes`. The critical caveat is the `state` filter: without `state=open` you get closed and rejected petitions mixed in, and a rejected petition still carries a signature count, which makes it easy to publish a number for something Parliament declined to consider.
Quick facts
- Base URL
https://petition.parliament.uk- Authentication
- No API key or registration. Every public page has a `.json` equivalent at the same path.
- Rate limit
- No published limit. Signature counts refresh frequently but not per second — cache for a few minutes.
- Pricing
- Free. Petition data is published as public information under the Open Government Licence.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the UK Parliament Petitions API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. List open UK parliamentary petitions
GET https://petition.parliament.uk/petitions.json?page=1&state=open
curl 'https://petition.parliament.uk/petitions.json?page=1&state=open'const res = await fetch("https://petition.parliament.uk/petitions.json?page=1&state=open");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://petition.parliament.uk/petitions.json?page=1&state=open", timeout=20)
res.raise_for_status()
print(res.json()){
"links": {
"self": "https://petition.parliament.uk/petitions.json?page=1&state=open",
"first": "https://petition.parliament.uk/petitions.json?state=open",
"last": "https://petition.parliament.uk/petitions.json?page=93&state=open",
"next": "https://petition.parliament.uk/petitions.json?page=2&state=open",
"prev": null
},
"data": [
{
"type": "petition",
"id": 759783,
"links": {
"self": "https://petition.parliament.uk/petitions/759783.json"
},
"attributes": {
"action": "Make a public animal abuser register & automatically ban ownership",
"background": "Create a public register of all offenders convicted of animal abuse and introduce an automatic, lifetime ban on animal ownership for anyone convicted of animal neglect or abuse. This register should be searchable by vets, breeders, charities and the public to prevent repeat offending.",
"additional_details": "I clean homes for free for people in need and regularly witness animals suffering under owners with a history for animal neglect or abuse. Currently, bans are discretionary and there is no public register. Abusers can continue acquiring animals. A mandatory ban and register could prevent repeat cruelty and break cycles of harm. Additionally, an immediate automatic lifetime ban could prevent animal ownership being at a judge’s discretion.",
"committee_note": "",
"state": "open",
"signature_count": 243872,
"closing_date": "2026-09-12",
"created_at": "2026-02-03T12:04:15.845Z",
"updated_Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
state | query | Optional | `open`, `closed` or `rejected`. Set it — the default mixes them. open |
page | query | Optional | Page number. The `links.last` URL reveals how many there are. 1 |
q | query | Optional | Free-text search across petition text. animal welfare |
/petitions/{id}.json | path | Optional | One petition, including constituency and country signature breakdowns. /petitions/759783.json |
Response fields
linksobject- `self`, `first`, `last`, `next` and `prev` URLs. Read `last` to learn the page count without walking.
dataarray- The petitions.
data[].idinteger- Petition number, matching the public URL.
data[].typestring- Always `petition` on these endpoints.
attributes.actionstring- The petition's headline demand — the one-line text shown on the site.
attributes.backgroundstring- The longer case the petitioner makes.
attributes.signature_countinteger- Live total. 10,000 triggers a government response, 100,000 debate consideration.
attributes.statestring- `open`, `closed` or `rejected`. Rejected petitions still carry signature counts — check before quoting a figure.
attributes.signatures_by_constituencyarray- Per-seat breakdown with ONS constituency codes. Returned on individual petition endpoints only.
attributes.government_response / debateobject- The written response and any debate record, once the thresholds have been met.
What you can build with the UK Parliament Petitions API
- Track petitions approaching the 10,000 or 100,000 signature thresholds
- Map petition support by parliamentary constituency
- Alert on new petitions matching a topic
- Analyse which departments respond fastest to petitions
- Chart signature growth over time by polling the count
Common errors and how to fix them
Closed or rejected petitions in the results
No `state` filter was supplied.
Fix: Always pass `state=open`. A rejected petition carries a signature count and is easy to misreport as live.
404 on a petition ID
The petition was removed, or the ID came from a devolved petitions site.
Fix: Confirm the ID resolves on petition.parliament.uk; the Scottish Parliament and Senedd run separate systems.
No constituency breakdown
It is only returned on individual petition endpoints.
Fix: Fetch `/petitions/{id}.json` rather than reading the list response.
Signature count never changes
A cached response, or the petition has closed.
Fix: Check `state` and the closing date before assuming the feed is stale.
UK Parliament Petitions API — frequently asked questions
Is the UK petitions API free?
Yes, no key and no registration. Any page on the petitions site becomes an API endpoint by appending `.json` to its path.
What do the signature thresholds mean?
At 10,000 signatures the government must publish a written response; at 100,000 the petition is considered for a Westminster Hall debate. Both are visible in the data, so you can track a petition's progress towards either.
Can I see where signatures come from?
Yes, on individual petition endpoints. `signatures_by_constituency` gives a per-seat breakdown with ONS codes, and a country breakdown is included too — neither appears on the list endpoint.
Does this cover Scottish or Welsh petitions?
No. This is the UK Parliament and Government system only. The Scottish Parliament and Senedd run their own separate petition sites with different data.
Tools that pair with this API
JSON to CSV Converter
Convert a JSON array of objects to CSV online. Automatic column headers from the union of all keys, delimiter choice and proper quoting — all in-browser.
Percentage Calculator
Calculate what X% of a number is, what percent one number is of another, and percentage increase or decrease between two values — instantly and free.
JSON Path Finder
Evaluate a dot/bracket path against your JSON and list every leaf path for discovery. Free online JSON path finder that runs 100% in your browser.
UK Parliament Petitions is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.