/planets/50
Request:
fetch("https://swapi.info/api/planets/50")
.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": "Champala",
"rotation_period": "27",
"orbital_period": "318",
"diameter": "unknown",
"climate": "temperate",
"gravity": "1",
"terrain": "oceans, rainforests, plateaus",
"surface_water": "unknown",
"population": "3500000000",
"residents": [
"https://swapi.info/api/people/59"
],
"films": [],
"created": "2014-12-20T10:52:51.524000Z",
"edited": "2014-12-20T20:58:18.506000Z",
"url": "https://swapi.info/api/planets/50"
}