/people/10

homecaret-rightpeoplecaret-right

10

API Endpoint:

Request:

fetch("https://swapi.info/api/people/10")
    .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": "Obi-Wan Kenobi",
  "height": "182",
  "mass": "77",
  "hair_color": "auburn, white",
  "skin_color": "fair",
  "eye_color": "blue-gray",
  "birth_year": "57BBY",
  "gender": "male",
  "homeworld": "https://swapi.info/api/planets/20",
  "films": [
    "https://swapi.info/api/films/1",
    "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": [],
  "vehicles": [
    "https://swapi.info/api/vehicles/38"
  ],
  "starships": [
    "https://swapi.info/api/starships/48",
    "https://swapi.info/api/starships/59",
    "https://swapi.info/api/starships/64",
    "https://swapi.info/api/starships/65",
    "https://swapi.info/api/starships/74"
  ],
  "created": "2014-12-10T16:16:29.192000Z",
  "edited": "2014-12-20T21:17:50.325000Z",
  "url": "https://swapi.info/api/people/10"
}
eye-open
Good