/planets/9

homecaret-rightplanetscaret-right

9

API Endpoint:

Request:

fetch("https://swapi.info/api/planets/9")
    .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": "Coruscant",
  "rotation_period": "24",
  "orbital_period": "368",
  "diameter": "12240",
  "climate": "temperate",
  "gravity": "1 standard",
  "terrain": "cityscape, mountains",
  "surface_water": "unknown",
  "population": "1000000000000",
  "residents": [
    "https://swapi.info/api/people/34",
    "https://swapi.info/api/people/55",
    "https://swapi.info/api/people/74"
  ],
  "films": [
    "https://swapi.info/api/films/3",
    "https://swapi.info/api/films/4",
    "https://swapi.info/api/films/5",
    "https://swapi.info/api/films/6"
  ],
  "created": "2014-12-10T11:54:13.921000Z",
  "edited": "2014-12-20T20:58:18.432000Z",
  "url": "https://swapi.info/api/planets/9"
}
eye-open
Good