SpaceTrack Client

Java client for the Space-Track.org REST API

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.stevenpaligo
ArtifactId

ArtifactId

spacetrack-client
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

SpaceTrack Client
Java client for the Space-Track.org REST API
Project URL

Project URL

https://github.com/stevenpaligo/spacetrack-client
Source Code Management

Source Code Management

https://github.com/stevenpaligo/spacetrack-client.git

Download spacetrack-client

How to add to project

<!-- https://jarcasting.com/artifacts/com.stevenpaligo/spacetrack-client/ -->
<dependency>
    <groupId>com.stevenpaligo</groupId>
    <artifactId>spacetrack-client</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.stevenpaligo/spacetrack-client/
implementation 'com.stevenpaligo:spacetrack-client:1.1.0'
// https://jarcasting.com/artifacts/com.stevenpaligo/spacetrack-client/
implementation ("com.stevenpaligo:spacetrack-client:1.1.0")
'com.stevenpaligo:spacetrack-client:jar:1.1.0'
<dependency org="com.stevenpaligo" name="spacetrack-client" rev="1.1.0">
  <artifact name="spacetrack-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.stevenpaligo', module='spacetrack-client', version='1.1.0')
)
libraryDependencies += "com.stevenpaligo" % "spacetrack-client" % "1.1.0"
[com.stevenpaligo/spacetrack-client "1.1.0"]

Dependencies

compile (8)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.10.1
com.fasterxml.jackson.datatype : jackson-datatype-jdk8 jar 2.10.1
com.fasterxml.jackson.datatype : jackson-datatype-jsr310 jar 2.10.1
com.mikesamuel : json-sanitizer jar 1.2.0
commons-io : commons-io jar 2.6
org.projectlombok : lombok jar 1.18.10
org.slf4j : slf4j-api jar 1.7.29
org.threeten : threeten-extra jar 1.5.0

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-engine jar 5.5.2
org.slf4j : slf4j-simple jar 1.7.29

Project Modules

There are no modules declared in this project.

SpaceTrack Client

This project is a Java client for querying space data (satellites, two-line element sets, etc.) from the Space-Track.org REST API. It uses builder objects to construct queries and automatically deserializes the results into convenient data model objects.

Maven Central Javadoc License

Getting Started

Prerequisites

SpaceTrack Client requires Java 8+ and uses SLF4J for logging.

Installation

To include SpaceTrack Client in a Maven project, add the following dependency:

<dependencies>
  ...
  <dependency>
    <groupId>com.stevenpaligo</groupId>
    <artifactId>spacetrack-client</artifactId>
    <version>${spacetrack-client.version}</version>
  </dependency>
  ...
</dependencies>

For non-Maven projects, download the JAR from Maven's Central Repository. The list of dependencies can be found in the pom.xml file (see the source on GitHub)

Usage

The following is a quick "Hello World" example of querying data. The example queries the Satellite Catalog (a.k.a. SatCat) for the International Space Station's data and prints out its apogee height.

/*
   Define the credentials for the service call. SpaceTrack Client includes the `DefaultCredentialProvider`
   class which takes and stores the credentials as simple strings. If a different implementation is
   required (e.g. store an encrypted password), just implement the `CredentialProvider` interface and pass
   that to the query instead. The implementation can be anything as long as it can provide the credentials
   as they should be passed to Space-Track.org.
*/
CredentialProvider credentials = new DefaultCredentialProvider("user", "password");


/*
   Query for the International Space Station's satellite record (catalog number 25544). Start by
   instantiating the query class that represents Space-Track.org's "request class" (SatCatQuery, TleQuery,
   etc.). Next, set the credential object on the query. Then set any predicates, limits, sorting, etc. that
   define how the query functions. In this example, the query is searching for the satellite whose catalog
   number is equal to 25544. Finally, call the `execute()` method to run the query and return results as
   deserialized data model objects.
*/
List<SatCat> results = new SatCatQuery().setCredentials(credentials)
  .addPredicate(new Equal<>(SatCatQueryField.CATALOG_NUMBER, 25544)).execute();


/*
   Print out the apogee height
*/
SatCat internationalSpaceStation = results.get(0);

if (internationalSpaceStation.getApogeeHeightKilometers().isPresent()) {

  long apogeeHeightKm = internationalSpaceStation.getApogeeHeightKilometers().get();
  System.out.println("The International Space Station's apogee height is: " + apogeeHeightKm + " km");

} else {

  System.out.println("The International Space Station's apogee height is: unknown");
}

See the JavaDoc for more information.

Contributions

Contributions (bug reports, feature requests, etc.) are always welcome and should be coordinated through the GitHub Issues system.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache License Version 2.0. See the license file file for details.

Versions

Version
1.1.0
1.0.2
1.0.1
1.0.0