/planets/37

homecaret-rightplanetscaret-right

37

API Endpoint:

Request:

fetch("https://swapi.info/api/planets/37")
    .then((res) => res.json()) // Parse the JSON content from the API to be consumed
    .then((json) => console.log(json)) // Log the JSON response to your console
    .catch((error) => console.error(error)) // Log the API error (if any) to your console

Result:

{
  "name": "Ryloth",
  "rotation_period": "30",
  "orbital_period": "305",
  "diameter": "10600",
  "climate": "temperate, arid, subartic",
  "gravity": "1",
  "terrain": "mountains, valleys, deserts, tundra",
  "surface_water": "5",
  "population": "1500000000",
  "residents": [
    "https://swapi.info/api/people/45",
    "https://swapi.info/api/people/46"
  ],
  "films": [],
  "created": "2014-12-20T09:46:25.740000Z",
  "edited": "2014-12-20T20:58:18.481000Z",
  "url": "https://swapi.info/api/planets/37"
}
eye-open
Good