# Wikivoyage API

> Returns Wikivoyage travel guide pages by search, with summaries, sections, page lists, categories and random pages.

Category: Travel, Maps & Weather. Region: global. 8 endpoints at `https://api.hoshime.com/v1/wikivoyage/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/wikivoyage
## GET /v1/wikivoyage/search

Pages of Wikivoyage whose text matches a search, 10 per page.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for, such as Bali. (e.g. Bali) |
| `lang` | string | no | Language code of the edition, such as en or de. (default en) |
| `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: `pageId` (string), `snippet` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/wikivoyage/search?query=Bali" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/wikivoyage/summary

Short description and lead text of one Wikivoyage page.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `title` | string | yes | Page title, or a <lang>.wikivoyage.org/wiki/<title> URL. (e.g. Bali) |
| `lang` | string | no | Language code of the edition. A URL sets it. (default en) |
| `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: `description` (string), `extract` (string), `lang` (string), `pageId` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/wikivoyage/summary?title=Bali" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/wikivoyage/sections

The sections of one Wikivoyage page, in reading order, with their level and anchor.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `title` | string | yes | Page title, or a <lang>.wikivoyage.org/wiki/<title> URL. (e.g. Bali) |
| `lang` | string | no | Language code of the edition. A URL sets it. (default en) |
| `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: `anchor` (string), `level` (integer (int64)), `number` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/wikivoyage/sections?title=Bali" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/wikivoyage/pages

Page titles of the main namespace in alphabetical order, 50 per page.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `lang` | string | no | Language code of the edition, such as en or de. (default en) |
| `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: `pageId` (string), `snippet` (string), `title` (string), `url` (string)

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

## GET /v1/wikivoyage/categories

The visible categories of one Wikivoyage page.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `title` | string | yes | Page title, or a <lang>.wikivoyage.org/wiki/<title> URL. (e.g. Bali) |
| `lang` | string | no | Language code of the edition. A URL sets it. (default en) |
| `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: `items` (Category[]), `items[].title` (string), `items[].url` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/wikivoyage/categories?title=Bali" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/wikivoyage/random

Random pages of the main namespace, 1 to 10 at a time. Each call returns new ones, so it is not cached.

Scope: `social:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 10. (default 1) |
| `lang` | string | no | Language code of the edition, such as en or de. (default en) |
| `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: `pageId` (string), `snippet` (string), `title` (string), `url` (string)

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

## GET /v1/wikivoyage/nearby

Wikivoyage pages with coordinates near a point, nearest first: places, sights and districts within a radius.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `lat` | string | yes | Latitude in decimal degrees, such as 48.8566. (e.g. 48.8566) |
| `lon` | string | yes | Longitude in decimal degrees, such as 2.3522. (e.g. 2.3522) |
| `radius` | integer | no | Search radius in metres, from 10 to 10000. (default 1000) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `lang` | string | no | Language code of the edition, such as en or de. (default en) |
| `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: `distanceMeters` (number (double)), `latitude` (number (double)), `longitude` (number (double)), `pageId` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/wikivoyage/nearby?lat=48.8566&lon=2.3522" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/wikivoyage/article

The full text of one Wikivoyage page as plain text, without its markup: every section, from the lead to the last listing.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `title` | string | yes | Page title, or a <lang>.wikivoyage.org/wiki/<title> URL. (e.g. Paris) |
| `lang` | string | no | Language code of the edition. A URL sets it. (default en) |
| `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: `lang` (string), `pageId` (string), `text` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/wikivoyage/article?title=Paris" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
