# UK Parliament API

> Returns UK Parliament members, parties, constituencies and bills, including member details and synopses.

Category: Government & Open Data. Region: GB. 10 endpoints at `https://api.hoshime.com/v1/ukparliament/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/ukparliament
## GET /v1/ukparliament/members

Members of the House of Commons and the House of Lords whose name contains the text, with their party and constituency.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Text in the member's name, such as abbott. (e.g. abbott) |
| `current` | boolean | no | true keeps only current members. |
| `take` | integer | no | Members per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `constituency` (string), `current` (boolean), `house` (string), `id` (string), `nameDisplay` (string), `nameList` (string), `party` (string)

```bash
curl "https://api.hoshime.com/v1/ukparliament/members?name=abbott" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/ukparliament/member

One Member of Parliament or Lord by id: name, gender, party, house, constituency and whether the seat is current.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | integer | yes | Member id, such as 172 for Diane Abbott. (e.g. 172) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `constituency` (string), `current` (boolean), `fullTitle` (string), `gender` (string), `house` (string), `id` (string), `nameDisplay` (string), `nameList` (string), `party` (string), `since` (string), `status` (string), `thumbnail` (string)

```bash
curl "https://api.hoshime.com/v1/ukparliament/member?id=172" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/ukparliament/memberSynopsis

The short synopsis of one Member: their seat and years of service, as plain text.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | integer | yes | Member id, such as 172. (e.g. 172) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `text` (string)

```bash
curl "https://api.hoshime.com/v1/ukparliament/memberSynopsis?id=172" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/ukparliament/parties

The political parties that have members in one house, with their abbreviation and colours.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `house` | string | no | Commons or Lords. (one of Commons, Lords; default Commons; e.g. Commons) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `abbreviation` (string), `backgroundColour` (string), `foregroundColour` (string), `id` (string), `independent` (boolean), `name` (string)

```bash
curl "https://api.hoshime.com/v1/ukparliament/parties?house=Commons" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/ukparliament/constituencies

Parliamentary constituencies whose name contains the text, with the member who represents each now.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Text in the constituency name, such as cities. (e.g. cities) |
| `take` | integer | no | Constituencies to return, from 1 to 100. (default 10) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `endDate` (string), `id` (string), `member` (string), `memberId` (string), `name` (string), `startDate` (string)

```bash
curl "https://api.hoshime.com/v1/ukparliament/constituencies?query=cities" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/ukparliament/bills

Bills before Parliament, or that were, whose short title contains the text, most recently updated first.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Text in the bill's title, such as health. (e.g. health) |
| `take` | integer | no | Bills per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `currentHouse` (string), `defeated` (boolean), `id` (string), `isAct` (boolean), `lastUpdate` (string), `originatingHouse` (string), `shortTitle` (string), `stage` (string), `withdrawn` (boolean)

```bash
curl "https://api.hoshime.com/v1/ukparliament/bills?query=health" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/ukparliament/bill

One bill by its id: its titles, the house it is in, its current stage, its sponsors and whether it became an Act.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | integer | yes | Bill id, such as 1292. (e.g. 1292) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `currentHouse` (string), `defeated` (boolean), `id` (string), `isAct` (boolean), `lastUpdate` (string), `longTitle` (string), `originatingHouse` (string), `shortTitle` (string), `sponsors` (string[]), `stage` (string), `withdrawn` (boolean)

```bash
curl "https://api.hoshime.com/v1/ukparliament/bill?id=1292" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/ukparliament/divisions

House of Commons votes (divisions) whose title contains the text, newest first, with the Aye and No counts. Without a query, the newest votes. Page with cursor.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Text in the vote's title, such as railways. Omit it for the newest votes. (e.g. Railways) |
| `take` | integer | no | Votes per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `ayeCount` (integer (int64)), `date` (string), `id` (string), `isDeferred` (boolean), `noCount` (integer (int64)), `number` (integer (int64)), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/ukparliament/divisions?query=Railways" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/ukparliament/division

One House of Commons vote by its division id: its title, counts and how each Member voted, Aye or No.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | integer | yes | Division id, as the divisions endpoint gives it, such as 2476. (e.g. 2476) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `ayeCount` (integer (int64)), `ayes` (MemberVote[]), `ayes[].constituency` (string), `ayes[].memberId` (string), `ayes[].name` (string), `ayes[].party` (string), `date` (string), `id` (string), `isDeferred` (boolean), `noCount` (integer (int64)), `noes` (MemberVote[]), `noes[].constituency` (string), `noes[].memberId` (string), `noes[].name` (string), `noes[].party` (string), `number` (integer (int64)), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/ukparliament/division?id=2476" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/ukparliament/committees

Committees of Parliament, select and joint, whose name contains the text, with their house and the page on committees.parliament.uk. Page with cursor.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Text in the committee's name, such as health. Omit it for all committees. (e.g. health) |
| `take` | integer | no | Committees per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `category` (string), `house` (string), `id` (string), `name` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/ukparliament/committees?query=health" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
