/planets/22
Request:
fetch("https://swapi.info/api/planets/22")
.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": "Corellia",
"rotation_period": "25",
"orbital_period": "329",
"diameter": "11000",
"climate": "temperate",
"gravity": "1 standard",
"terrain": "plains, urban, hills, forests",
"surface_water": "70",
"population": "3000000000",
"residents": [
"https://swapi.info/api/people/14",
"https://swapi.info/api/people/18"
],
"films": [],
"created": "2014-12-10T16:49:12.453000Z",
"edited": "2014-12-20T20:58:18.456000Z",
"url": "https://swapi.info/api/planets/22"
}