# Star Wars API

> Pull canonical Star Wars reference data into a workflow from SWAPI, the Star Wars API: the six films with their opening crawls, 82 characters, 60 planets, 37 species, 36 starships and 39 vehicles. Search all six collections at once to turn what a person typed into the record you need, then read that record with everything it references already resolved to names, which SWAPI itself leaves as bare URLs. Every quoted measurement comes back as a number you can compare and a phrase you can print, so a workflow can sort characters by height, planets by population or starships by cost without tripping over the strings SWAPI stores them as. No account or API key required.

App · Film, TV & Fandom · 14 actions. Web page: https://docs.lodol.com/docs/integrations/swapi

## Actions

### Get a character

Get one character in full: height and mass in both metric and imperial, hair, skin and eye colour, gender, birth year as a number you can compare, and their homeworld, species, films and craft, each one named rather than left as the bare URL SWAPI returns. Name them however you have them, a name or an id. No API key required.

**Inputs**

- Character (`character`, text, required): The character to fetch. Give its name, its SWAPI id, or the SWAPI url from an earlier step: all three work. Capitals, accents and punctuation do not matter.

**Outputs**: One character, with every reference resolved to a name.

- `birth_year` (object): When the character was born, on the in-universe calendar counted from the Battle of Yavin.
- `created` (text): When the record was created, ISO 8601.
- `edited` (text): When it was last edited, ISO 8601.
- `eye_color` (text): Eye colour, or null.
- `eye_colors` (list): The same colours split into a list.
- `film_count` (number): How many films the character appears in there are.
- `film_list` (list): The films the character appears in as id, name, kind and url rows.
- `film_names` (list): The films the character appears in, by name, ready to write into a sentence.
- `films` (list): The films the character appears in as the raw SWAPI URLs the API returned.
- `gender` (text): Gender, or null where SWAPI wrote "n/a" or "none", which it does for the droids.
- `hair_color` (text): Hair colour, or null when SWAPI recorded "unknown" or "n/a". A droid has none.
- `hair_colors` (list): The same colours split into a list.
- `height` (object): How tall the character is, in centimetres.
- `homeworld` (text): The homeworld's SWAPI URL, as the API gave it.
- `homeworld_id` (text): The homeworld's id, for Get a planet.
- `homeworld_name` (text): The homeworld's name, which is the join SWAPI omits.
- `id` (text): The record's id in SWAPI, which is the number at the end of its URL. Every action that takes this record accepts it.
- `kind` (text): The same thing in the singular, e.g. "character".
- `mass` (object): What the character weighs, in kilograms.
- `name` (text): The record's name, or a film's title.
- `resource` (text): Which SWAPI collection it came from: "films", "people", "planets", "species", "starships" or "vehicles".
- `skin_color` (text): Skin colour, or null.
- `skin_colors` (list): The same colours split into a list.
- `species` (list): The species the character belongs to as the raw SWAPI URLs the API returned.
- `species_count` (number): How many species the character belongs to there are.
- `species_list` (list): The species the character belongs to as id, name, kind and url rows.
- `species_names` (list): The species the character belongs to, by name, ready to write into a sentence.
- `species_text` (text): The species in words, or a sentence saying it was not recorded. SWAPI leaves most human characters' species blank, so check this or species_count rather than reading species_names[0].
- `starship_count` (number): How many starships the character has piloted there are.
- `starship_list` (list): The starships the character has piloted as id, name, kind and url rows.
- `starship_names` (list): The starships the character has piloted, by name, ready to write into a sentence.
- `starships` (list): The starships the character has piloted as the raw SWAPI URLs the API returned.
- `url` (text): The record's own SWAPI URL.
- `vehicle_count` (number): How many vehicles the character has piloted there are.
- `vehicle_list` (list): The vehicles the character has piloted as id, name, kind and url rows.
- `vehicle_names` (list): The vehicles the character has piloted, by name, ready to write into a sentence.
- `vehicles` (list): The vehicles the character has piloted as the raw SWAPI URLs the API returned.

**Example output**

```json
{
  "birth_year": {
    "era": "BBY",
    "known": true,
    "text": "19 years before the Battle of Yavin",
    "value": "19BBY",
    "years_from_yavin": -19
  },
  "created": "2014-12-09T13:50:51.644000Z",
  "edited": "2014-12-20T21:17:56.891000Z",
  "eye_color": "blue",
  "eye_colors": [
    "blue"
  ],
  "film_count": 4,
  "film_list": [
    {
      "id": "1",
      "kind": "film",
      "name": "A New Hope",
      "url": "https://swapi.info/api/films/1"
    }
  ],
  "film_names": [
    "A New Hope"
  ],
  "films": [
    "https://swapi.info/api/films/1",
    "https://swapi.info/api/films/2",
    "https://swapi.info/api/films/3",
    "https://swapi.info/api/films/6"
  ],
  "gender": "male",
  "hair_color": "blond",
  "hair_colors": [
    "blond"
  ],
  "height": {
    "known": true,
    "max": 172,
    "min": 172,
    "number": 172,
    "number_in": 67.72,
    "text": "172 cm (67.72 in)",
    "unit": "cm",
    "value": "172"
  },
  "homeworld": "https://swapi.info/api/planets/1",
  "homeworld_id": "1",
  "homeworld_name": "Tatooine",
  "id": "1",
  "kind": "character",
  "mass": {
    "known": true,
    "max": 77,
    "min": 77,
    "number": 77,
    "number_lb": 169.76,
    "text": "77 kg (169.76 lb)",
    "unit": "kg",
    "value": "77"
  },
  "name": "Luke Skywalker",
  "resource": "people",
  "skin_color": "fair",
  "skin_colors": [
    "fair"
  ],
  "species": [],
  "species_count": 0,
  "species_list": [],
  "species_names": [],
  "species_text": "not recorded (SWAPI leaves most human characters' species blank)",
  "starship_count": 1,
  "starship_list": [
    {
      "id": "12",
      "kind": "starship",
      "name": "X-wing",
      "url": "https://swapi.info/api/starships/12"
    }
  ],
  "starship_names": [
    "X-wing"
  ],
  "starships": [
    "https://swapi.info/api/starships/12"
  ],
  "url": "https://swapi.info/api/people/1",
  "vehicle_count": 1,
  "vehicle_list": [
    {
      "id": "14",
      "kind": "vehicle",
      "name": "Snowspeeder",
      "url": "https://swapi.info/api/vehicles/14"
    }
  ],
  "vehicle_names": [
    "Snowspeeder"
  ],
  "vehicles": [
    "https://swapi.info/api/vehicles/14"
  ]
}
```

### Get a film

Get one film in full: its episode number, director, producers, release date and opening crawl, plus its whole cast, its planets, its species and every craft in it, each one named. SWAPI gives those as bare URLs and has no way to expand them, so a film's forty characters would otherwise be forty more requests; here they are already resolved. Name the film by title, by episode or by id. No API key required.

**Inputs**

- Film (`film`, text, required): Name it by title, by episode ("Episode IV" or "Episode 4"), or by its SWAPI id. Note that a bare number is read as the id, and the ids are not the episode numbers: film 1 is Episode IV, because SWAPI numbers the films in release order.

**Outputs**: One film, with every reference in it resolved to a name.

