SpaceX (r/SpaceX) API
Community-run API of SpaceX launches, rockets, capsules and more.
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
Authentication
None. Simple GET endpoints (/launches, /launches/latest, /rockets…) plus a POST /launches/query that accepts MongoDB-style filters and pagination.
Code examples
curl -s "https://api.spacexdata.com/v4/launches/latest" curl -s "https://api.spacexdata.com/v4/rockets"
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_number | Mission name and sequence number |
| date_utc / date_unix | Launch time |
| success | Boolean (null for future/unknown) |
| rocket / launchpad / payloads | IDs — expand via /rockets/{id} etc. or the query endpoint’s populate |
| links.patch.small / links.webcast | Mission patch image and stream URL |
Common errors
| 404 | Unknown 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.