Rotation period23
Orbital period549
Diameter7200
Climatefrozen
Gravity1.1 standard
Terraintundra, ice caves, mountain ranges
Surface water100
Populationunknown

curl

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

JavaScript

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

Python

requests.get('https://swapi.build/api/planets/4').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":4}
GET /api/planets/4 200
{
  "climate": "frozen",
  "created": "2014-12-10T11:39:13.934000Z",
  "diameter": "7200",
  "edited": "2014-12-20T20:58:18.423000Z",
  "films": [
    "https://swapi.build/api/films/2"
  ],
  "gravity": "1.1 standard",
  "name": "Hoth",
  "orbital_period": "549",
  "population": "unknown",
  "residents": [],
  "rotation_period": "23",
  "surface_water": "100",
  "terrain": "tundra, ice caves, mountain ranges",
  "url": "https://swapi.build/api/planets/4"
}