/films/5

API Endpoint:

Request:

request.js
1fetch("https://swapi.info/api/films/5")
2 .then((res) => res.json()) // Parse the JSON content from the API to be consumed
3 .then((json) => console.log(json)) // Log the JSON response to your console
4 .catch((error) => console.error(error)) // Log the API error (if any) to your console

Result:

response.json
1{
2 "title": "Attack of the Clones",
3 "episode_id": 2,
4 "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....",
5 "director": "George Lucas",
6 "producer": "Rick McCallum",
7 "release_date": "2002-05-16",
8 "characters": [
9 "https://swapi.info/api/people/2",
10 "https://swapi.info/api/people/3",
11 "https://swapi.info/api/people/6",
12 "https://swapi.info/api/people/7",
13 "https://swapi.info/api/people/10",
14 "https://swapi.info/api/people/11",
15 "https://swapi.info/api/people/20",
16 "https://swapi.info/api/people/21",
17 "https://swapi.info/api/people/22",
18 "https://swapi.info/api/people/33",
19 "https://swapi.info/api/people/35",
20 "https://swapi.info/api/people/36",
21 "https://swapi.info/api/people/40",
22 "https://swapi.info/api/people/43",
23 "https://swapi.info/api/people/46",
24 "https://swapi.info/api/people/51",
25 "https://swapi.info/api/people/52",
26 "https://swapi.info/api/people/53",
27 "https://swapi.info/api/people/58",
28 "https://swapi.info/api/people/59",
29 "https://swapi.info/api/people/60",
30 "https://swapi.info/api/people/61",
31 "https://swapi.info/api/people/62",
32 "https://swapi.info/api/people/63",
33 "https://swapi.info/api/people/64",
34 "https://swapi.info/api/people/65",
35 "https://swapi.info/api/people/66",
36 "https://swapi.info/api/people/67",
37 "https://swapi.info/api/people/68",
38 "https://swapi.info/api/people/69",
39 "https://swapi.info/api/people/70",
40 "https://swapi.info/api/people/71",
41 "https://swapi.info/api/people/72",
42 "https://swapi.info/api/people/73",
43 "https://swapi.info/api/people/74",
44 "https://swapi.info/api/people/75",
45 "https://swapi.info/api/people/76",
46 "https://swapi.info/api/people/77",
47 "https://swapi.info/api/people/78",
48 "https://swapi.info/api/people/82"
49 ],
50 "planets": [
51 "https://swapi.info/api/planets/1",
52 "https://swapi.info/api/planets/8",
53 "https://swapi.info/api/planets/9",
54 "https://swapi.info/api/planets/10",
55 "https://swapi.info/api/planets/11"
56 ],
57 "starships": [
58 "https://swapi.info/api/starships/21",
59 "https://swapi.info/api/starships/32",
60 "https://swapi.info/api/starships/39",
61 "https://swapi.info/api/starships/43",
62 "https://swapi.info/api/starships/47",
63 "https://swapi.info/api/starships/48",
64 "https://swapi.info/api/starships/49",
65 "https://swapi.info/api/starships/52",
66 "https://swapi.info/api/starships/58"
67 ],
68 "vehicles": [
69 "https://swapi.info/api/vehicles/4",
70 "https://swapi.info/api/vehicles/44",
71 "https://swapi.info/api/vehicles/45",
72 "https://swapi.info/api/vehicles/46",
73 "https://swapi.info/api/vehicles/50",
74 "https://swapi.info/api/vehicles/51",
75 "https://swapi.info/api/vehicles/53",
76 "https://swapi.info/api/vehicles/54",
77 "https://swapi.info/api/vehicles/55",
78 "https://swapi.info/api/vehicles/56",
79 "https://swapi.info/api/vehicles/57"
80 ],
81 "species": [
82 "https://swapi.info/api/species/1",
83 "https://swapi.info/api/species/2",
84 "https://swapi.info/api/species/6",
85 "https://swapi.info/api/species/12",
86 "https://swapi.info/api/species/13",
87 "https://swapi.info/api/species/15",
88 "https://swapi.info/api/species/28",
89 "https://swapi.info/api/species/29",
90 "https://swapi.info/api/species/30",
91 "https://swapi.info/api/species/31",
92 "https://swapi.info/api/species/32",
93 "https://swapi.info/api/species/33",
94 "https://swapi.info/api/species/34",
95 "https://swapi.info/api/species/35"
96 ],
97 "created": "2014-12-20T10:57:57.886000Z",
98 "edited": "2014-12-20T20:18:48.516000Z",
99 "url": "https://swapi.info/api/films/5"
100}
What is this ?

The Star Wars API, or "swapi" (Swah-pee) is the world‘s first quantified and programmatically-accessible data source for all the data from the Star Wars canon universe!

We‘ve taken all the rich contextual stuff from the universe and formatted into something easier to consume with software. Then we went and stuck an API on the front so you can access it all!

How can I use it ?

All the data is accessible through our HTTP web API. Consult our explorer pages if you‘d like to get started.

Promise of longevity

Swapi.info is here to stay!. Created as service which runs solely via static files, this service does not require database or expensive hosting to run. Currently hosted on the generosity of Cloudflare Pages, the only barrier to utilization is a public facing domain. No other costs associated with running this project yourself as well. Created as a self-owned alternative to keep my older projects alive, now publicly available and Open Source allows it to be perpetually available to the community.