/planets/25
Request:
fetch("https://swapi.info/api/planets/25")
.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": "Dantooine",
"rotation_period": "25",
"orbital_period": "378",
"diameter": "9830",
"climate": "temperate",
"gravity": "1 standard",
"terrain": "oceans, savannas, mountains, grasslands",
"surface_water": "unknown",
"population": "1000",
"residents": [],
"films": [],
"created": "2014-12-10T17:23:29.896000Z",
"edited": "2014-12-20T20:58:18.461000Z",
"url": "https://swapi.info/api/planets/25"
}