/planets/28

homecaret-rightplanetscaret-right

28

API Endpoint:

Request:

fetch("https://swapi.info/api/planets/28")
    .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": "unknown",
  "rotation_period": "0",
  "orbital_period": "0",
  "diameter": "0",
  "climate": "unknown",
  "gravity": "unknown",
  "terrain": "unknown",
  "surface_water": "unknown",
  "population": "unknown",
  "residents": [
    "https://swapi.info/api/people/20",
    "https://swapi.info/api/people/23",
    "https://swapi.info/api/people/29",
    "https://swapi.info/api/people/32",
    "https://swapi.info/api/people/75"
  ],
  "films": [],
  "created": "2014-12-15T12:25:59.569000Z",
  "edited": "2014-12-20T20:58:18.466000Z",
  "url": "https://swapi.info/api/planets/28"
}
eye-open
Good