- `character_count` (number): How many characters in the film there are.
- `character_list` (list): The characters in the film as id, name, kind and url rows.
- `character_names` (list): The characters in the film, by name, ready to write into a sentence.
- `characters` (list): The characters in the film as the raw SWAPI URLs the API returned.
- `created` (text): When the record was created, ISO 8601.
- `director` (text): Who directed it.
- `edited` (text): When it was last edited, ISO 8601.
- `episode` (text): The episode as the films write it, e.g. "Episode IV".
- `episode_id` (number): The episode number, 1 to 6. Not the same as the id: film 1 is Episode IV.
- `id` (text): The record's id in SWAPI, which is the number at the end of its URL. Every action that takes this record accepts it.
- `kind` (text): The same thing in the singular, e.g. "character".
- `name` (text): The record's name, or a film's title.
- `opening_crawl` (text): The opening crawl exactly as SWAPI stores it: hard-wrapped at about thirty characters with carriage returns.
- `opening_crawl_message` (text): The crawl reflowed into paragraphs. This is the one to put in an email, a message or a document.
- `opening_crawl_paragraphs` (list): The crawl's stanzas, each unwrapped onto one line.
- `opening_crawl_text` (text): The same crawl with the carriage returns taken out.
- `planet_count` (number): How many planets in the film there are.
- `planet_list` (list): The planets in the film as id, name, kind and url rows.
- `planet_names` (list): The planets in the film, by name, ready to write into a sentence.
- `planets` (list): The planets in the film as the raw SWAPI URLs the API returned.
- `producer` (text): Who produced it, as SWAPI's own comma-joined string.
- `producers` (list): The same producers split into a list.
- `release_date` (text): The original release date, YYYY-MM-DD.
- `resource` (text): Which SWAPI collection it came from: "films", "people", "planets", "species", "starships" or "vehicles".
- `species` (list): The species in the film as the raw SWAPI URLs the API returned.
- `species_count` (number): How many species in the film there are.
- `species_list` (list): The species in the film as id, name, kind and url rows.
- `species_names` (list): The species in the film, by name, ready to write into a sentence.
- `starship_count` (number): How many starships in the film there are.
- `starship_list` (list): The starships in the film as id, name, kind and url rows.
- `starship_names` (list): The starships in the film, by name, ready to write into a sentence.
- `starships` (list): The starships in the film as the raw SWAPI URLs the API returned.
- `title` (text): The film's title.
- `url` (text): The record's own SWAPI URL.
- `vehicle_count` (number): How many vehicles in the film there are.
- `vehicle_list` (list): The vehicles in the film as id, name, kind and url rows.
- `vehicle_names` (list): The vehicles in the film, by name, ready to write into a sentence.
- `vehicles` (list): The vehicles in the film as the raw SWAPI URLs the API returned.

**Example output**

```json
{
  "character_count": 1,
  "character_list": [
    {
      "id": "1",
      "kind": "character",
      "name": "Luke Skywalker",
      "url": "https://swapi.info/api/people/1"
    }
  ],
  "character_names": [
    "Luke Skywalker"
  ],
  "characters": [
    "https://swapi.info/api/people/1"
  ],
  "created": "2014-12-10T14:23:31.880000Z",
  "director": "George Lucas",
  "edited": "2014-12-20T19:49:45.256000Z",
  "episode": "Episode IV",
  "episode_id": 4,
  "id": "1",
  "kind": "film",
  "name": "A New Hope",
  "opening_crawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.",
  "opening_crawl_message": "It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\n\nDuring the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR, an armored space station with enough power to destroy an entire planet.",
  "opening_crawl_paragraphs": [
    "It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.",
    "During the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR, an armored space station with enough power to destroy an entire planet."
  ],
  "opening_crawl_text": "It is a period of civil war.\nRebel spaceships, striking\nfrom a hidden base, have won\ntheir first victory against\nthe evil Galactic Empire.\n\nDuring the battle, Rebel\nspies managed to steal secret\nplans to the Empire's\nultimate weapon, the DEATH\nSTAR, an armored space\nstation with enough power\nto destroy an entire planet.",
  "planet_count": 1,
  "planet_list": [
    {
      "id": "1",
      "kind": "planet",
      "name": "Tatooine",
      "url": "https://swapi.info/api/planets/1"
    }
  ],
  "planet_names": [
    "Tatooine"
  ],
  "planets": [
    "https://swapi.info/api/planets/1"
  ],
  "producer": "Gary Kurtz, Rick McCallum",
  "producers": [
    "Gary Kurtz",
    "Rick McCallum"
  ],
  "release_date": "1977-05-25",
  "resource": "films",
  "species": [
    "https://swapi.info/api/species/1"
  ],
  "species_count": 1,
  "species_list": [
    {
      "id": "1",
      "kind": "species",
      "name": "Human",
      "url": "https://swapi.info/api/species/1"
    }
  ],
  "species_names": [
    "Human"
  ],
  "starship_count": 1,
  "starship_list": [
    {
      "id": "12",
      "kind": "starship",
      "name": "X-wing",
      "url": "https://swapi.info/api/starships/12"
    }
  ],
  "starship_names": [
    "X-wing"
  ],
  "starships": [
    "https://swapi.info/api/starships/12"
  ],
  "title": "A New Hope",
  "url": "https://swapi.info/api/films/1",
  "vehicle_count": 1,
  "vehicle_list": [
    {
      "id": "14",
      "kind": "vehicle",
      "name": "Snowspeeder",
      "url": "https://swapi.info/api/vehicles/14"
    }
  ],
  "vehicle_names": [
    "Snowspeeder"
  ],
  "vehicles": [
    "https://swapi.info/api/vehicles/14"
  ]
}
```

### Get a planet

Get one planet in full: its climate and terrain split into lists, its gravity, and its diameter, population, day length and year length as numbers you can compare rather than the strings SWAPI quotes them as. The characters from it and the films it appears in come back named. No API key required.

**Inputs**

- Planet (`planet`, text, required): The planet to fetch. Give its name, its SWAPI id, or the SWAPI url from an earlier step: all three work. Capitals, accents and punctuation do not matter.

**Outputs**: One planet, with its residents and films named.

- `climate` (text): The climate, as SWAPI's own comma-joined string, or null.
- `climates` (list): The same climates split into a list.
- `created` (text): When the record was created, ISO 8601.
- `diameter` (object): The planet's diameter, in kilometres.
- `edited` (text): When it was last edited, ISO 8601.
- `film_count` (number): How many films the planet appears in there are.
- `film_list` (list): The films the planet appears in as id, name, kind and url rows.
- `film_names` (list): The films the planet appears in, by name, ready to write into a sentence.
- `films` (list): The films the planet appears in as the raw SWAPI URLs the API returned.
- `gravity` (text): Gravity relative to standard, e.g. "1 standard".
- `id` (text): The record's id in SWAPI, which is the number at the end of its URL. Every action that takes this record accepts it.
- `kind` (text): The same thing in the singular, e.g. "character".
- `name` (text): The record's name, or a film's title.
- `orbital_period` (object): How long a year is, in standard days.
- `population` (object): How many people live there.
- `resident_count` (number): How many characters from this planet there are.
- `resident_list` (list): The characters from this planet as id, name, kind and url rows.
- `resident_names` (list): The characters from this planet, by name, ready to write into a sentence.
- `residents` (list): The characters from this planet as the raw SWAPI URLs the API returned.
- `resource` (text): Which SWAPI collection it came from: "films", "people", "planets", "species", "starships" or "vehicles".
- `rotation_period` (object): How long a day is, in standard hours.
- `surface_water` (object): How much of the surface is water, as a percentage.
- `terrain` (text): The terrain, as SWAPI's own comma-joined string, or null.
- `terrains` (list): The same terrains split into a list.
- `url` (text): The record's own SWAPI URL.

**Example output**

```json
{
  "climate": "arid",
  "climates": [
    "arid"
  ],
  "created": "2014-12-09T13:50:49.641000Z",
  "diameter": {
    "known": true,
    "max": 10465,
    "min": 10465,
    "number": 10465,
    "text": "10,465 km",
    "unit": "km",
    "value": "10465"
  },
  "edited": "2014-12-20T20:58:18.411000Z",
  "film_count": 1,
  "film_list": [
    {
      "id": "1",
      "kind": "film",
      "name": "A New Hope",
      "url": "https://swapi.info/api/films/1"
    }
  ],
  "film_names": [
    "A New Hope"
  ],
  "films": [
    "https://swapi.info/api/films/1"
  ],
  "gravity": "1 standard",
  "id": "1",
  "kind": "planet",
  "name": "Tatooine",
  "orbital_period": {
    "known": true,
    "max": 304,
    "min": 304,
    "number": 304,
    "text": "304 days",
    "unit": "days",
    "value": "304"
  },
  "population": {
    "known": true,
    "max": 200000,
    "min": 200000,
    "number": 200000,
    "text": "200,000 people",
    "unit": "people",
    "value": "200000"
  },
  "resident_count": 1,
  "resident_list": [
    {
      "id": "1",
      "kind": "character",
      "name": "Luke Skywalker",
      "url": "https://swapi.info/api/people/1"
    }
  ],
  "resident_names": [
    "Luke Skywalker"
  ],
  "residents": [
    "https://swapi.info/api/people/1"
  ],
  "resource": "planets",
  "rotation_period": {
    "known": true,
    "max": 23,
    "min": 23,
    "number": 23,
    "text": "23 hours",
    "unit": "hours",
    "value": "23"
  },
  "surface_water": {
    "known": true,
    "max": 1,
    "min": 1,
    "number": 1,
    "text": "1%",
    "unit": "%",
    "value": "1"
  },
  "terrain": "desert",
  "terrains": [
    "desert"
  ],
  "url": "https://swapi.info/api/planets/1"
}
```

