/species/2

homecaret-rightspeciescaret-right

2

API Endpoint:

Request:

fetch("https://swapi.info/api/species/2")
    .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": "Droid",
  "classification": "artificial",
  "designation": "sentient",
  "average_height": "n/a",
  "skin_colors": "n/a",
  "hair_colors": "n/a",
  "eye_colors": "n/a",
  "average_lifespan": "indefinite",
  "homeworld": null,
  "language": "n/a",
  "people": [
    "https://swapi.info/api/people/2",
    "https://swapi.info/api/people/3",
    "https://swapi.info/api/people/8",
    "https://swapi.info/api/people/23"
  ],
  "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"
  ],
  "created": "2014-12-10T15:16:16.259000Z",
  "edited": "2014-12-20T21:36:42.139000Z",
  "url": "https://swapi.info/api/species/2"
}
eye-open
Good