/people/14

homecaret-rightpeoplecaret-right

14

API Endpoint:

Request:

fetch("https://swapi.info/api/people/14")
    .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": "Han Solo",
  "height": "180",
  "mass": "80",
  "hair_color": "brown",
  "skin_color": "fair",
  "eye_color": "brown",
  "birth_year": "29BBY",
  "gender": "male",
  "homeworld": "https://swapi.info/api/planets/22",
  "films": [
    "https://swapi.info/api/films/1",
    "https://swapi.info/api/films/2",
    "https://swapi.info/api/films/3"
  ],
  "species": [],
  "vehicles": [],
  "starships": [
    "https://swapi.info/api/starships/10",
    "https://swapi.info/api/starships/22"
  ],
  "created": "2014-12-10T16:49:14.582000Z",
  "edited": "2014-12-20T21:17:50.334000Z",
  "url": "https://swapi.info/api/people/14"
}
eye-open
Good