/planets/55
Request:
fetch("https://swapi.info/api/planets/55")
.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": "Ojom",
"rotation_period": "unknown",
"orbital_period": "unknown",
"diameter": "unknown",
"climate": "frigid",
"gravity": "unknown",
"terrain": "oceans, glaciers",
"surface_water": "100",
"population": "500000000",
"residents": [
"https://swapi.info/api/people/71"
],
"films": [],
"created": "2014-12-20T17:27:41.286000Z",
"edited": "2014-12-20T20:58:18.516000Z",
"url": "https://swapi.info/api/planets/55"
}