# SWAPI API

> Returns Star Wars people, films, planets and species with their attributes.

Category: Entertainment & Books. Region: global. 13 endpoints at `https://api.hoshime.com/v1/swapi/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/swapi
## GET /v1/swapi/person

One person of the films by uid: physical traits, homeworld and films.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `uid` | string | yes | Person uid, such as 1 for Luke Skywalker. (e.g. 1) |
| `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: `birthYear` (string), `eyeColor` (string), `films` (Link[]), `films[].url` (string), `gender` (string), `hairColor` (string), `height` (string), `homeworld` (string), `mass` (string), `name` (string), `skinColor` (string), `uid` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/swapi/person?uid=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swapi/film

One film by uid: title, episode, director, release date and opening crawl.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `uid` | string | yes | Film uid, such as 1 for A New Hope. (e.g. 1) |
| `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: `characters` (Link[]), `characters[].url` (string), `director` (string), `episodeId` (string), `openingCrawl` (string), `producer` (string), `releaseDate` (string), `title` (string), `uid` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/swapi/film?uid=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swapi/people

List of the people of the films with their uids, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 50. (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: `name` (string), `uid` (string), `url` (string)

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

## GET /v1/swapi/planet

One planet of the films by uid: climate, terrain, population and gravity.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `uid` | string | yes | Uid of the item, such as 1. (e.g. 1) |
| `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: `climate` (string), `diameter` (string), `gravity` (string), `name` (string), `orbitalPeriod` (string), `population` (string), `rotationPeriod` (string), `surfaceWater` (string), `terrain` (string), `uid` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/swapi/planet?uid=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swapi/planets

List of the planets of the films with their uids, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 50. (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: `name` (string), `uid` (string), `url` (string)

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

## GET /v1/swapi/species

One species of the films by uid: classification, language, lifespan and colors.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `uid` | string | yes | Uid of the item, such as 1. (e.g. 1) |
| `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: `averageHeight` (string), `averageLifespan` (string), `classification` (string), `designation` (string), `eyeColors` (string), `hairColors` (string), `homeworld` (string), `language` (string), `name` (string), `people` (Link[]), `people[].url` (string), `skinColors` (string), `uid` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/swapi/species?uid=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swapi/speciesList

List of the species of the films with their uids, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 50. (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: `name` (string), `uid` (string), `url` (string)

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

## GET /v1/swapi/starship

One starship of the films by uid: model, class, crew, speed and pilots.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `uid` | string | yes | Uid of the item, such as 1. (e.g. 12) |
| `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: `cargoCapacity` (string), `consumables` (string), `costInCredits` (string), `crew` (string), `films` (Link[]), `films[].url` (string), `hyperdriveRating` (string), `length` (string), `manufacturer` (string), `maxAtmospheringSpeed` (string), `model` (string), `name` (string), `passengers` (string), `pilots` (Link[]), `pilots[].url` (string), `starshipClass` (string), `uid` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/swapi/starship?uid=12" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swapi/starships

List of the starships of the films with their uids, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 50. (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: `name` (string), `uid` (string), `url` (string)

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

## GET /v1/swapi/vehicle

One vehicle of the films by uid: model, class, crew, speed and pilots.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `uid` | string | yes | Uid of the item, such as 1. (e.g. 14) |
| `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: `cargoCapacity` (string), `consumables` (string), `costInCredits` (string), `crew` (string), `films` (Link[]), `films[].url` (string), `length` (string), `manufacturer` (string), `maxAtmospheringSpeed` (string), `model` (string), `name` (string), `passengers` (string), `pilots` (Link[]), `pilots[].url` (string), `uid` (string), `url` (string), `vehicleClass` (string)

```bash
curl "https://api.hoshime.com/v1/swapi/vehicle?uid=14" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/swapi/vehicles

List of the vehicles of the films with their uids, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 50. (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: `name` (string), `uid` (string), `url` (string)

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

## GET /v1/swapi/films

The six films with their uids and titles, in one list.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `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: `name` (string), `uid` (string), `url` (string)

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

## GET /v1/swapi/searchPeople

People of the Star Wars films whose name contains a text, such as Vader or Skywalker. All matches in one answer, not paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Part of the name, such as Vader or Skywalker. (e.g. Skywalker) |
| `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: `name` (string), `uid` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/swapi/searchPeople?query=Skywalker" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
