Simple API Client written in PHP.

1.6 2019-05-06 23:48 UTC

This package is auto-updated.

Last update: 2020-09-27 11:35:41 UTC


A generic REST/JSON API client for the web service, written in PHP.

The design concept for this class is to create a universal (PHP) object specifically to interact with all of the API services, with as minimal code as possible.

This class supports the bandwidth-throttling suggested by the API documentation (100k/sec transfers), to minimize service bandwidth spikes.

Ideally, you should be able to create scripts to interact with the API endpoint of your preference, via crontab (on a daily/weekly/monthly basis), and store/sync the data locally for post-processing via database or (key/value) datastore. Many of the API requests return very large (static) datasets, which do not change frequently, so local data caching is highly suggested.

This project is considered experimental, and is intended for authorized users of the web service (only).


  • PHP v5.0 or higher, compiled w/ the CURL extension
  • An authorized user account on


composer require "sodonnell/spacetrack"

Getting started

Usage Example

require './vendor/autoload.php';

$credentials = [

$cookie = '/tmp/spacetrack.cookie.txt';

use SpaceTrack\SpaceTrack;


// optional parameter: decode JSON to PHP Array?
$response = SpaceTrack::getLaunchSite($decode);


Available Functions

  • SpaceTrack::init(array $credentials, string $cookie)
  • SpaceTrack::getAnnouncement(bool $decode_json)
  • SpaceTrack::getBoxScore(bool $decode_json)
  • SpaceTrack::getCSM(bool $decode_json)
  • SpaceTrack::getDecay(bool $decode_json)
  • SpaceTrack::getLaunchSite(bool $decode_json)
  • SpaceTrack::getOMM(bool $decode_json)
  • SpaceTrack::getOrganization(bool $decode_json)
  • SpaceTrack::getSatCat(bool $decode_json)
  • SpaceTrack::getSatCatChange(bool $decode_json)
  • SpaceTrack::getSatCatDebut(bool $decode_json)
  • SpaceTrack::getTip(bool $decode_json)
  • SpaceTrack::getTLE(bool $decode_json)
  • SpaceTrack::getTLELatest(bool $decode_json)
  • SpaceTrack::getTLEPublish(bool $decode_json)