/people/12

homecaret-rightpeoplecaret-right

12

API Endpoint:

Request:

fetch("https://swapi.info/api/people/12")
    .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": "Wilhuff Tarkin",
  "height": "180",
  "mass": "unknown",
  "hair_color": "auburn, grey",
  "skin_color": "fair",
  "eye_color": "blue",
  "birth_year": "64BBY",
  "gender": "male",
  "homeworld": "https://swapi.info/api/planets/21",
  "films": [
    "https://swapi.info/api/films/1",
    "https://swapi.info/api/films/6"
  ],
  "species": [],
  "vehicles": [],
  "starships": [],
  "created": "2014-12-10T16:26:56.138000Z",
  "edited": "2014-12-20T21:17:50.330000Z",
  "url": "https://swapi.info/api/people/12"
}
eye-open
Good