/films/2

API Endpoint:

Request:

request.js
1fetch("https://swapi.info/api/films/2")
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 Empire Strikes Back",
3 "episode_id": 5,
4 "opening_crawl": "It is a dark time for the\r\nRebellion. Although the Death\r\nStar has been destroyed,\r\nImperial troops have driven the\r\nRebel forces from their hidden\r\nbase and pursued them across\r\nthe galaxy.\r\n\r\nEvading the dreaded Imperial\r\nStarfleet, a group of freedom\r\nfighters led by Luke Skywalker\r\nhas established a new secret\r\nbase on the remote ice world\r\nof Hoth.\r\n\r\nThe evil lord Darth Vader,\r\nobsessed with finding young\r\nSkywalker, has dispatched\r\nthousands of remote probes into\r\nthe far reaches of space....",
5 "director": "Irvin Kershner",
6 "producer": "Gary Kurtz, Rick McCallum",
7 "release_date": "1980-05-17",
8 "characters": [
9 "https://swapi.info/api/people/1",
10 "https://swapi.info/api/people/2",
11 "https://swapi.info/api/people/3",
12 "https://swapi.info/api/people/4",
13 "https://swapi.info/api/people/5",
14 "https://swapi.info/api/people/10",
15 "https://swapi.info/api/people/13",
16 "https://swapi.info/api/people/14",
17 "https://swapi.info/api/people/18",
18 "https://swapi.info/api/people/20",
19 "https://swapi.info/api/people/21",
20 "https://swapi.info/api/people/22",
21 "https://swapi.info/api/people/23",
22 "https://swapi.info/api/people/24",
23 "https://swapi.info/api/people/25",
24 "https://swapi.info/api/people/26"
25 ],
26 "planets": [
27 "https://swapi.info/api/planets/4",
28 "https://swapi.info/api/planets/5",
29 "https://swapi.info/api/planets/6",
30 "https://swapi.info/api/planets/27"
31 ],
32 "starships": [
33 "https://swapi.info/api/starships/3",
34 "https://swapi.info/api/starships/10",
35 "https://swapi.info/api/starships/11",
36 "https://swapi.info/api/starships/12",
37 "https://swapi.info/api/starships/15",
38 "https://swapi.info/api/starships/17",
39 "https://swapi.info/api/starships/21",
40 "https://swapi.info/api/starships/22",
41 "https://swapi.info/api/starships/23"
42 ],
43 "vehicles": [
44 "https://swapi.info/api/vehicles/8",
45 "https://swapi.info/api/vehicles/14",
46 "https://swapi.info/api/vehicles/16",
47 "https://swapi.info/api/vehicles/18",
48 "https://swapi.info/api/vehicles/19",
49 "https://swapi.info/api/vehicles/20"
50 ],
51 "species": [
52 "https://swapi.info/api/species/1",
53 "https://swapi.info/api/species/2",
54 "https://swapi.info/api/species/3",
55 "https://swapi.info/api/species/6",
56 "https://swapi.info/api/species/7"
57 ],
58 "created": "2014-12-12T11:26:24.656000Z",
59 "edited": "2014-12-15T13:07:53.386000Z",
60 "url": "https://swapi.info/api/films/2"
61}
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.