← Planets

Alderaan

Rotation period24
Orbital period364
Diameter12500
Climatetemperate
Gravity1 standard
Terraingrasslands, mountains
Surface water40
Population2000000000

curl

curl https://swapi.build/api/planets/2

JavaScript

fetch('https://swapi.build/api/planets/2').then((r) => r.json())

Python

requests.get('https://swapi.build/api/planets/2').json()

MCP

Connect your agent once:

claude mcp add --transport http swapi-build https://swapi.build/mcp

then call the tool sw_get with:

{"resource":"PLANETS","id":2}
GET /api/planets/2 200
{
  "climate": "temperate",
  "created": "2014-12-10T11:35:48.479000Z",
  "diameter": "12500",
  "edited": "2014-12-20T20:58:18.420000Z",
  "films": [
    "https://swapi.build/api/films/1",
    "https://swapi.build/api/films/6"
  ],
  "gravity": "1 standard",
  "name": "Alderaan",
  "orbital_period": "364",
  "population": "2000000000",
  "residents": [
    "https://swapi.build/api/people/5",
    "https://swapi.build/api/people/68",
    "https://swapi.build/api/people/81"
  ],
  "rotation_period": "24",
  "surface_water": "40",
  "terrain": "grasslands, mountains",
  "url": "https://swapi.build/api/planets/2"
}