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.
None — no key, no signup. Every example runs as-is.
Full reference: https://swapi.dev/documentation
Related films, starships, and homeworld come back as URLs to follow.
curl https://swapi.dev/api/people/1/
{
"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"
}
Case-insensitive partial match on name.
curl "https://swapi.dev/api/people/?search=sky"
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"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"
},
{
"name": "Anakin Skywalker",
"height": "188",
"mass": "84",
"hair_color": "blond",
"skin_color": "fair",
"eye_color": "blue",
"birth_year": "41.9BBY",
"gender": "male",
"homeworld": "https://swapi.dev/api/planets/1/",
"films": [
"https://swapi.dev/api/films/4/",
"https://swapi.dev/api/films/5/"
],
"species": [],
"vehicles": [
"https://swapi.dev/api/vehicles/44/",
"https://swapi.dev/api/vehicles/46/"
],
"starships": [
"https://swapi.dev/api/starships/39/",
"https://swapi.dev/api/starships/59/"
],
"created": "2014-12-10T16:20:44.310000Z",
"edited": "2014-12-20T21:17:50.327000Z"
}
]
}
Opening crawl included.
curl https://swapi.dev/api/films/1/
{
"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/"
}