/planets/23
Request:
fetch("https://swapi.info/api/planets/23")
.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": "Rodia",
"rotation_period": "29",
"orbital_period": "305",
"diameter": "7549",
"climate": "hot",
"gravity": "1 standard",
"terrain": "jungles, oceans, urban, swamps",
"surface_water": "60",
"population": "1300000000",
"residents": [
"https://swapi.info/api/people/15"
],
"films": [],
"created": "2014-12-10T17:03:28.110000Z",
"edited": "2014-12-20T20:58:18.458000Z",
"url": "https://swapi.info/api/planets/23"
}