Space-Track.org API Client written in PHP

Category: Software and Systems Engineering
Author: Sean O'Donnell
Tue, Jul. 29th, 2014 @ 15:16:52 (MDT)

Thanks to the good fellows over at USSTRATCOM/JSPOC who oversee the (un-classified) Space-Track.org orbital object tracking data, I was granted (civilian) access to their API. I decided to develop an API Client in PHP, since that was the only language that I didn't see an API Client for, at the time.

You can download the spacetrack PHP object from my github repository.

$ git clone https://github.com/sodonnell/spacetrack.git

Below is a simple example of using the spacetrack class to retrieve data from the 'boxscore' API.

#!/usr/bin/env php
<?php 
/** simple spacetrack API client script example using PHP/CLI scripting */
require 'spacetrack.php';
$spacetrack = spacetrack::getInstance();
$api='boxscore';
$postdata=null;
$decode=false;
$req_data = $spacetrack->api_call($api,$postdata,$decode);
print $req_data;

For more information about the Space-Track.org API, please visit: https://www.space-track.org/documentation.

Copyleft (<) 1998-2019 www.seanodonnell.com