Parliament

Members API

An API which retrieves Members data.

Data & analytics#openapi#open-data

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

An API which retrieves Members data.

Endpoints 43

Location

  • GETReturns a list of locations, both parent and child/api/Location/Browse/:locationType/:locationName
  • GETReturns a list of constituencies/api/Location/Constituency/Search?searchText=string&skip=0&take=20
  • GETReturns a constituency by ID/api/Location/Constituency/:id
  • GETReturns latest election result by constituency id/api/Location/Constituency/:id/ElectionResult/Latest
  • GETReturns an election result by constituency and election id/api/Location/Constituency/:id/ElectionResult/:electionId
  • GETReturns a list of election results by constituency ID/api/Location/Constituency/:id/ElectionResults
  • GETReturns geometry by constituency ID/api/Location/Constituency/:id/Geometry
  • GETReturns a list of representations by constituency ID/api/Location/Constituency/:id/Representations
  • GETReturns a synopsis by constituency ID/api/Location/Constituency/:id/Synopsis

LordsInterests

  • GETReturns a list of registered interests/api/LordsInterests/Register?searchTerm=string&page=0&includeDeleted=false
  • GETReturns a list of staff/api/LordsInterests/Staff?searchTerm=string&page=0

Members

  • GETReturn members by ID with list of their historical names, parties and memberships/api/Members/History?ids=0
  • GETReturns a list of current members of the Commons or Lords/api/Members/Search?Name=string&Location=string&PostTitle=string&PartyId=0&House=1&ConstituencyId=0&NameStartsWith=string&Gender=string&MembershipStartedSince=2024-01-01T00:00:00Z&MembershipEnded.MembershipEndedSince=2024-01-01T00:00:00Z&MembershipEnded.MembershipEndReasonIds=0&MembershipInDateRange.WasMemberOnOrAfter=2024-01-01T00:00:00Z&MembershipInDateRange.WasMemberOnOrBefore=2024-01-01T00:00:00Z&MembershipInDateRange.WasMemberOfHouse=1&IsEligible=true&IsCurrentMember=true&PolicyInterestId=0&Experience=string&skip=0&take=20
  • GETReturns a list of members of the Commons or Lords/api/Members/SearchHistorical?name=string&dateToSearchFor=2024-01-01T00:00:00Z&skip=0&take=20
  • GETReturn member by ID/api/Members/:id?detailsForDate=2024-01-01T00:00:00Z
  • GETReturn biography of member by ID/api/Members/:id/Biography
  • GETReturn list of contact details of member by ID/api/Members/:id/Contact
  • GETReturn contribution summary of member by ID/api/Members/:id/ContributionSummary?page=0
  • GETReturn list of early day motions of member by ID/api/Members/:id/Edms?page=0
  • GETReturn experience of member by ID/api/Members/:id/Experience
  • GETReturn list of areas of focus of member by ID/api/Members/:id/Focus
  • GETReturn latest election result of member by ID/api/Members/:id/LatestElectionResult
  • GETReturn portrait of member by ID/api/Members/:id/Portrait?cropType=0&webVersion=true
  • GETReturn portrait url of member by ID/api/Members/:id/PortraitUrl
  • GETReturn list of registered interests of member by ID/api/Members/:id/RegisteredInterests?house=1
  • GETReturn list of staff of member by ID/api/Members/:id/Staff
  • GETReturn synopsis of member by ID/api/Members/:id/Synopsis
  • GETReturn thumbnail of member by ID/api/Members/:id/Thumbnail
  • GETReturn thumbnail url of member by ID/api/Members/:id/ThumbnailUrl
  • GETReturn list of votes by member by ID/api/Members/:id/Voting?house=1&page=0
  • GETReturn list of written questions by member by ID/api/Members/:id/WrittenQuestions?page=0

Parties

  • GETReturns a list of current parties with at least one active member./api/Parties/GetActive/:house
  • GETReturns the composition of the House of Lords by peerage type./api/Parties/LordsByType/:forDate
  • GETReturns current state of parties/api/Parties/StateOfTheParties/:house/:forDate

Posts

  • GETReturns a list of departments./api/Posts/Departments/:type
  • GETReturns a list of government posts./api/Posts/GovernmentPosts?departmentId=0
  • GETReturns a list of opposition posts./api/Posts/OppositionPosts?departmentId=0
  • GETReturns a list containing the speaker and deputy speakers./api/Posts/SpeakerAndDeputies/:forDate
  • GETReturns a list of spokespersons./api/Posts/Spokespersons?partyId=0

Reference

  • GETReturns a list of answering bodies./api/Reference/AnsweringBodies?id=0&nameContains=string
  • GETReturns a list of departments./api/Reference/Departments?id=0&nameContains=string
  • GETReturns department logo./api/Reference/Departments/:id/Logo
  • GETReturns a list of policy interest./api/Reference/PolicyInterests

API details

Authentication
None declared in the description
Operations
43 operations on 43 pathsGET 43
Main resources
Members 20Location 9Posts 5Reference 4Parties 3LordsInterests 2
Response formats
application/json text/json text/plain
Description format
OpenAPI 3.0.1, API version v1
Listed from
APIs.guru OpenAPI Directory (CC0-1.0)
Source updated

How to test the Members API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Members API collection, without the publisher's secrets.
  3. Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
  4. Send a requestPick an endpoint, for example “Returns a list of locations, both parent and child” (GET /api/Location/Browse/:locationType/:locationName), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Members API?

An API which retrieves Members data. It is listed under Data & analytics and has 43 endpoints.

Who publishes the Members API?

It is listed from Parliament's public API description (an OpenAPI document), not published by Parliament on Swastik Codes. Anyone who controls parliament.uk can claim the profile by adding a DNS TXT record.

How do I authenticate with the Members API?

Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.

How many endpoints does the Members API have?

43 operations on 43 paths (43 GET). The largest groups are Members, Location, Posts, Reference.

Is forking the Members API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.