SpaceX API
api.spacexdata.com · Science
Unofficial community-maintained SpaceX data API — launches, rockets, capsules, payloads, crew, launchpads, and Starlink satellites. Free, no API key required.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Get all launches
Get all SpaceX launches.
https://api.spacexdata.com/v5/launches
Hover any highlighted part to learn what it does
curl -X GET "https://api.spacexdata.com/v5/launches"
import requests
response = requests.get(
"https://api.spacexdata.com/v5/launches",
)
print(response.json())const url = 'https://api.spacexdata.com/v5/launches'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.spacexdata.com/v5/launches"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.spacexdata.com/v5/launches")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.spacexdata.com/v5/launches";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
Get latest launch
Get the most recent SpaceX launch.
https://api.spacexdata.com/v5/launches/latest
Hover any highlighted part to learn what it does
curl -X GET "https://api.spacexdata.com/v5/launches/latest"
import requests
response = requests.get(
"https://api.spacexdata.com/v5/launches/latest",
)
print(response.json())const url = 'https://api.spacexdata.com/v5/launches/latest'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.spacexdata.com/v5/launches/latest"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.spacexdata.com/v5/launches/latest")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.spacexdata.com/v5/launches/latest";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
Get all rockets
Get data for all SpaceX rockets (Falcon 1, Falcon 9, Falcon Heavy, Starship).
https://api.spacexdata.com/v5/rockets
Hover any highlighted part to learn what it does
curl -X GET "https://api.spacexdata.com/v5/rockets"
import requests
response = requests.get(
"https://api.spacexdata.com/v5/rockets",
)
print(response.json())const url = 'https://api.spacexdata.com/v5/rockets'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.spacexdata.com/v5/rockets"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.spacexdata.com/v5/rockets")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.spacexdata.com/v5/rockets";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- Try GET https://api.spacexdata.com/v5/launches/latest
- Next launch: GET /launches/next
- Rockets: GET /rockets
- Crew: GET /crew
- Starlink: GET /starlink