# data.gov.uk API

> Returns UK government datasets, recent changes, resource file formats and publishing organizations from data.gov.uk.

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

Datasets of data.gov.uk that match a text, most relevant first, with their publisher and size.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Text to search for, such as air quality. Empty lists the catalogue. (e.g. air quality) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `id` (string), `licence` (string), `name` (string), `notes` (string), `publisher` (string), `resourceCount` (integer (int64)), `title` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/datagovuk/search?query=air+quality" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovuk/dataset

One dataset of data.gov.uk with its publisher, licence, dates and resources (files and links).

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Dataset name, the slug of its page, such as river-flood-maps-frm-fh-river-depth-l568. (e.g. river-flood-maps-frm-fh-river-depth-l568) |
| `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), `licence` (string), `name` (string), `notes` (string), `publisher` (string), `resourceCount` (integer (int64)), `resources` (Resource[]), `resources[].format` (string), `resources[].id` (string), `resources[].name` (string), `resources[].url` (string), `title` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/datagovuk/dataset?id=river-flood-maps-frm-fh-river-depth-l568" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovuk/recent

The datasets of data.gov.uk changed most recently, newest change first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `id` (string), `licence` (string), `name` (string), `notes` (string), `publisher` (string), `resourceCount` (integer (int64)), `title` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/datagovuk/recent" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovuk/formats

The file formats of the resources on data.gov.uk (CSV, XLSX, GeoJSON and so on) with how many resources each has, most common first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 20) |
| `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: `count` (integer (int64)), `format` (string)

```bash
curl "https://api.hoshime.com/v1/datagovuk/formats" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovuk/organizations

The publishers of data.gov.uk (departments, councils and other bodies), with how many datasets each publishes.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 50) |
| `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), `contactEmail` (string), `contactName` (string), `createdAt` (string), `datasets` (integer (int64)), `description` (string), `id` (string), `imageUrl` (string), `name` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/datagovuk/organizations" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovuk/organization

One publisher of data.gov.uk with its description, category, contact and dataset count.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Organization name, the slug of its page, such as cabinet-office. (e.g. cabinet-office) |
| `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), `contactEmail` (string), `contactName` (string), `createdAt` (string), `datasets` (integer (int64)), `description` (string), `id` (string), `imageUrl` (string), `name` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/datagovuk/organization?id=cabinet-office" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovuk/organizationDatasets

The datasets one publisher of data.gov.uk has released, optionally filtered by a text, most recently changed first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Organization name, such as cabinet-office. (e.g. cabinet-office) |
| `query` | string | no | Text to search for within the publisher's datasets. Empty lists them all. |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `id` (string), `licence` (string), `name` (string), `notes` (string), `publisher` (string), `resourceCount` (integer (int64)), `title` (string), `updatedAt` (string)

```bash
curl "https://api.hoshime.com/v1/datagovuk/organizationDatasets?id=cabinet-office" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovuk/tags

The tags data.gov.uk datasets are filed under, with how many datasets carry each, most used first; optionally only among the datasets that match a query.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Only count the datasets that match this text, such as flood. Empty counts the whole catalogue. |
| `limit` | integer | no | Items per page, 1 to 100. (default 20) |
| `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: `count` (integer (int64)), `tag` (string)

```bash
curl "https://api.hoshime.com/v1/datagovuk/tags" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
