Skip to content

Space Information API

The Space Information API provides live space-related data in a JSON response. It includes values such as the International Space Station latitude and longitude, the number of people currently in space, and a list of names.

Response Format

All successful responses are returned in JSON format.

{
    "credit": "API credit string",
    "last_updated": "timestamp",
    "iss_latitude": "0.0000",
    "iss_longitude": "0.0000",
    "people_in_space": 7,
    "people_names": ["Name 1"]
}

Response Fields:

  • credit (string) - Attribution text for the API source.
  • last_updated (string) - The timestamp for the latest update.
  • iss_latitude (string or number) - The current ISS latitude.
  • iss_longitude (string or number) - The current ISS longitude.
  • people_in_space (integer) - The current number of people in space.
  • people_names (array) - A list of people currently in space.

Authentication Methods

This endpoint is publicly accessible and does not require authentication.

Characteristics:

  • No authentication required
  • JSON response format
  • Includes live ISS position data
  • Includes current people-in-space data

Usage:

curl "https://api.tylermwise.uk/v1/spacedata"

You can fetch and decode the API response in PHP using file_get_contents() and json_decode().

Example:

<?php
    $contents = file_get_contents("https://api.tylermwise.uk/v1/spacedata");
    $data = json_decode($contents);
?>

Endpoint

GET /v1/spacedata

Example Request

curl "https://api.tylermwise.uk/v1/spacedata"

Example Response

{
    "credit": "API credit string",
    "last_updated": "timestamp",
    "iss_latitude": "0.0000",
    "iss_longitude": "0.0000",
    "people_in_space": 7,
    "people_names": ["Name 1"]
}

PHP Usage

Fetch API Data

<?php
    $contents = file_get_contents("https://api.tylermwise.uk/v1/spacedata");
    $data = json_decode($contents);
?>

Output Common Values

<?php
    echo $data->credit;
    echo $data->last_updated;
    echo $data->iss_latitude;
    echo $data->iss_longitude;
    echo $data->people_in_space;
    echo $data->people_names[0];
?>

Output ISS Coordinates

<?php echo $data->iss_latitude; ?>
<?php echo $data->iss_longitude; ?>

Output Number of People in Space

<?php echo $data->people_in_space; ?>

Output API Credit

<?php echo $data->credit; ?>

Response Fields

Field Type Description
credit string Attribution text for the API source.
last_updated string Timestamp of the latest update.
iss_latitude string or number Current ISS latitude.
iss_longitude string or number Current ISS longitude.
people_in_space integer Total number of people currently in space.
people_names array List of people currently in space.

Notes

  • The endpoint returns space-related data in a single response.
  • The original source says the ISS position updates every second.
  • You can access the first listed name with people_names[0].
  • The source section labelled API Credit appears to contain a typo and references timestamp, but the earlier example output includes credit and last_updated instead.

HTTP Status Codes

Standard responses may include:

  • 200 - Success.
  • 400 - Bad Request.
  • 429 - Too Many Requests.
  • 500 - Internal Server Error.

Versioning

This page documents version 1 of the Space Information API, available under the /v1/ path.