Skip to content

spinov001-art/swapi-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

swapi-python ⚔️

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.

Quick Start

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']}")

API Reference

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

Related Projects

License

MIT


Need a Custom Tool Built?

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.

🔧 Browse 78+ ready-made tools on Apify →

About

Python client for Star Wars API (SWAPI) — characters, planets, starships. No API key needed.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages