API Directory › 🚀 Science & Space › SpaceX (r/SpaceX)
No authHTTPSCORS

SpaceX (r/SpaceX) API

Community-run API of SpaceX launches, rockets, capsules and more.

Auth
No auth needed
HTTPS
Yes
CORS
Yes
Open SpaceX (r/SpaceX) docs ↗

What it does

The r/SpaceX API is a community-built REST API of SpaceX data: launches, rockets, capsules, cores, crew, ships, launchpads, landpads, payloads, Starlink satellites and company info. It also has a flexible query endpoint.

Base URL

https://api.spacexdata.com/v4

Authentication

None. Simple GET endpoints (/launches, /launches/latest, /rockets…) plus a POST /launches/query that accepts MongoDB-style filters and pagination.

Code examples

curl
curl -s "https://api.spacexdata.com/v4/launches/latest"
curl -s "https://api.spacexdata.com/v4/rockets"
Python (query endpoint)
import requests

r = requests.post("https://api.spacexdata.com/v4/launches/query", json={
    "query": {"success": True},
    "options": {"limit": 5, "sort": {"date_unix": "desc"},
                "select": ["name", "date_utc"]}}, timeout=10)
for l in r.json()["docs"]:
    print(l["date_utc"][:10], l["name"])

Rate limits & quotas

No key and no strict rate limit, but the project is community-maintained and effectively frozen — the dataset has not been kept current with recent launches. Treat it as a historical archive, not a live feed. For up-to-date launch data use Launch Library 2.

Key response fields

name / flight_numberMission name and sequence number
date_utc / date_unixLaunch time
successBoolean (null for future/unknown)
rocket / launchpad / payloadsIDs — expand via /rockets/{id} etc. or the query endpoint’s populate
links.patch.small / links.webcastMission patch image and stream URL

Common errors

404Unknown ID or endpoint.
400 (query endpoint)Malformed query/options object.
(missing recent data)Not a bug — the archive stopped being updated; cross-check against LL2.

When to use it (and alternatives)

Good for teaching REST, building demos, and exploring historical SpaceX missions with a friendly query API. Anything that needs current launches must use Launch Library 2 instead.

FAQ

Why is the latest launch out of date?

The r/SpaceX API is a volunteer project and updates have lapsed. The historical data is solid; recent missions are missing. Use Launch Library 2 for anything live.

How does the query endpoint work?

POST to /{resource}/query with a query (Mongo-style filter) and options (limit, page, sort, select, populate). It uses mongoose-paginate under the hood.

Do endpoints return linked objects?

The plain GET endpoints return IDs for related resources. Use the query endpoint with populate, or fetch each ID from its own endpoint.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related Science & Space APIs

← Back

More Science & Space APIs · All 196 APIs