### Get a species

Get one species in full: its classification and designation, its language, its average height and lifespan, and the colours it comes in, split into lists rather than left as comma-joined strings. Its homeworld, its named characters and its films come back named. No API key required.

**Inputs**

- Species (`species`, text, required): The species to fetch. Give its name, its SWAPI id, or the SWAPI url from an earlier step: all three work. Capitals, accents and punctuation do not matter.

**Outputs**: One species, with its homeworld, people and films named.

- `average_height` (object): Average height, in centimetres.
- `average_lifespan` (object): Average lifespan in years. The Hutt value is "indefinite", which is recorded but not a number.
- `classification` (text): What kind of thing it is, e.g. "mammal" or "reptile". SWAPI writes these by hand, so both mammal and mammals appear.
- `created` (text): When the record was created, ISO 8601.
- `designation` (text): Usually "sentient".
- `edited` (text): When it was last edited, ISO 8601.
- `eye_colors` (list): The common eye colours, split into a list.
- `film_count` (number): How many films the species appears in there are.
- `film_list` (list): The films the species appears in as id, name, kind and url rows.
- `film_names` (list): The films the species appears in, by name, ready to write into a sentence.
- `films` (list): The films the species appears in as the raw SWAPI URLs the API returned.
- `hair_colors` (list): The common hair colours, split into a list.
- `homeworld` (text): The homeworld's SWAPI URL, or null for a species with none.
- `homeworld_id` (text): The homeworld's id, for Get a planet.
- `homeworld_name` (text): The homeworld's name.
- `id` (text): The record's id in SWAPI, which is the number at the end of its URL. Every action that takes this record accepts it.
- `kind` (text): The same thing in the singular, e.g. "character".
- `language` (text): The language commonly spoken.
- `name` (text): The record's name, or a film's title.
- `people` (list): The named characters of this species as the raw SWAPI URLs the API returned.
- `person_count` (number): How many named characters of this species there are.
- `person_list` (list): The named characters of this species as id, name, kind and url rows.
- `person_names` (list): The named characters of this species, by name, ready to write into a sentence.
- `resource` (text): Which SWAPI collection it came from: "films", "people", "planets", "species", "starships" or "vehicles".
- `skin_colors` (list): The common skin colours, split into a list.
- `url` (text): The record's own SWAPI URL.

**Example output**

```json
{
  "average_height": {
    "known": true,
    "max": 180,
    "min": 180,
    "number": 180,
    "number_in": 70.87,
    "text": "180 cm (70.87 in)",
    "unit": "cm",
    "value": "180"
  },
  "average_lifespan": {
    "known": true,
    "max": 120,
    "min": 120,
    "number": 120,
    "text": "120 years",
    "unit": "years",
    "value": "120"
  },
  "classification": "mammal",
  "created": "2014-12-10T13:52:11.567000Z",
  "designation": "sentient",
  "edited": "2014-12-20T21:36:42.136000Z",
  "eye_colors": [
    "brown",
    "blue",
    "green",
    "hazel",
    "grey",
    "amber"
  ],
  "film_count": 1,
  "film_list": [
    {
      "id": "1",
      "kind": "film",
      "name": "A New Hope",
      "url": "https://swapi.info/api/films/1"
    }
  ],
  "film_names": [
    "A New Hope"
  ],
  "films": [
    "https://swapi.info/api/films/1"
  ],
  "hair_colors": [
    "blonde",
    "brown",
    "black",
    "red"
  ],
  "homeworld": "https://swapi.info/api/planets/9",
  "homeworld_id": null,
  "homeworld_name": null,
  "id": "1",
  "kind": "species",
  "language": "Galactic Basic",
  "name": "Human",
  "people": [
    "https://swapi.info/api/people/1"
  ],
  "person_count": 1,
  "person_list": [
    {
      "id": "1",
      "kind": "character",
      "name": "Luke Skywalker",
      "url": "https://swapi.info/api/people/1"
    }
  ],
  "person_names": [
    "Luke Skywalker"
  ],
  "resource": "species",
  "skin_colors": [
    "caucasian",
    "black",
    "asian",
    "hispanic"
  ],
  "url": "https://swapi.info/api/species/1"
}
```

### Get a starship

Get one starship in full: its model, manufacturer, class, cost, length, crew, capacity, hyperdrive rating and sublight speed, with every quoted number parsed into one you can compare. Its pilots and films come back named. A starship in SWAPI is a craft with a hyperdrive; the ones without are vehicles, and the two share one set of ids, so an id that is not a starship is reported as whichever vehicle it is. No API key required.

**Inputs**

- Starship (`starship`, text, required): The starship to fetch. Give its name, its SWAPI id, or the SWAPI url from an earlier step: all three work. Capitals, accents and punctuation do not matter.

**Outputs**: One starship, with its pilots and films named.

- `MGLT` (object): Megalights per hour, SWAPI's own unit for comparing sublight speeds.
- `cargo_capacity` (object): How much it can carry, in kilograms.
- `class` (text): The craft's class. SWAPI's casing is inconsistent (both "Starfighter" and "starfighter" are in the data), so compare it case-insensitively.
- `consumables` (object): How long it can feed its crew without resupplying. A duration such as "2 months" rather than a number.
- `cost_in_credits` (object): What it cost new, in galactic credits.
- `created` (text): When the record was created, ISO 8601.
- `crew` (object): How many people are needed to run it.
- `edited` (text): When it was last edited, ISO 8601.
- `film_count` (number): How many films it appears in there are.
- `film_list` (list): The films it appears in as id, name, kind and url rows.
- `film_names` (list): The films it appears in, by name, ready to write into a sentence.
- `films` (list): The films it appears in as the raw SWAPI URLs the API returned.
- `hyperdrive_rating` (object): The hyperdrive class. Lower is faster: the Millennium Falcon's 0.5 is the fastest in the data.
- `id` (text): The record's id in SWAPI, which is the number at the end of its URL. Every action that takes this record accepts it.
- `kind` (text): The same thing in the singular, e.g. "character".
- `length` (object): How long it is, in metres.
- `manufacturer` (text): Who built it, as SWAPI's own comma-joined string.
- `manufacturers` (list): The same manufacturers split into a list.
- `max_atmosphering_speed` (object): Top speed in atmosphere. SWAPI's units vary and some values carry them in the string, e.g. "1000km".
- `model` (text): The official model, e.g. "T-65 X-wing".
- `name` (text): The record's name, or a film's title.
- `passengers` (object): How many non-essential people it can carry.
- `pilot_count` (number): How many characters who have piloted it there are.
- `pilot_list` (list): The characters who have piloted it as id, name, kind and url rows.
- `pilot_names` (list): The characters who have piloted it, by name, ready to write into a sentence.
- `pilots` (list): The characters who have piloted it as the raw SWAPI URLs the API returned.
- `resource` (text): Which SWAPI collection it came from: "films", "people", "planets", "species", "starships" or "vehicles".
- `starship_class` (text): The same class under SWAPI's own field name.
- `url` (text): The record's own SWAPI URL.

**Example output**

