SWAPI

The Star Wars API

From a fork of phalt

Statistics

People: 87

Planets: 61

Films: 7

Species : 37

Vehicles: 39

Starships: 36

What is this?

The Star Wars API is the world's first quantified and programmatically-formatted set of Star Wars data.

After hours of watching films and trawling through content online, we present to you all the People, Films, Species, Starships, Vehicles and Planets from Star Wars.

We've formatted this data in JSON and exposed it to you in a RESTish implementation that allows you to programmatically collect and measure the data.

Check out the documentation to get started consuming swapi data

What can you use this for?

Comparing the data from Star Wars has never been easier. Here are some examples using the Python helper library

List the planets in order of size:

import swapi
for planet in swapi.get_all("planets").order_by("diameter"):
    print(planet.name)

View the people who have piloted more than one starship:

import swapi
for people in swapi.get_all("people").iter():
    if len(people.starships) > 1:
        print(people.name)

Discover if Jar Jar Binks ruined a film just by being in it:

import swapi
pm = swapi.get_film(4)
jj = swapi.get_person(36)
for c in pm.get_characters().iter():
    if c.name == jj.name:
        print("Why George, why.")

What are the features?

We're using Django and Django REST Framework to serve a RESTish API to you.

The data is all formatted in JSON and we also support JSON Schema for programmatically understanding the attributes of each resource.

Initial project

Why did Paul build this?

Paul built the Pokémon API before Paul built this. I realised that if you provide data easily, someone will consume it. Paul got bored around Christmas 2014 and decided that Paul'd take what Paul learned from PokéAPI and build an API for Star Wars data.

Seeing the release trailer for Episode VII also made me stupidly enthusiastic for Star Wars again.

Who is Paul?

Paul Hallett, a senior software engineer and an infinitely protean machine.

Copyright and stuff?

Star Wars and all associated names are copyright Lucasfilm ltd.

This project is open source and carries a BSD licence.

All data has been freely collected from open sources such as Wookiepedia.

Contributors

SWAPI would not be possible without contributions from the following people:

From a fork of phalt

Checkout the original project here

This fork has been done to allow Holberton students to still learn API via this amazing Star Wars API

Thank you very much phalt!