/films/4

API Endpoint:

Request:

request.js
1fetch("https://swapi.info/api/films/4")
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": "The Phantom Menace",
3 "episode_id": 1,
4 "opening_crawl": "Turmoil has engulfed the\r\nGalactic Republic. The taxation\r\nof trade routes to outlying star\r\nsystems is in dispute.\r\n\r\nHoping to resolve the matter\r\nwith a blockade of deadly\r\nbattleships, the greedy Trade\r\nFederation has stopped all\r\nshipping to the small planet\r\nof Naboo.\r\n\r\nWhile the Congress of the\r\nRepublic endlessly debates\r\nthis alarming chain of events,\r\nthe Supreme Chancellor has\r\nsecretly dispatched two Jedi\r\nKnights, the guardians of\r\npeace and justice in the\r\ngalaxy, to settle the conflict....",
5 "director": "George Lucas",
6 "producer": "Rick McCallum",
7 "release_date": "1999-05-19",
8 "characters": [
9 "https://swapi.info/api/people/2",
10 "https://swapi.info/api/people/3",
11 "https://swapi.info/api/people/10",
12 "https://swapi.info/api/people/11",
13 "https://swapi.info/api/people/16",
14 "https://swapi.info/api/people/20",
15 "https://swapi.info/api/people/21",
16 "https://swapi.info/api/people/32",
17 "https://swapi.info/api/people/33",
18 "https://swapi.info/api/people/34",
19 "https://swapi.info/api/people/35",
20 "https://swapi.info/api/people/36",
21 "https://swapi.info/api/people/37",
22 "https://swapi.info/api/people/38",
23 "https://swapi.info/api/people/39",
24 "https://swapi.info/api/people/40",
25 "https://swapi.info/api/people/41",
26 "https://swapi.info/api/people/42",
27 "https://swapi.info/api/people/43",
28 "https://swapi.info/api/people/44",
29 "https://swapi.info/api/people/46",
30 "https://swapi.info/api/people/47",
31 "https://swapi.info/api/people/48",
32 "https://swapi.info/api/people/49",
33 "https://swapi.info/api/people/50",
34 "https://swapi.info/api/people/51",
35 "https://swapi.info/api/people/52",
36 "https://swapi.info/api/people/53",
37 "https://swapi.info/api/people/54",
38 "https://swapi.info/api/people/55",
39 "https://swapi.info/api/people/56",
40 "https://swapi.info/api/people/57",
41 "https://swapi.info/api/people/58",
42 "https://swapi.info/api/people/59"
43 ],
44 "planets": [
45 "https://swapi.info/api/planets/1",
46 "https://swapi.info/api/planets/8",
47 "https://swapi.info/api/planets/9"
48 ],
49 "starships": [
50 "https://swapi.info/api/starships/31",
51 "https://swapi.info/api/starships/32",
52 "https://swapi.info/api/starships/39",
53 "https://swapi.info/api/starships/40",
54 "https://swapi.info/api/starships/41"
55 ],
56 "vehicles": [
57 "https://swapi.info/api/vehicles/33",
58 "https://swapi.info/api/vehicles/34",
59 "https://swapi.info/api/vehicles/35",
60 "https://swapi.info/api/vehicles/36",
61 "https://swapi.info/api/vehicles/37",
62 "https://swapi.info/api/vehicles/38",
63 "https://swapi.info/api/vehicles/42"
64 ],
65 "species": [
66 "https://swapi.info/api/species/1",
67 "https://swapi.info/api/species/2",
68 "https://swapi.info/api/species/6",
69 "https://swapi.info/api/species/11",
70 "https://swapi.info/api/species/12",
71 "https://swapi.info/api/species/13",
72 "https://swapi.info/api/species/14",
73 "https://swapi.info/api/species/15",
74 "https://swapi.info/api/species/16",
75 "https://swapi.info/api/species/17",
76 "https://swapi.info/api/species/18",
77 "https://swapi.info/api/species/19",
78 "https://swapi.info/api/species/20",
79 "https://swapi.info/api/species/21",
80 "https://swapi.info/api/species/22",
81 "https://swapi.info/api/species/23",
82 "https://swapi.info/api/species/24",
83 "https://swapi.info/api/species/25",
84 "https://swapi.info/api/species/26",
85 "https://swapi.info/api/species/27"
86 ],
87 "created": "2014-12-19T16:52:55.740000Z",
88 "edited": "2014-12-20T10:54:07.216000Z",
89 "url": "https://swapi.info/api/films/4"
90}
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.