/people/20

homecaret-rightpeoplecaret-right

20

API Endpoint:

Request:

fetch("https://swapi.info/api/people/20")
    .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": "Yoda",
  "height": "66",
  "mass": "17",
  "hair_color": "white",
  "skin_color": "green",
  "eye_color": "brown",
  "birth_year": "896BBY",
  "gender": "male",
  "homeworld": "https://swapi.info/api/planets/28",
  "films": [
    "https://swapi.info/api/films/2",
    "https://swapi.info/api/films/3",
    "https://swapi.info/api/films/4",
    "https://swapi.info/api/films/5",
    "https://swapi.info/api/films/6"
  ],
  "species": [
    "https://swapi.info/api/species/6"
  ],
  "vehicles": [],
  "starships": [],
  "created": "2014-12-15T12:26:01.042000Z",
  "edited": "2014-12-20T21:17:50.345000Z",
  "url": "https://swapi.info/api/people/20"
}
eye-open
Good