/films/5

homecaret-rightfilmscaret-right

5

API Endpoint:

Request:

fetch("https://swapi.info/api/films/5")
    .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:

{
  "title": "Attack of the Clones",
  "episode_id": 2,
  "opening_crawl": "There is unrest in the Galactic\r\nSenate. Several thousand solar\r\nsystems have declared their\r\nintentions to leave the Republic.\r\n\r\nThis separatist movement,\r\nunder the leadership of the\r\nmysterious Count Dooku, has\r\nmade it difficult for the limited\r\nnumber of Jedi Knights to maintain \r\npeace and order in the galaxy.\r\n\r\nSenator Amidala, the former\r\nQueen of Naboo, is returning\r\nto the Galactic Senate to vote\r\non the critical issue of creating\r\nan ARMY OF THE REPUBLIC\r\nto assist the overwhelmed\r\nJedi....",
  "director": "George Lucas",
  "producer": "Rick McCallum",
  "release_date": "2002-05-16",
  "characters": [
    "https://swapi.info/api/people/2",
    "https://swapi.info/api/people/3",
    "https://swapi.info/api/people/6",
    "https://swapi.info/api/people/7",
    "https://swapi.info/api/people/10",
    "https://swapi.info/api/people/11",
    "https://swapi.info/api/people/20",
    "https://swapi.info/api/people/21",
    "https://swapi.info/api/people/22",
    "https://swapi.info/api/people/33",
    "https://swapi.info/api/people/35",
    "https://swapi.info/api/people/36",
    "https://swapi.info/api/people/40",
    "https://swapi.info/api/people/43",
    "https://swapi.info/api/people/46",
    "https://swapi.info/api/people/51",
    "https://swapi.info/api/people/52",
    "https://swapi.info/api/people/53",
    "https://swapi.info/api/people/58",
    "https://swapi.info/api/people/59",
    "https://swapi.info/api/people/60",
    "https://swapi.info/api/people/61",
    "https://swapi.info/api/people/62",
    "https://swapi.info/api/people/63",
    "https://swapi.info/api/people/64",
    "https://swapi.info/api/people/65",
    "https://swapi.info/api/people/66",
    "https://swapi.info/api/people/67",
    "https://swapi.info/api/people/68",
    "https://swapi.info/api/people/69",
    "https://swapi.info/api/people/70",
    "https://swapi.info/api/people/71",
    "https://swapi.info/api/people/72",
    "https://swapi.info/api/people/73",
    "https://swapi.info/api/people/74",
    "https://swapi.info/api/people/75",
    "https://swapi.info/api/people/76",
    "https://swapi.info/api/people/77",
    "https://swapi.info/api/people/78",
    "https://swapi.info/api/people/82"
  ],
  "planets": [
    "https://swapi.info/api/planets/1",
    "https://swapi.info/api/planets/8",
    "https://swapi.info/api/planets/9",
    "https://swapi.info/api/planets/10",
    "https://swapi.info/api/planets/11"
  ],
  "starships": [
    "https://swapi.info/api/starships/21",
    "https://swapi.info/api/starships/32",
    "https://swapi.info/api/starships/39",
    "https://swapi.info/api/starships/43",
    "https://swapi.info/api/starships/47",
    "https://swapi.info/api/starships/48",
    "https://swapi.info/api/starships/49",
    "https://swapi.info/api/starships/52",
    "https://swapi.info/api/starships/58"
  ],
  "vehicles": [
    "https://swapi.info/api/vehicles/4",
    "https://swapi.info/api/vehicles/44",
    "https://swapi.info/api/vehicles/45",
    "https://swapi.info/api/vehicles/46",
    "https://swapi.info/api/vehicles/50",
    "https://swapi.info/api/vehicles/51",
    "https://swapi.info/api/vehicles/53",
    "https://swapi.info/api/vehicles/54",
    "https://swapi.info/api/vehicles/55",
    "https://swapi.info/api/vehicles/56",
    "https://swapi.info/api/vehicles/57"
  ],
  "species": [
    "https://swapi.info/api/species/1",
    "https://swapi.info/api/species/2",
    "https://swapi.info/api/species/6",
    "https://swapi.info/api/species/12",
    "https://swapi.info/api/species/13",
    "https://swapi.info/api/species/15",
    "https://swapi.info/api/species/28",
    "https://swapi.info/api/species/29",
    "https://swapi.info/api/species/30",
    "https://swapi.info/api/species/31",
    "https://swapi.info/api/species/32",
    "https://swapi.info/api/species/33",
    "https://swapi.info/api/species/34",
    "https://swapi.info/api/species/35"
  ],
  "created": "2014-12-20T10:57:57.886000Z",
  "edited": "2014-12-20T20:18:48.516000Z",
  "url": "https://swapi.info/api/films/5"
}
eye-open
Good