```json
{
  "MGLT": {
    "known": true,
    "max": 100,
    "min": 100,
    "number": 100,
    "text": "100 MGLT",
    "unit": "MGLT",
    "value": "100"
  },
  "cargo_capacity": {
    "known": true,
    "max": 110,
    "min": 110,
    "number": 110,
    "text": "110 kg",
    "unit": "kg",
    "value": "110"
  },
  "class": "Starfighter",
  "consumables": {
    "known": true,
    "max": 1,
    "min": 1,
    "number": 1,
    "text": "1",
    "unit": "",
    "value": "1 week"
  },
  "cost_in_credits": {
    "known": true,
    "max": 149999,
    "min": 149999,
    "number": 149999,
    "text": "149,999 credits",
    "unit": "credits",
    "value": "149999"
  },
  "created": "2014-12-12T11:19:05.340000Z",
  "crew": {
    "known": true,
    "max": 1,
    "min": 1,
    "number": 1,
    "text": "1",
    "unit": "",
    "value": "1"
  },
  "edited": "2014-12-20T21:23:49.886000Z",
  "film_count": 1,
  "film_list": [
    {
      "id": "1",
      "kind": "film",
      "name": "A New Hope",
      "url": "https://swapi.info/api/films/1"
    }
  ],
  "film_names": [
    "A New Hope"
  ],
  "films": [
    "https://swapi.info/api/films/1"
  ],
  "hyperdrive_rating": {
    "known": true,
    "max": 1,
    "min": 1,
    "number": 1,
    "text": "1",
    "unit": "",
    "value": "1.0"
  },
  "id": "12",
  "kind": "starship",
  "length": {
    "known": true,
    "max": 12.5,
    "min": 12.5,
    "number": 12.5,
    "number_ft": 41.01,
    "text": "12.5 m (41.01 ft)",
    "unit": "m",
    "value": "12.5"
  },
  "manufacturer": "Incom Corporation",
  "manufacturers": [
    "Incom Corporation"
  ],
  "max_atmosphering_speed": {
    "known": true,
    "max": 1050,
    "min": 1050,
    "number": 1050,
    "text": "1,050",
    "unit": "",
    "value": "1050"
  },
  "model": "T-65 X-wing",
  "name": "X-wing",
  "passengers": {
    "known": true,
    "max": 0,
    "min": 0,
    "number": 0,
    "text": "0",
    "unit": "",
    "value": "0"
  },
  "pilot_count": 1,
  "pilot_list": [
    {
      "id": "1",
      "kind": "character",
      "name": "Luke Skywalker",
      "url": "https://swapi.info/api/people/1"
    }
  ],
  "pilot_names": [
    "Luke Skywalker"
  ],
  "pilots": [
    "https://swapi.info/api/people/1"
  ],
  "resource": "starships",
  "starship_class": "Starfighter",
  "url": "https://swapi.info/api/starships/12"
}
```

### Get a vehicle

Get one vehicle in full: its model, manufacturer, class, cost, length, crew and capacity, with every quoted number parsed into one you can compare. Its pilots and films come back named. A vehicle in SWAPI is a craft with no hyperdrive; the ones with are starships, and the two share one set of ids, so an id that is not a vehicle is reported as whichever starship it is. No API key required.

**Inputs**

- Vehicle (`vehicle`, text, required): The vehicle to fetch. Give its name, its SWAPI id, or the SWAPI url from an earlier step: all three work. Capitals, accents and punctuation do not matter.

**Outputs**: One vehicle, with its pilots and films named.

- `cargo_capacity` (object): How much it can carry, in kilograms.
- `class` (text): The craft's class. SWAPI's casing is inconsistent (both "Starfighter" and "starfighter" are in the data), so compare it case-insensitively.
- `consumables` (object): How long it can feed its crew without resupplying. A duration such as "2 months" rather than a number.
- `cost_in_credits` (object): What it cost new, in galactic credits.
- `created` (text): When the record was created, ISO 8601.
- `crew` (object): How many people are needed to run it.
- `edited` (text): When it was last edited, ISO 8601.
- `film_count` (number): How many films it appears in there are.
- `film_list` (list): The films it appears in as id, name, kind and url rows.
- `film_names` (list): The films it appears in, by name, ready to write into a sentence.
- `films` (list): The films it appears in as the raw SWAPI URLs the API returned.
- `id` (text): The record's id in SWAPI, which is the number at the end of its URL. Every action that takes this record accepts it.
- `kind` (text): The same thing in the singular, e.g. "character".
- `length` (object): How long it is, in metres.
- `manufacturer` (text): Who built it, as SWAPI's own comma-joined string.
- `manufacturers` (list): The same manufacturers split into a list.
- `max_atmosphering_speed` (object): Top speed in atmosphere. SWAPI's units vary and some values carry them in the string, e.g. "1000km".
- `model` (text): The official model, e.g. "T-65 X-wing".
- `name` (text): The record's name, or a film's title.
- `passengers` (object): How many non-essential people it can carry.
- `pilot_count` (number): How many characters who have piloted it there are.
- `pilot_list` (list): The characters who have piloted it as id, name, kind and url rows.
- `pilot_names` (list): The characters who have piloted it, by name, ready to write into a sentence.
- `pilots` (list): The characters who have piloted it as the raw SWAPI URLs the API returned.
- `resource` (text): Which SWAPI collection it came from: "films", "people", "planets", "species", "starships" or "vehicles".
- `url` (text): The record's own SWAPI URL.
- `vehicle_class` (text): The same class under SWAPI's own field name.

**Example output**

```json
{
  "cargo_capacity": {
    "known": true,
    "max": 10,
    "min": 10,
    "number": 10,
    "text": "10 kg",
    "unit": "kg",
    "value": "10"
  },
  "class": "airspeeder",
  "consumables": {
    "known": false,
    "max": null,
    "min": null,
    "number": null,
    "text": "unknown",
    "unit": "",
    "value": "none"
  },
  "cost_in_credits": {
    "known": false,
    "max": null,
    "min": null,
    "number": null,
    "text": "unknown",
    "unit": "credits",
    "value": "unknown"
  },
  "created": "2014-12-15T12:22:12Z",
  "crew": {
    "known": true,
    "max": 2,
    "min": 2,
    "number": 2,
    "text": "2",
    "unit": "",
    "value": "2"
  },
  "edited": "2014-12-20T21:30:21.672000Z",
  "film_count": 1,
  "film_list": [],
  "film_names": [],
  "films": [
    "https://swapi.info/api/films/2"
  ],
  "id": "14",
  "kind": "vehicle",
  "length": {
    "known": true,
    "max": 4.5,
    "min": 4.5,
    "number": 4.5,
    "number_ft": 14.76,
    "text": "4.5 m (14.76 ft)",
    "unit": "m",
    "value": "4.5"
  },
  "manufacturer": "Incom corporation",
  "manufacturers": [
    "Incom corporation"
  ],
  "max_atmosphering_speed": {
    "known": true,
    "max": 650,
    "min": 650,
    "number": 650,
    "text": "650",
    "unit": "",
    "value": "650"
  },
  "model": "t-47 airspeeder",
  "name": "Snowspeeder",
  "passengers": {
    "known": true,
    "max": 0,
    "min": 0,
    "number": 0,
    "text": "0",
    "unit": "",
    "value": "0"
  },
  "pilot_count": 1,
  "pilot_list": [
    {
      "id": "1",
      "kind": "character",
      "name": "Luke Skywalker",
      "url": "https://swapi.info/api/people/1"
    }
  ],
  "pilot_names": [
    "Luke Skywalker"
  ],
  "pilots": [
    "https://swapi.info/api/people/1"
  ],
  "resource": "vehicles",
  "url": "https://swapi.info/api/vehicles/14",
  "vehicle_class": "airspeeder"
}
```

### Get an opening crawl

Get the opening crawl of one film, in a shape a message can actually use. SWAPI stores it typeset for a cinema screen, hard-wrapped at about thirty characters with carriage returns on every line, so pasting it into an email gives ragged half-lines. It comes back here three ways: as served, with the carriage returns taken out, and reflowed into the paragraphs it was written in. No API key required.

**Inputs**

- Film (`film`, text, required): Name it by title, by episode ("Episode IV" or "Episode 4"), or by its SWAPI id. Note that a bare number is read as the id, and the ids are not the episode numbers: film 1 is Episode IV, because SWAPI numbers the films in release order.

**Outputs**: One film's opening crawl, plus what film it is.

- `director` (text): Who directed it.
- `episode` (text): The episode, e.g. "Episode IV".
- `episode_id` (number): The episode number, 1 to 6.
- `heading` (text): A title line to put above the crawl, e.g. "Episode IV: A New Hope".
- `id` (text): The film's SWAPI id.
- `opening_crawl` (text): The crawl exactly as SWAPI stores it, carriage returns and all.
- `opening_crawl_text` (text): The crawl with the carriage returns replaced by plain newlines, still hard-wrapped.
- `paragraph_count` (number): How many paragraphs the crawl has.
- `paragraphs` (list): The same paragraphs as separate strings.
- `release_date` (text): The release date, YYYY-MM-DD.
- `text` (text): The crawl reflowed into paragraphs. This is the one to put in an email, a message or a document.
- `title` (text): The film's title.
- `url` (text): The film's SWAPI url.
- `word_count` (number): How many words it runs to.

**Example output**

```json
{
  "director": "George Lucas",
  "episode": "Episode IV",
  "episode_id": 4,
  "heading": "Episode IV: A New Hope",
  "id": "1",
  "opening_crawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.",
  "opening_crawl_text": "It is a period of civil war.\nRebel spaceships, striking\nfrom a hidden base, have won\ntheir first victory against\nthe evil Galactic Empire.\n\nDuring the battle, Rebel\nspies managed to steal secret\nplans to the Empire's\nultimate weapon, the DEATH\nSTAR, an armored space\nstation with enough power\nto destroy an entire planet.",
  "paragraph_count": 2,
  "paragraphs": [
    "It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.",
    "During the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR, an armored space station with enough power to destroy an entire planet."
  ],
  "release_date": "1977-05-25",
  "text": "It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\n\nDuring the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR, an armored space station with enough power to destroy an entire planet.",
  "title": "A New Hope",
  "url": "https://swapi.info/api/films/1",
  "word_count": 54
}
```

### List characters

Browse all 82 of SWAPI's characters at once, or narrow them to the ones worth looking at: one film's cast, one species, one homeworld or one gender. Order them by name, by height, by mass or by age, which works because the birth years are parsed off the in-universe calendar rather than compared as text. No API key required.

**Inputs**

- Film (`film`, text): Optional. Narrow the result to one film. Name it by title, by episode ("Episode IV" or "Episode 4"), or by its SWAPI id. Note that a bare number is read as the id, and the ids are not the episode numbers: film 1 is Episode IV, because SWAPI numbers the films in release order.
- Species (`species`, text): Optional. Keep only characters of this species. Give its name, its SWAPI id, or the SWAPI url from an earlier step: all three work. Capitals, accents and punctuation do not matter. Note that SWAPI leaves most human characters' species blank, so filtering by "Human" returns only the four it did link.
- Homeworld (`homeworld`, text): Optional. Keep only characters from this planet. Give its name, its SWAPI id, or the SWAPI url from an earlier step: all three work. Capitals, accents and punctuation do not matter.
- Gender (`gender`, text): Optional. Keep only characters SWAPI records as this gender. Leave it unset for all of them. One of: `male`, `female`, `hermaphrodite`, `n/a` (Not applicable (the droids)), `none` (None recorded).
- Order by (`sort`, text): Optional. How to order the result. By name by default. A character SWAPI never recorded the sorted value for goes to the end rather than to the front. One of: `name` (Name (A to Z)), `tallest` (Tallest first), `heaviest` (Heaviest first), `oldest` (Oldest first (by birth year)). Default: `name`.
- Number of results (`limit`, number): Optional. How many characters to return in this page. Between 1 and 100; 100 by default, which is enough to hold every record SWAPI has of this kind, so lower it only to shorten the result. From 1 to 100. Default: `100`.
- Skip (`offset`, number): Optional. How many records to skip before this page. Use the next offset from the previous result to page through. 0 by default. At least 0. Default: `0`.

**Outputs**

- `characters` (list): The characters in this page, in the order asked for.
- `count` (number): How many records are in this page.
- `film_title` (text): The film this result was narrowed to, or null.
- `has_more` (true/false): Whether there are more records after this page.
- `homeworld_name` (text): The homeworld this was narrowed to, or null.
- `next_offset` (number): The offset to pass to get the next page, or null when this is the last one.
- `sort` (text): The order this result was put in.
- `species_name` (text): The species this was narrowed to, or null.
- `total_count` (number): How many records matched in total, across every page.

**Example output**

```json
{
  "characters": [
    {
      "birth_year": {
        "era": "BBY",
        "known": true,
        "text": "19 years before the Battle of Yavin",
        "value": "19BBY",
        "years_from_yavin": -19
      },
      "created": "2014-12-09T13:50:51.644000Z",
      "edited": "2014-12-20T21:17:56.891000Z",
      "eye_color": "blue",
      "eye_colors": [
        "blue"
      ],
      "film_count": 4,
      "film_list": [
        {
          "id": "1",
          "kind": "film",
          "name": "A New Hope",
          "url": "https://swapi.info/api/films/1"
        }
      ],
      "film_names": [
        "A New Hope"
      ],
      "films": [
        "https://swapi.info/api/films/1",
        "https://swapi.info/api/films/2",
        "https://swapi.info/api/films/3",
        "https://swapi.info/api/films/6"
      ],
      "gender": "male",
      "hair_color": "blond",
      "hair_colors": [
        "blond"
      ],
      "height": {
        "known": true,
        "max": 172,
        "min": 172,
        "number": 172,
        "number_in": 67.72,
        "text": "172 cm (67.72 in)",
        "unit": "cm",
        "value": "172"
      },
      "homeworld": "https://swapi.info/api/planets/1",
      "homeworld_id": "1",
      "homeworld_name": "Tatooine",
      "id": "1",
      "kind": "character",
      "mass": {
        "known": true,
        "max": 77,
        "min": 77,
        "number": 77,
        "number_lb": 169.76,
        "text": "77 kg (169.76 lb)",
        "unit": "kg",
        "value": "77"
      },
      "name": "Luke Skywalker",
      "resource": "people",
      "skin_color": "fair",
      "skin_colors": [
        "fair"
      ],
      "species": [],
      "species_count": 0,
      "species_list": [],
      "species_names": [],
      "species_text": "not recorded (SWAPI leaves most human characters' species blank)",
      "starship_count": 1,
      "starship_list": [
        {
          "id": "12",
          "kind": "starship",
          "name": "X-wing",
          "url": "https://swapi.info/api/starships/12"
        }
      ],
      "starship_names": [
        "X-wing"
      ],
      "starships": [
        "https://swapi.info/api/starships/12"
      ],
      "url": "https://swapi.info/api/people/1",
      "vehicle_count": 1,
      "vehicle_list": [
        {
          "id": "14",
          "kind": "vehicle",
          "name": "Snowspeeder",
          "url": "https://swapi.info/api/vehicles/14"
        }
      ],
      "vehicle_names": [
        "Snowspeeder"
      ],
      "vehicles": [
        "https://swapi.info/api/vehicles/14"
      ]
    }
  ],
  "count": 1,
  "film_title": null,
  "has_more": false,
  "homeworld_name": null,
  "next_offset": null,
  "sort": "name",
  "species_name": null,
  "total_count": 1
}
```

### List films

List the six films, in either of the two orders people mean by "in order": by episode, which runs from The Phantom Menace, or by release date, which runs from A New Hope. Each film comes back with both numbers and its release date, so a workflow never has to guess which order it is holding. No API key required.

**Inputs**

- Director (`director`, text): Optional. Keep only films whose director contains this text. "Lucas" finds the four George Lucas directed.
- Order by (`sort`, text): Optional. How to order the result. By episode by default. A film SWAPI never recorded the sorted value for goes to the end rather than to the front. One of: `episode` (Episode number (I to VI)), `release_date` (Release date (1977 first)), `title` (Title (A to Z)). Default: `episode`.
- Number of results (`limit`, number): Optional. How many films to return in this page. Between 1 and 100; 100 by default, which is enough to hold every record SWAPI has of this kind, so lower it only to shorten the result. From 1 to 100. Default: `100`.
- Skip (`offset`, number): Optional. How many records to skip before this page. Use the next offset from the previous result to page through. 0 by default. At least 0. Default: `0`.

**Outputs**

- `count` (number): How many records are in this page.
- `director` (text): The director filter that was applied, or null.
- `films` (list): The films in this page, in the order asked for.
- `has_more` (true/false): Whether there are more records after this page.
- `next_offset` (number): The offset to pass to get the next page, or null when this is the last one.
- `sort` (text): The order this result was put in.
- `total_count` (number): How many records matched in total, across every page.

**Example output**

```json
{
  "count": 1,
  "director": null,
  "films": [
    {
      "character_count": 1,
      "character_list": [
        {
          "id": "1",
          "kind": "character",
          "name": "Luke Skywalker",
          "url": "https://swapi.info/api/people/1"
        }
      ],
      "character_names": [
        "Luke Skywalker"
      ],
      "characters": [
        "https://swapi.info/api/people/1"
      ],
      "created": "2014-12-10T14:23:31.880000Z",
      "director": "George Lucas",
      "edited": "2014-12-20T19:49:45.256000Z",
      "episode": "Episode IV",
      "episode_id": 4,
      "id": "1",
      "kind": "film",
      "name": "A New Hope",
      "opening_crawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.",
      "opening_crawl_message": "It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\n\nDuring the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR, an armored space station with enough power to destroy an entire planet.",
      "opening_crawl_paragraphs": [
        "It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.",
        "During the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR, an armored space station with enough power to destroy an entire planet."
      ],
      "opening_crawl_text": "It is a period of civil war.\nRebel spaceships, striking\nfrom a hidden base, have won\ntheir first victory against\nthe evil Galactic Empire.\n\nDuring the battle, Rebel\nspies managed to steal secret\nplans to the Empire's\nultimate weapon, the DEATH\nSTAR, an armored space\nstation with enough power\nto destroy an entire planet.",
      "planet_count": 1,
      "planet_list": [
        {
          "id": "1",
          "kind": "planet",
          "name": "Tatooine",
          "url": "https://swapi.info/api/planets/1"
        }
      ],
      "planet_names": [
        "Tatooine"
      ],
      "planets": [
        "https://swapi.info/api/planets/1"
      ],
      "producer": "Gary Kurtz, Rick McCallum",
      "producers": [
        "Gary Kurtz",
        "Rick McCallum"
      ],
      "release_date": "1977-05-25",
      "resource": "films",
      "species": [
        "https://swapi.info/api/species/1"
      ],
      "species_count": 1,
      "species_list": [
        {
          "id": "1",
          "kind": "species",
          "name": "Human",
          "url": "https://swapi.info/api/species/1"
        }
      ],
      "species_names": [
        "Human"
      ],
      "starship_count": 1,
      "starship_list": [
        {
          "id": "12",
          "kind": "starship",
          "name": "X-wing",
          "url": "https://swapi.info/api/starships/12"
        }
      ],
      "starship_names": [
        "X-wing"
      ],
      "starships": [
        "https://swapi.info/api/starships/12"
      ],
      "title": "A New Hope",
      "url": "https://swapi.info/api/films/1",
      "vehicle_count": 1,
      "vehicle_list": [
        {
          "id": "14",
          "kind": "vehicle",
          "name": "Snowspeeder",
          "url": "https://swapi.info/api/vehicles/14"
        }
      ],
      "vehicle_names": [
        "Snowspeeder"
      ],
      "vehicles": [
        "https://swapi.info/api/vehicles/14"
      ]
    }
  ],
  "has_more": false,
  "next_offset": null,
  "sort": "episode",
  "total_count": 1
}
```

### List planets

Browse all 60 of SWAPI's planets at once, or narrow them by climate, by terrain or to the ones in one film. Climate and terrain are matched as words inside SWAPI's own comma-joined strings, so "desert" finds a planet recorded as "desert, mountains" too. Order them by name, population, diameter or year length. No API key required.

**Inputs**

- Film (`film`, text): Optional. Narrow the result to one film. Name it by title, by episode ("Episode IV" or "Episode 4"), or by its SWAPI id. Note that a bare number is read as the id, and the ids are not the episode numbers: film 1 is Episode IV, because SWAPI numbers the films in release order.
- Climate (`climate`, text): Optional. Keep only planets whose climate mentions this word. Capitals do not matter.
- Terrain (`terrain`, text): Optional. Keep only planets whose terrain mentions this word. Capitals do not matter.
- Order by (`sort`, text): Optional. How to order the result. By name by default. A planet SWAPI never recorded the sorted value for goes to the end rather than to the front. One of: `name` (Name (A to Z)), `population` (Most populous first), `diameter` (Largest first), `orbital_period` (Longest year first). Default: `name`.
- Number of results (`limit`, number): Optional. How many planets to return in this page. Between 1 and 100; 100 by default, which is enough to hold every record SWAPI has of this kind, so lower it only to shorten the result. From 1 to 100. Default: `100`.
- Skip (`offset`, number): Optional. How many records to skip before this page. Use the next offset from the previous result to page through. 0 by default. At least 0. Default: `0`.

**Outputs**

- `climate` (text): The climate filter that was applied, or null.
- `count` (number): How many records are in this page.
- `film_title` (text): The film this result was narrowed to, or null.
- `has_more` (true/false): Whether there are more records after this page.
- `next_offset` (number): The offset to pass to get the next page, or null when this is the last one.
- `planets` (list): The planets in this page, in the order asked for.
- `sort` (text): The order this result was put in.
- `terrain` (text): The terrain filter that was applied, or null.
- `total_count` (number): How many records matched in total, across every page.

**Example output**

```json
{
  "climate": null,
  "count": 1,
  "film_title": null,
  "has_more": false,
  "next_offset": null,
  "planets": [
    {
      "climate": "arid",
      "climates": [
        "arid"
      ],
      "created": "2014-12-09T13:50:49.641000Z",
      "diameter": {
        "known": true,
        "max": 10465,
        "min": 10465,
        "number": 10465,
        "text": "10,465 km",
        "unit": "km",
        "value": "10465"
      },
      "edited": "2014-12-20T20:58:18.411000Z",
      "film_count": 1,
      "film_list": [
        {
          "id": "1",
          "kind": "film",
          "name": "A New Hope",
          "url": "https://swapi.info/api/films/1"
        }
      ],
      "film_names": [
        "A New Hope"
      ],
      "films": [
        "https://swapi.info/api/films/1"
      ],
      "gravity": "1 standard",
      "id": "1",
      "kind": "planet",
      "name": "Tatooine",
      "orbital_period": {
        "known": true,
        "max": 304,
        "min": 304,
        "number": 304,
        "text": "304 days",
        "unit": "days",
        "value": "304"
      },
      "population": {
        "known": true,
        "max": 200000,
        "min": 200000,
        "number": 200000,
        "text": "200,000 people",
        "unit": "people",
        "value": "200000"
      },
      "resident_count": 1,
      "resident_list": [
        {
          "id": "1",
          "kind": "character",
          "name": "Luke Skywalker",
          "url": "https://swapi.info/api/people/1"
        }
      ],
      "resident_names": [
        "Luke Skywalker"
      ],
      "residents": [
        "https://swapi.info/api/people/1"
      ],
      "resource": "planets",
      "rotation_period": {
        "known": true,
        "max": 23,
        "min": 23,
        "number": 23,
        "text": "23 hours",
        "unit": "hours",
        "value": "23"
      },
      "surface_water": {
        "known": true,
        "max": 1,
        "min": 1,
        "number": 1,
        "text": "1%",
        "unit": "%",
        "value": "1"
      },
      "terrain": "desert",
      "terrains": [
        "desert"
      ],
      "url": "https://swapi.info/api/planets/1"
    }
  ],
  "sort": "name",
  "terrain": null,
  "total_count": 1
}
```

### List species

Browse all 37 of SWAPI's species at once, or narrow them by classification, designation, language or film. The classifications are written by hand rather than picked from a vocabulary, so both "mammal" and "mammals" are in the data and both spellings are matched. Order them by name, classification, height or lifespan. No API key required.

**Inputs**

- Film (`film`, text): Optional. Narrow the result to one film. Name it by title, by episode ("Episode IV" or "Episode 4"), or by its SWAPI id. Note that a bare number is read as the id, and the ids are not the episode numbers: film 1 is Episode IV, because SWAPI numbers the films in release order.
- Classification (`classification`, text): Optional. Keep only species whose classification mentions this word. "mammal" also finds the ones SWAPI spelled "mammals".
- Designation (`designation`, text): Optional. Keep only species with this designation. Almost every species in SWAPI is sentient.
- Language (`language`, text): Optional. Keep only species whose language contains this text.
- Order by (`sort`, text): Optional. How to order the result. By name by default. A species SWAPI never recorded the sorted value for goes to the end rather than to the front. One of: `name` (Name (A to Z)), `classification` (Classification (A to Z)), `tallest` (Tallest first), `longest_living` (Longest lived first). Default: `name`.
- Number of results (`limit`, number): Optional. How many species to return in this page. Between 1 and 100; 100 by default, which is enough to hold every record SWAPI has of this kind, so lower it only to shorten the result. From 1 to 100. Default: `100`.
- Skip (`offset`, number): Optional. How many records to skip before this page. Use the next offset from the previous result to page through. 0 by default. At least 0. Default: `0`.

**Outputs**

- `classification` (text): The classification filter that was applied, or null.
- `count` (number): How many records are in this page.
- `designation` (text): The designation filter that was applied, or null.
- `film_title` (text): The film this result was narrowed to, or null.
- `has_more` (true/false): Whether there are more records after this page.
- `next_offset` (number): The offset to pass to get the next page, or null when this is the last one.
- `sort` (text): The order this result was put in.
- `species` (list): The species in this page, in the order asked for.
- `total_count` (number): How many records matched in total, across every page.

**Example output**

```json
{
  "classification": null,
  "count": 1,
  "designation": null,
  "film_title": null,
  "has_more": false,
  "next_offset": null,
  "sort": "name",
  "species": [
    {
      "average_height": {
        "known": true,
        "max": 180,
        "min": 180,
        "number": 180,
        "number_in": 70.87,
        "text": "180 cm (70.87 in)",
        "unit": "cm",
        "value": "180"
      },
      "average_lifespan": {
        "known": true,
        "max": 120,
        "min": 120,
        "number": 120,
        "text": "120 years",
        "unit": "years",
        "value": "120"
      },
      "classification": "mammal",
      "created": "2014-12-10T13:52:11.567000Z",
      "designation": "sentient",
      "edited": "2014-12-20T21:36:42.136000Z",
      "eye_colors": [
        "brown",
        "blue",
        "green",
        "hazel",
        "grey",
        "amber"
      ],
      "film_count": 1,
      "film_list": [
        {
          "id": "1",
          "kind": "film",
          "name": "A New Hope",
          "url": "https://swapi.info/api/films/1"
        }
      ],
      "film_names": [
        "A New Hope"
      ],
      "films": [
        "https://swapi.info/api/films/1"
      ],
      "hair_colors": [
        "blonde",
        "brown",
        "black",
        "red"
      ],
      "homeworld": "https://swapi.info/api/planets/9",
      "homeworld_id": null,
      "homeworld_name": null,
      "id": "1",
      "kind": "species",
      "language": "Galactic Basic",
      "name": "Human",
      "people": [
        "https://swapi.info/api/people/1"
      ],
      "person_count": 1,
      "person_list": [
        {
          "id": "1",
          "kind": "character",
          "name": "Luke Skywalker",
          "url": "https://swapi.info/api/people/1"
        }
      ],
      "person_names": [
        "Luke Skywalker"
      ],
      "resource": "species",
      "skin_colors": [
        "caucasian",
        "black",
        "asian",
        "hispanic"
      ],
      "url": "https://swapi.info/api/species/1"
    }
  ],
  "total_count": 1
}
```

### List starships

Browse all 36 of SWAPI's starships at once, or narrow them by class, manufacturer, pilot or film. SWAPI's casing is inconsistent ("Starfighter" and "starfighter" are both in the data), so the class filter matches either. Order them by name, length, cost or crew. No API key required.

**Inputs**

- Film (`film`, text): Optional. Narrow the result to one film. Name it by title, by episode ("Episode IV" or "Episode 4"), or by its SWAPI id. Note that a bare number is read as the id, and the ids are not the episode numbers: film 1 is Episode IV, because SWAPI numbers the films in release order.
- Class (`starship_class`, text): Optional. Keep only starships whose class contains this text. "starfighter" finds all eleven, however SWAPI capitalised each one.
- Manufacturer (`manufacturer`, text): Optional. Keep only craft whose manufacturer contains this text. SWAPI lists several manufacturers in one comma-joined string, so a partial name such as "Incom" matches them all.
- Piloted by (`pilot`, text): Optional. Keep only the craft this character has piloted. Give its name, its SWAPI id, or the SWAPI url from an earlier step: all three work. Capitals, accents and punctuation do not matter. Only a handful of craft have a named pilot in SWAPI.
- Order by (`sort`, text): Optional. How to order the result. By name by default. A starship SWAPI never recorded the sorted value for goes to the end rather than to the front. One of: `name` (Name (A to Z)), `longest` (Longest first), `costliest` (Most expensive first), `largest_crew` (Largest crew first). Default: `name`.
- Number of results (`limit`, number): Optional. How many starships to return in this page. Between 1 and 100; 100 by default, which is enough to hold every record SWAPI has of this kind, so lower it only to shorten the result. From 1 to 100. Default: `100`.
- Skip (`offset`, number): Optional. How many records to skip before this page. Use the next offset from the previous result to page through. 0 by default. At least 0. Default: `0`.

**Outputs**

- `class` (text): The class filter that was applied, or null.
- `count` (number): How many records are in this page.
- `film_title` (text): The film this result was narrowed to, or null.
- `has_more` (true/false): Whether there are more records after this page.
- `manufacturer` (text): The manufacturer filter that was applied, or null.
- `next_offset` (number): The offset to pass to get the next page, or null when this is the last one.
- `pilot_name` (text): The pilot this was narrowed to, or null.
- `sort` (text): The order this result was put in.
- `starships` (list): The starships in this page, in the order asked for.
- `total_count` (number): How many records matched in total, across every page.

**Example output**

```json
{
  "class": null,
  "count": 1,
  "film_title": null,
  "has_more": false,
  "manufacturer": null,
  "next_offset": null,
  "pilot_name": null,
  "sort": "name",
  "starships": [
    {
      "MGLT": {
        "known": true,
        "max": 100,
        "min": 100,
        "number": 100,
        "text": "100 MGLT",
        "unit": "MGLT",
        "value": "100"
      },
      "cargo_capacity": {
        "known": true,
        "max": 110,
        "min": 110,
        "number": 110,
        "text": "110 kg",
        "unit": "kg",
        "value": "110"
      },
      "class": "Starfighter",
      "consumables": {
        "known": true,
        "max": 1,
        "min": 1,
        "number": 1,
        "text": "1",
        "unit": "",
        "value": "1 week"
      },
      "cost_in_credits": {
        "known": true,
        "max": 149999,
        "min": 149999,
        "number": 149999,
        "text": "149,999 credits",
        "unit": "credits",
        "value": "149999"
      },
      "created": "2014-12-12T11:19:05.340000Z",
      "crew": {
        "known": true,
        "max": 1,
        "min": 1,
        "number": 1,
        "text": "1",
        "unit": "",
        "value": "1"
      },
      "edited": "2014-12-20T21:23:49.886000Z",
      "film_count": 1,
      "film_list": [
        {
          "id": "1",
          "kind": "film",
          "name": "A New Hope",
          "url": "https://swapi.info/api/films/1"
        }
      ],
      "film_names": [
        "A New Hope"
      ],
      "films": [
        "https://swapi.info/api/films/1"
      ],
      "hyperdrive_rating": {
        "known": true,
        "max": 1,
        "min": 1,
        "number": 1,
        "text": "1",
        "unit": "",
        "value": "1.0"
      },
      "id": "12",
      "kind": "starship",
      "length": {
        "known": true,
        "max": 12.5,
        "min": 12.5,
        "number": 12.5,
        "number_ft": 41.01,
        "text": "12.5 m (41.01 ft)",
        "unit": "m",
        "value": "12.5"
      },
      "manufacturer": "Incom Corporation",
      "manufacturers": [
        "Incom Corporation"
      ],
      "max_atmosphering_speed": {
        "known": true,
        "max": 1050,
        "min": 1050,
        "number": 1050,
        "text": "1,050",
        "unit": "",
        "value": "1050"
      },
      "model": "T-65 X-wing",
      "name": "X-wing",
      "passengers": {
        "known": true,
        "max": 0,
        "min": 0,
        "number": 0,
        "text": "0",
        "unit": "",
        "value": "0"
      },
      "pilot_count": 1,
      "pilot_list": [
        {
          "id": "1",
          "kind": "character",
          "name": "Luke Skywalker",
          "url": "https://swapi.info/api/people/1"
        }
      ],
      "pilot_names": [
        "Luke Skywalker"
      ],
      "pilots": [
        "https://swapi.info/api/people/1"
      ],
      "resource": "starships",
      "starship_class": "Starfighter",
      "url": "https://swapi.info/api/starships/12"
    }
  ],
  "total_count": 1
}
```

### List vehicles

Browse all 39 of SWAPI's vehicles at once, or narrow them by class, manufacturer, pilot or film. SWAPI's spelling is inconsistent ("air speeder" and "airspeeder" are both in the data), so match on the part of the class you are sure of. Order them by name, length, cost or crew. No API key required.

**Inputs**

- Film (`film`, text): Optional. Narrow the result to one film. Name it by title, by episode ("Episode IV" or "Episode 4"), or by its SWAPI id. Note that a bare number is read as the id, and the ids are not the episode numbers: film 1 is Episode IV, because SWAPI numbers the films in release order.
- Class (`vehicle_class`, text): Optional. Keep only vehicles whose class contains this text. "walker" finds the assault walkers and the wheeled walkers alike.
- Manufacturer (`manufacturer`, text): Optional. Keep only craft whose manufacturer contains this text. SWAPI lists several manufacturers in one comma-joined string, so a partial name such as "Incom" matches them all.
- Piloted by (`pilot`, text): Optional. Keep only the craft this character has piloted. Give its name, its SWAPI id, or the SWAPI url from an earlier step: all three work. Capitals, accents and punctuation do not matter. Only a handful of craft have a named pilot in SWAPI.
- Order by (`sort`, text): Optional. How to order the result. By name by default. A vehicle SWAPI never recorded the sorted value for goes to the end rather than to the front. One of: `name` (Name (A to Z)), `longest` (Longest first), `costliest` (Most expensive first), `largest_crew` (Largest crew first). Default: `name`.
- Number of results (`limit`, number): Optional. How many vehicles to return in this page. Between 1 and 100; 100 by default, which is enough to hold every record SWAPI has of this kind, so lower it only to shorten the result. From 1 to 100. Default: `100`.
- Skip (`offset`, number): Optional. How many records to skip before this page. Use the next offset from the previous result to page through. 0 by default. At least 0. Default: `0`.

**Outputs**

- `class` (text): The class filter that was applied, or null.
- `count` (number): How many records are in this page.
- `film_title` (text): The film this result was narrowed to, or null.
- `has_more` (true/false): Whether there are more records after this page.
- `manufacturer` (text): The manufacturer filter that was applied, or null.
- `next_offset` (number): The offset to pass to get the next page, or null when this is the last one.
- `pilot_name` (text): The pilot this was narrowed to, or null.
- `sort` (text): The order this result was put in.
- `total_count` (number): How many records matched in total, across every page.
- `vehicles` (list): The vehicles in this page, in the order asked for.

**Example output**

```json
{
  "class": null,
  "count": 1,
  "film_title": null,
  "has_more": false,
  "manufacturer": null,
  "next_offset": null,
  "pilot_name": null,
  "sort": "name",
  "total_count": 1,
  "vehicles": [
    {
      "cargo_capacity": {
        "known": true,
        "max": 10,
        "min": 10,
        "number": 10,
        "text": "10 kg",
        "unit": "kg",
        "value": "10"
      },
      "class": "airspeeder",
      "consumables": {
        "known": false,
        "max": null,
        "min": null,
        "number": null,
        "text": "unknown",
        "unit": "",
        "value": "none"
      },
      "cost_in_credits": {
        "known": false,
        "max": null,
        "min": null,
        "number": null,
        "text": "unknown",
        "unit": "credits",
        "value": "unknown"
      },
      "created": "2014-12-15T12:22:12Z",
      "crew": {
        "known": true,
        "max": 2,
        "min": 2,
        "number": 2,
        "text": "2",
        "unit": "",
        "value": "2"
      },
      "edited": "2014-12-20T21:30:21.672000Z",
      "film_count": 1,
      "film_list": [],
      "film_names": [],
      "films": [
        "https://swapi.info/api/films/2"
      ],
      "id": "14",
      "kind": "vehicle",
      "length": {
        "known": true,
        "max": 4.5,
        "min": 4.5,
        "number": 4.5,
        "number_ft": 14.76,
        "text": "4.5 m (14.76 ft)",
        "unit": "m",
        "value": "4.5"
      },
      "manufacturer": "Incom corporation",
      "manufacturers": [
        "Incom corporation"
      ],
      "max_atmosphering_speed": {
        "known": true,
        "max": 650,
        "min": 650,
        "number": 650,
        "text": "650",
        "unit": "",
        "value": "650"
      },
      "model": "t-47 airspeeder",
      "name": "Snowspeeder",
      "passengers": {
        "known": true,
        "max": 0,
        "min": 0,
        "number": 0,
        "text": "0",
        "unit": "",
        "value": "0"
      },
      "pilot_count": 1,
      "pilot_list": [
        {
          "id": "1",
          "kind": "character",
          "name": "Luke Skywalker",
          "url": "https://swapi.info/api/people/1"
        }
      ],
      "pilot_names": [
        "Luke Skywalker"
      ],
      "pilots": [
        "https://swapi.info/api/people/1"
      ],
      "resource": "vehicles",
      "url": "https://swapi.info/api/vehicles/14",
      "vehicle_class": "airspeeder"
    }
  ]
}
```

### Search Star Wars

Find anything in SWAPI whose name matches some text, across the films, characters, planets, species, starships and vehicles at once. This is how a workflow turns what a person typed into the record the other actions take, and it is the only way there is: SWAPI has no search endpoint. "Tatooine" comes back as a planet and "Millennium Falcon" as a starship without the caller having to know which is which, and every match says what it is and why it matched. No API key required.

**Inputs**

- Search text (`query`, text, required): The name to look for. Capitals, accents, punctuation and a leading "the" do not matter, so "the millennium falcon" and "Millennium Falcon" find the same starship. Part of a name works too, and so does a near miss.
- Look in (`resources`, text): Optional. Which collections to search. Pick any number of them; leave it empty to search all six. Narrowing it also makes the step cheaper, because SWAPI serves one file per collection and only the ones searched are fetched. One or more of: `films`, `people` (Characters), `planets`, `species`, `starships`, `vehicles`.
- Number of results (`limit`, number): Optional. How many matches to return in this page. Between 1 and 100; 10 by default. From 1 to 100. Default: `10`.
- Skip (`offset`, number): Optional. How many records to skip before this page. Use the next offset from the previous result to page through. 0 by default. At least 0. Default: `0`.

**Outputs**

- `count` (number): How many records are in this page.
- `has_more` (true/false): Whether there are more records after this page.
- `matches` (list): The matching records in this page, best match first.
- `next_offset` (number): The offset to pass to get the next page, or null when this is the last one.
- `query` (text): The text that was searched for.
- `searched` (list): The collections that were searched.
- `total_count` (number): How many records matched in total, across every page.

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "matches": [
    {
      "id": "1",
      "kind": "character",
      "matched_on": "the name",
      "name": "Luke Skywalker",
      "url": "https://swapi.info/api/people/1"
    }
  ],
  "next_offset": null,
  "query": "luke skywalker",
  "searched": [
    "films",
    "people",
    "planets",
    "species",
    "starships",
    "vehicles"
  ],
  "total_count": 1
}
```
