PHPackages                             jaytaph/spacetraders - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jaytaph/spacetraders

ActiveLibrary[API Development](/categories/api)

jaytaph/spacetraders
====================

PHP client for the SpaceTraders.io API

033PHP

Since May 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jaytaph/spacetraders)[ Packagist](https://packagist.org/packages/jaytaph/spacetraders)[ RSS](/packages/jaytaph-spacetraders/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Spacetraders API for PHP
========================

[](#spacetraders-api-for-php)

Consists of an API to be used in your own application

Each api call consists of the following:

- Instantiate an api command.

    For instance: `Jaytaph\Spacetraders\Api\Command\Fleet\ListCommand(1, 20)`. Each command can have a number of arguments that depends on the call. For instance, the list commands have a page number and limit argument to fetch a given page.
- Create an API instance. The constructor takes a boolean argument that indicates if the token should be retrieved from the `.token` file. If not, you can set it with `$api->setToken($token)`. The token is then used in the authorization header.
- Next, execute the given command. It will return a `ApiResponse` object. This object contains the response data, and the status code which can be used to check if the call was successful.
- Parse the response

#### Example:

[](#example)

```
  $command = ListCommand(page: 1, limit: 20);
  $api = new Api(retrieveToken: true);
  $response = $api->execute($command);

  $response = ListResponse::fromJson($response->data);
  foreach ($response->ships as $ship) {
     print "You have a ship named {$ship->symbol}\n";
  }

```

Please read the spacetraders.io getting started documentation to use the API. Most of it will make sense then.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/19b14ca62f80ce8c77ae749ddf04e2d4077451db9f701f3bd37dec1dc950c76b?d=identicon)[JayTaph](/maintainers/JayTaph)

---

Top Contributors

[![jaytaph](https://avatars.githubusercontent.com/u/241458?v=4)](https://github.com/jaytaph "jaytaph (41 commits)")

### Embed Badge

![Health badge](/badges/jaytaph-spacetraders/health.svg)

```
[![Health](https://phpackages.com/badges/jaytaph-spacetraders/health.svg)](https://phpackages.com/packages/jaytaph-spacetraders)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
