/planets/57
Request:
fetch("https://swapi.info/api/planets/57")
.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": "Muunilinst",
"rotation_period": "28",
"orbital_period": "412",
"diameter": "13800",
"climate": "temperate",
"gravity": "1",
"terrain": "plains, forests, hills, mountains",
"surface_water": "25",
"population": "5000000000",
"residents": [
"https://swapi.info/api/people/77"
],
"films": [],
"created": "2014-12-20T17:57:47.420000Z",
"edited": "2014-12-20T20:58:18.519000Z",
"url": "https://swapi.info/api/planets/57"
}