SWAPI Star Wars Scraper
parseforge/swapi-star-wars-scraper
GAMESDEVELOPER_EXAMPLESEducation
Collects Star Wars data from the open SWAPI by category and returns each record as a flat row. Supports people, planets, starships, vehicles, species, and films with optional reference resolution.
- Total users
- 2
- Monthly active
- 1
- Total runs
- 98
- Bookmarked
- 0
- Rating
- Not rated yet
- Last modified
- 12 days ago
Overview
SWAPI Star Wars Scraper
Scrape the complete Star Wars universe from SWAPI, the open Star Wars API, and export every character, planet, starship, vehicle, species, and film in one run. Each record arrives as a flat, structured row with all its canonical fields. No API key or authentication needed. Export to CSV, JSON, Excel, or XML.
The Star Wars API (SWAPI) is the definitive open dataset for the Star Wars galaxy, but querying it page by page and resolving cross-referenced URLs takes custom scripting. This Actor reads every SWAPI category you select, paginates through all records up to your limit, and optionally resolves URL references to human-readable names so your dataset is self-contained. You get clean, flat rows ready for analysis, a data app, or a fan project.
| Who uses it | What they scrape SWAPI (The Star Wars API) for |
|---|---|
| Data journalists | Analyze the structure and demographics of the Star Wars galaxy for a story or visualization. |
| Fan site builders | Populate a Star Wars wiki, database, or character browser with canonical data. |
| Educators and students | Create datasets for teaching APIs, data wrangling, or relational data concepts with a familiar universe. |
| App developers | Seed a Star Wars trivia app, chatbot, or game with structured reference data. |
What it does
This Actor collects Star Wars data from SWAPI by category and returns each record as a flat row with all its canonical attributes.
- ๐ Multi-category export: Pick any combination of people, planets, starships, vehicles, species, and films in one run.
- ๐ Reference resolution: Turn homeworld, film, character, and other URL references into plain-text names so every row is self-contained.
- ๐ Record capping: Set a maximum number of records to collect per run, from a single sample up to the full galaxy.
- ๐ Flat row output: Every SWAPI entity, regardless of its original nesting, is returned as a flat JSON object ready for CSV or table import.
Results export to CSV, JSON, Excel, or XML, or straight from the API.
What you can do with SWAPI (The Star Wars API) data
๐ Build a Star Wars data dashboard.
A data journalist exports all people and planets, resolves homeworld names, and loads the flat file into a BI tool to chart character demographics by homeworld.
๐ Populate a fan wiki or database.
A fan site developer runs the Actor weekly to refresh a searchable Starship and Vehicle database with the latest canonical fields from SWAPI.
๐ Teach API concepts with a familiar dataset.
An instructor exports the Films and Species categories to create a ready-to-use dataset for a Python or SQL workshop on joins and data cleaning.
๐ค Seed a Star Wars trivia bot.
An app developer scrapes all People records with resolved film appearances to build a question bank for a voice-activated Star Wars quiz.
Why choose this scraper
| What you get | |
|---|---|
| No API key required | SWAPI is open. This Actor reads it directly with no registration or authentication. |
| Self-contained records | Optional reference resolution replaces URLs with names so you do not need to join data later. |
| All six categories | People, planets, starships, vehicles, species, and films are available in a single run. |
| Flat, predictable schema | Every record is a flat object with consistent keys, regardless of the original SWAPI nesting. |
How it compares
No other Store actor targets SWAPI (The Star Wars API) the same way, so the honest comparison is with the alternatives teams actually weigh.
| SWAPI Star Wars Scraper | Build it in-house | By hand | |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When SWAPI (The Star Wars API) changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |
Configure the run
Drive the Actor by selecting one or more SWAPI categories and optionally enabling reference resolution to enrich URL fields with names. The Input tab lists every parameter.
A first run with the defaults:
{
"categories": [
"people"
],
"maxItems": 10
}
A larger pull:
{
"categories": [
"people"
],
"maxItems": 200
}
Pricing
Pay-per-result: $0.008 per result collected. You pay only for the results written to your dataset.
| Results collected | Approximate cost |
|---|---|
| 100 results | $0.80 |
| 1,000 results | $8.00 |
| 10,000 results | $80.00 |
New Apify accounts start with $5 in free credit.
Free users
Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.
Run it
- Create a free Apify account with $5 in credit.
- Open the SWAPI Star Wars Scraper.
- Set your inputs and any filters, then click Start.
- Export the results as CSV, Excel, JSON, or XML from the Dataset tab.
Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.
Use with AI agents (MCP)
Give an AI agent live access to SWAPI (The Star Wars API) through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/swapi-star-wars-scraper"
Then prompt it in plain language to run the scraper and read back the results.
Troubleshooting
Why am I getting fewer records than I expected?
Check the 'Maximum records' setting in your input. The Actor stops collecting once it reaches that limit, even if more records exist in the selected categories.
Why are some fields still showing URLs instead of names?
Make sure the 'Resolve URL references to names' checkbox is enabled in the Advanced section of the input. If it is off, URL fields are returned as raw SWAPI links.
The run is taking a long time. Is that normal?
Reference resolution adds one extra request per URL field. If you selected all categories with resolution enabled, the Actor makes many requests. Disable resolution for a faster run, or reduce the maximum records limit.
Why do I see duplicate records?
The Actor does not deduplicate across categories. If a film appears in the films category and is also referenced elsewhere, it is only collected once per category selection. Check that you did not select overlapping inputs.
FAQ
| Question | Answer |
|---|---|
| What is SWAPI? | SWAPI, the Star Wars API, is a free and open REST API that provides structured data about the Star Wars universe, including characters, planets, starships, vehicles, species, and films. It is the world's first quantified and programmatically accessible Star Wars dataset. |
| Do I need an API key or authentication? | No. SWAPI is completely open and requires no API key, token, or registration. This Actor reads the public endpoints directly. |
| What does reference resolution do? | When enabled, the Actor follows every URL reference in a record (such as a character's homeworld or a film's characters) and replaces the URL with the target's name. This makes each row self-contained so you do not need to make follow-up requests. |
| Can I export multiple categories in one run? | Yes. Select any combination of people, planets, starships, vehicles, species, and films in the input, and the Actor will collect and export all of them in a single run. |
| How many records can I collect? | You set the maximum number of records per run, from 1 up to 1,000,000. The full SWAPI dataset contains 82 people, 60 planets, 36 starships, 39 vehicles, 37 species, and 6 films. |
| What output formats are supported? | The Actor returns data in the Apify dataset format, which you can export to CSV, JSON, Excel, XML, or other formats from the Apify platform. |
| Does reference resolution slow down the run? | It adds extra HTTP requests for each URL reference, so a run with resolution enabled will take longer. For the full dataset the difference is small, but it is noticeable on larger extractions. |
| Is the data flat or nested? | Every record is returned as a flat object. Array fields like films or residents are kept as arrays, but each array element is a plain value or a resolved name, not a nested object. |
Related actors
Browse the full ParseForge collection for more scrapers.
๐ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.
โ ๏ธ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by SWAPI. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.
Input
| Field | Type | What it does | Default |
|---|---|---|---|
| categories required | array | Pick one or more SWAPI categories to export. Each category produces records with its own field set. Default: people. | ["people"] |
| maxItems | integer | Maximum number of Star Wars records to collect per run. | 10 |
| resolveReferences | boolean | When enabled, every URL reference (homeworld, films, residents, etc.) is enriched with a human-readable name so downstream consumers do not have to make a second request. | false |
Pricing
from $6.00 per 1,000 results
| Charged for | What it is | Price each |
|---|---|---|
| Result Item | Charged once per result collected. | $0.006 to $0.008 |
Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.
API
One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.
curl -X POST "https://api.apify.com/v2/acts/parseforge~swapi-star-wars-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"helloWorld": 123
}' Examples
Input that runs as-is.
{
"helloWorld": 123
} Reviews
No reviews yet. Be the first.
Issues
We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.
Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.
