How to hit the SWAPI (Star Wars) API

SWAPI at https://swapi.dev/api is the classic Star Wars API: people, films, planets, species, starships, and vehicles, all linked to each other by URL.

Authentication

None — no key, no signup. Every example runs as-is.

Full reference: https://swapi.dev/documentation

Get a character

Related films, starships, and homeworld come back as URLs to follow.

curl https://swapi.dev/api/people/1/
Run in PostTaco
Example response (trimmed)
{
  "name": "Luke Skywalker",
  "height": "172",
  "mass": "77",
  "hair_color": "blond",
  "skin_color": "fair",
  "eye_color": "blue",
  "birth_year": "19BBY",
  "gender": "male",
  "homeworld": "https://swapi.dev/api/planets/1/",
  "films": [
    "https://swapi.dev/api/films/1/",
    "https://swapi.dev/api/films/2/"
  ],
  "species": [],
  "vehicles": [
    "https://swapi.dev/api/vehicles/14/",
    "https://swapi.dev/api/vehicles/30/"
  ],
  "starships": [
    "https://swapi.dev/api/starships/12/",
    "https://swapi.dev/api/starships/22/"
  ],
  "created": "2014-12-09T13:50:51.644000Z",
  "edited": "2014-12-20T21:17:56.891000Z"
}

Get a film

Opening crawl included.

curl https://swapi.dev/api/films/1/
Run in PostTaco
Example response (trimmed)
{
  "title": "A New Hope",
  "episode_id": 4,
  "director": "George Lucas",
  "producer": "Gary Kurtz, Rick McCallum",
  "release_date": "1977-05-25",
  "characters": [
    "https://swapi.dev/api/people/1/",
    "https://swapi.dev/api/people/2/"
  ],
  "planets": [
    "https://swapi.dev/api/planets/1/",
    "https://swapi.dev/api/planets/2/"
  ],
  "starships": [
    "https://swapi.dev/api/starships/2/",
    "https://swapi.dev/api/starships/3/"
  ],
  "vehicles": [
    "https://swapi.dev/api/vehicles/4/",
    "https://swapi.dev/api/vehicles/6/"
  ],
  "species": [
    "https://swapi.dev/api/species/1/",
    "https://swapi.dev/api/species/2/"
  ],
  "created": "2014-12-10T14:23:31.880000Z",
  "edited": "2014-12-20T19:49:45.256000Z",
  "url": "https://swapi.dev/api/films/1/"
}