History · Reference dataset
British Prime Ministers
British prime ministers with their years in office and party, plus the exact start and end date of each term and their dates of birth and death.
$69 once covers this and 401 other datasets, plus 33 collections, for 365 days. No automatic renewal. Have a pass?

Preview the records
First 5 and last 5 of 82 records · Last changed November 16, 2026 · Select a row to read the whole record.
| Name | Took office | Left office | Party | Start date | End date | Birth date | Death date |
|---|---|---|---|---|---|---|---|
| Robert Walpole | 1721 | 1742 | Whig | 1721-04-03 | 1742-02-11 | 1676-09-05 | 1745-03-29 |
| Spencer Compton, 1st Earl of Wilmington | 1742 | 1743 | Whig | 1742-02-16 | 1743-07-02 | 1673-03-18 | 1743-07-13 |
| Henry Pelham | 1743 | 1754 | Whig | 1743-08-27 | 1754-03-06 | 1694-09-25 | 1754-03-06 |
| Thomas Pelham-Holles, 1st Duke of Newcastle | 1754 | 1756 | Whig | 1754-03-16 | 1756-11-11 | 1693-07-21 | 1768-11-17 |
| William Cavendish, 4th Duke of Devonshire | 1756 | 1757 | Whig | 1756-11-16 | 1757-06-29 | 1720-05-08 | 1764-10-02 |
| 72 more records · Download options | |||||||
| Boris Johnson | 2019 | 2022 | Conservative | 2019-07-24 | 2022-09-06 | 1964-06-19 | |
| Liz Truss | 2022 | 2022 | Conservative | 2022-09-06 | 2022-10-25 | 1975-07-26 | |
| Rishi Sunak | 2022 | 2024 | Conservative | 2022-10-25 | 2024-07-05 | 1980-05-12 | |
| Keir Starmer | 2024 | 2026 | Labour | 2024-07-05 | 2026-07-20 | 1962-09-20 | |
| Andy Burnham | 2026 | 0 | Labour | 2026-07-20 | 1970-01-07 | ||
Free sample files (up to 10 rows): CSV JSON XML
Open the sample in a free tool: CSV to JSON · JSON formatter · SQL INSERT generator · CSV to XML
CSV / JSON / XML
Put this data to work.
All 82 records, in your choice of format.
The free sample stops at 10 rows. A Data Pass removes the limit here and across the site, so you can stop collecting data and start using it.
- Every record in 402 datasets, this one included
- All 33 collections in full: more than 4 million rows of ZIP codes, schools, occupations and more
- CSV, JSON and XML, whole-category ZIPs, and 2,500 API requests a day
$69 once, for 365 days. No subscription and no automatic renewal, and what you download is yours to keep using.
Your key arrives by email after payment. Use it here to download the complete file.
Or share what you build with it and, if approved, get 75% off a Data Pass. See the contributor program
Already have a pass?
Your key is used for this request and is not saved by this page.
Commercial use is allowed, free or paid.
Downloaded a CSV? Convert CSV to JSON, generate SQL inserts, remove duplicate lines, or sort a list with the free tools.
Scope and sources
Last checked against sources: October 15, 2026.
Last changed: November 16, 2026. This is when we last changed the data or its description. It doesn’t mean the data runs up to that date.
- Wikipedia: List of prime ministers of the United Kingdom (used with permission)
- Wikidata: date of birth (P569) and death (P570), reached through each prime mini
British Prime Ministers has 82 records and 8 fields: Name, Took office, Left office, Party, Start date, End date, Birth date, Death date.
A complete download includes all 82 records currently held in this dataset. Check the description and sources to decide whether its scope fits your project.
Use this dataset through the API
GET https://mysafeinfo.com/api/data/britishprimeministers
Choose a format, sort, or request fewer rows. A pass key gives access to the complete dataset. See the examples and parameters.
Without a pass, sorting and randomization apply only to the fixed 10-row sample.