/planets/12
Request:
fetch("https://swapi.info/api/planets/12")
.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": "Utapau",
"rotation_period": "27",
"orbital_period": "351",
"diameter": "12900",
"climate": "temperate, arid, windy",
"gravity": "1 standard",
"terrain": "scrublands, savanna, canyons, sinkholes",
"surface_water": "0.9",
"population": "95000000",
"residents": [
"https://swapi.info/api/people/83"
],
"films": [
"https://swapi.info/api/films/6"
],
"created": "2014-12-10T12:49:01.491000Z",
"edited": "2014-12-20T20:58:18.439000Z",
"url": "https://swapi.info/api/planets/12"
}