/planets/6
Request:
fetch("https://swapi.info/api/planets/6")
.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": "Bespin",
"rotation_period": "12",
"orbital_period": "5110",
"diameter": "118000",
"climate": "temperate",
"gravity": "1.5 (surface), 1 standard (Cloud City)",
"terrain": "gas giant",
"surface_water": "0",
"population": "6000000",
"residents": [
"https://swapi.info/api/people/26"
],
"films": [
"https://swapi.info/api/films/2"
],
"created": "2014-12-10T11:43:55.240000Z",
"edited": "2014-12-20T20:58:18.427000Z",
"url": "https://swapi.info/api/planets/6"
}