Space Information API

So you can use the Space API, you are firstly going to need to add this PHP code

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

So you can get a certain part of data on this API you can use any part of the following code

<?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];
?>

GET https://api.tylermwise.uk/v1/spacedata

{
    // Response
}

Space Station information

If you are wanting to get the latitude and longitude the following code will work. This updates every second so you can get accurate data.

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

People in Space

If you are wanting to get the number of people in space this code will return a number for example '7'

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

API Credit

If you are wanting to credit our API we ask you to use this line of code, this means we can update this if we change the URL in the future.

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

Last updated