Lightweight Python client for the Star Wars API (SWAPI). Get data on people, planets, starships, and more from the Star Wars universe. No API key needed.
from swapi import SWAPIClient
client = SWAPIClient()
# Get a character
luke = client.person(1)
print(f"{luke['name']} — Height: {luke['height']}cm, Mass: {luke['mass']}kg")
# Search characters
results = client.search_people("skywalker")
for p in results:
print(f" {p['name']}")
# Get a planet
tatooine = client.planet(1)
print(f"{tatooine['name']} — Population: {tatooine['population']}")
# Get a starship
falcon = client.starship(10)
print(f"{falcon['name']} — Speed: {falcon['max_speed']}")| Method | Description |
|---|---|
person(id) |
Get character by ID |
planet(id) |
Get planet by ID |
starship(id) |
Get starship by ID |
film(id) |
Get film by ID |
species(id) |
Get species by ID |
vehicle(id) |
Get vehicle by ID |
search_people(query) |
Search characters |
search_planets(query) |
Search planets |
search_starships(query) |
Search starships |
- pokeapi-python — Pokemon data
- awesome-no-auth-apis — 50+ free APIs
MIT
I build production-ready scrapers, APIs, and data tools — 78+ deployed on Apify, 270+ open-source repos.
📧 spinov001@gmail.com — $250 flat rate, 48h delivery. Describe your project, get a free estimate in 2 hours.