/planets/21
Request:
fetch("https://swapi.info/api/planets/21")
.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": "Eriadu",
"rotation_period": "24",
"orbital_period": "360",
"diameter": "13490",
"climate": "polluted",
"gravity": "1 standard",
"terrain": "cityscape",
"surface_water": "unknown",
"population": "22000000000",
"residents": [
"https://swapi.info/api/people/12"
],
"films": [],
"created": "2014-12-10T16:26:54.384000Z",
"edited": "2014-12-20T20:58:18.454000Z",
"url": "https://swapi.info/api/planets/21"
}