Find an API

Search public APIs with auth details & Postman guides

← All APIs

SpaceX API

api.spacexdata.com · Science

Science No Auth Free & Open Space SpaceX Launches

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

Get Postman ↗
  1. No API key needed
  2. Try GET https://api.spacexdata.com/v5/launches/latest
  3. Next launch: GET /launches/next
  4. Rockets: GET /rockets
  5. Crew: GET /crew
  6. Starlink: GET /starlink

Open documentation ↗