Characters, homeworlds and starships from a fictional space opera. Practice CRUD, Bearer auth, nested resources, pagination and optimistic concurrency.
The Star Wars API covers characters, planets and starships — three related collections with enough cross-references to make filtering interesting. It is a good first stop for anyone building a client that has to resolve ids across resources and page through more records than fit in a single response.
Base URL: https://funapi.dev/api/galaxy/v1 · 11 endpoints · OpenAPI 3.1 spec and Postman collection available. New here? Read the getting started guide.
GET https://funapi.dev/api/galaxy/v1/planets — List all planets. No token, no signup:
curl -i https://funapi.dev/api/galaxy/v1/planets
answers 200 OK with:
{
"total": 5,
"data": [
{
"id": 1,
"name": "Tatooine",
"climate": "arid",
"population": 200000
},
{
"id": 2,
"name": "Hoth",
"climate": "frozen",
"population": 0
},
{
"id": 3,
"name": "Dagobah",
"climate": "murky",
"population": 0
},
{
"id": 4,
"name": "Coruscant",
"climate": "temperate",
"population": 1000000000
},
{
"id": 5,
"name": "Endor",
"climate": "temperate",
"population": 30000000
}
]
}
five worlds, one swamp
GET /galaxy/v1/planets — List all planets · Responds with 200 Link to this endpointGET /galaxy/v1/planets/{id} — Get one planet · Responds with 200 404 Link to this endpointrebels, empire, and neutral parties
GET /galaxy/v1/characters — List characters (paginated, filter by affiliation) · Responds with 200 400 404 Link to this endpointGET /galaxy/v1/characters/{id} — Get one character · Responds with 200 404 Link to this endpointGET /galaxy/v1/characters/{id}/homeworld — Get a character's homeworld (nested resource) · Responds with 200 404 Link to this endpointPOST /galaxy/v1/characters — Add a character (requires Bearer auth) · Responds with 201 400 401 Link to this endpointPUT /galaxy/v1/characters/{id} — Update a character (requires Bearer auth) · Responds with 200 400 401 404 412 Link to this endpointDELETE /galaxy/v1/characters/{id} — Remove a character (requires Bearer auth) · Responds with 204 401 403 404 412 Link to this endpointfreighters to capital ships
GET /galaxy/v1/starships — List starships, filter by class · Responds with 200 Link to this endpointGET /galaxy/v1/starships/random — A random starship · Responds with 200 Link to this endpointGET /galaxy/v1/starships/{id} — Get one starship · Responds with 200 404 Link to this endpointHow this Star Wars API differs from SWAPI
Unofficial and fan-made. The Star Wars API is a practice API that borrows a theme; it is not affiliated with, sponsored or endorsed by the owners of the names it references, which belong to them. Every record it returns is test data for exercising HTTP behaviour, not an authoritative source on the subject.
Last updated