Open Notify - People in Space
api.open-notify.org · Science
Get the names and spacecraft of all astronauts currently in space. Simple, single-purpose API. Free, no authentication.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
People in space
Returns the number of people in space and their names.
http://api.open-notify.org/astros.json
Hover any highlighted part to learn what it does
curl -X GET "http://api.open-notify.org/astros.json"
import requests
response = requests.get(
"http://api.open-notify.org/astros.json",
)
print(response.json())const url = 'http://api.open-notify.org/astros.json'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "http://api.open-notify.org/astros.json"
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("http://api.open-notify.org/astros.json")
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 = "http://api.open-notify.org/astros.json";
$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
- GET http://api.open-notify.org/astros.json
- Returns: {"number": N, "people": [{"name":"...", "craft":"..."}, ...]}
- ISS location: GET http://api.open-notify.org/iss-now.json