Star Wars API
Documentation

Planets

Explore planets and locations across the Star Wars galaxy with detailed environmental data and resident information.

Endpoints

Get All Planets

Retrieve all planets
Request
GET https://sw-next-api.vercel.app/api/v1/planets

Get Single Planet

Get planet by ID or slug
GET https://sw-next-api.vercel.app/api/v1/planets/1
GET https://sw-next-api.vercel.app/api/v1/planets/tatooine

Response Example

{
  "entityId": 1,
  "id": "tatooine",
  "name": "Tatooine",
  "rotationPeriod": 23,       // Hours per day
  "orbitalPeriod": 304,       // Days per year
  "diameter": 10465,          // Kilometers
  "climate": "arid",
  "gravity": "1 standard",
  "terrain": "desert",
  "surfaceWater": 1,          // Percentage
  "population": 200000,
  "residents": [...],         // People living here
  "films": [...]              // Films featuring this planet
}

Common Queries

Find planets by name

Request
GET https://sw-next-api.vercel.app/api/v1/planets?search=tatooine

Available Features

Expansion

Expand: residents, films

Learn more →

Filtering

Filter by: climate, terrain, or search by name

Learn more →