/people/8
Request:
fetch("https://swapi.info/api/people/8")
.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": "R5-D4",
"height": "97",
"mass": "32",
"hair_color": "n/a",
"skin_color": "white, red",
"eye_color": "red",
"birth_year": "unknown",
"gender": "n/a",
"homeworld": "https://swapi.info/api/planets/1",
"films": [
"https://swapi.info/api/films/1"
],
"species": [
"https://swapi.info/api/species/2"
],
"vehicles": [],
"starships": [],
"created": "2014-12-10T15:57:50.959000Z",
"edited": "2014-12-20T21:17:50.321000Z",
"url": "https://swapi.info/api/people/8"
}