/planets/47
Request:
fetch("https://swapi.info/api/planets/47")
.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": "Iktotch",
"rotation_period": "22",
"orbital_period": "481",
"diameter": "unknown",
"climate": "arid, rocky, windy",
"gravity": "1",
"terrain": "rocky",
"surface_water": "unknown",
"population": "unknown",
"residents": [
"https://swapi.info/api/people/56"
],
"films": [],
"created": "2014-12-20T10:31:32.413000Z",
"edited": "2014-12-20T20:58:18.500000Z",
"url": "https://swapi.info/api/planets/47"
}