/planets/35
Request:
fetch("https://swapi.info/api/planets/35")
.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": "Malastare",
"rotation_period": "26",
"orbital_period": "201",
"diameter": "18880",
"climate": "arid, temperate, tropical",
"gravity": "1.56",
"terrain": "swamps, deserts, jungles, mountains",
"surface_water": "unknown",
"population": "2000000000",
"residents": [
"https://swapi.info/api/people/41"
],
"films": [],
"created": "2014-12-19T17:52:13.106000Z",
"edited": "2014-12-20T20:58:18.478000Z",
"url": "https://swapi.info/api/planets/35"
}