PHPackages                             xvrmallafre/swapi - 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. xvrmallafre/swapi

AbandonedArchivedLibrary[API Development](/categories/api)

xvrmallafre/swapi
=================

This is a fork of rmasters/swapi that works again.

1.0.0(6y ago)011MITPHP

Since Dec 23Pushed 6y agoCompare

[ Source](https://github.com/xvrmallafre/swapi-php)[ Packagist](https://packagist.org/packages/xvrmallafre/swapi)[ RSS](/packages/xvrmallafre-swapi/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (4)Used By (0)

PHP library for [SWAPI](http://swapi.co/)
=========================================

[](#php-library-for-swapi)

[![Build status](https://camo.githubusercontent.com/9d919452713296bc75c42b359dca4f2d853d93a1a225354fb33d8ffa78b74f47/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f726d6173746572732f73776170692d7068702e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rmasters/swapi-php/)[![Stable release](https://camo.githubusercontent.com/8211ecd90326db01fd9ad856ee834e254ed858a1c1e6a0f185bc233d5614656b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726d6173746572732f73776170692e7376673f7374796c653d666c61742d737175617265)](http://packagist.org/packages/rmasters/swapi)[![License](https://camo.githubusercontent.com/8fc174cf280a4f2825f2f04e455f428716baa5fe11c907dde9b3236dbeedebf8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726d6173746572732f73776170692e7376673f7374796c653d666c61742d737175617265)](LICENSE)

\## Usage

Install with Composer: `composer require "rmasters/swapi:~1.0"`.

```
require_once __DIR__ . '/vendor/autoload.php';
use SWAPI\SWAPI;

$swapi = new SWAPI;

$swapi->characters()->index();  => Character[]
$swapi->characters()->index(2); => Character[]

$swapi->vehicles()->get(1);     => Vehicle
$swapi->planets()->get(7);      => Planet

$swapi->people()->get(9999);    => null (not-found)

// Iteration
do {
    if (!isset($starships)) {
        $starships = $swapi->starships()->index();
    } else {
        $starships = $starships->getNext();
    }

    foreach ($starships as $s) {
        echo "{$s->name}\n";
    }
} while ($starships->hasNext());
```

\## Running tests and contributing

Install dependencies with `composer install --dev` and run `vendor/bin/phpunit`to run the testsuite. The test suite comprises of:

- [tests/Endpoints](tests/Endpoints) - tests that use mocked sample responses,
- [tests/Functional](tests/Functional) - tests that use the live API, to spot changes.

License
-------

[](#license)

[MIT Licensed](LICENSE)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 90.5% 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.

###  Release Activity

Cadence

Every ~943 days

Total

3

Last Release

2323d ago

Major Versions

v0.2.0 → 1.0.02020-02-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5164848?v=4)[Xavier Mallafré](/maintainers/xvrmallafre)[@xvrmallafre](https://github.com/xvrmallafre)

---

Top Contributors

[![rmasters](https://avatars.githubusercontent.com/u/34284?v=4)](https://github.com/rmasters "rmasters (19 commits)")[![xvrmallafre](https://avatars.githubusercontent.com/u/5164848?v=4)](https://github.com/xvrmallafre "xvrmallafre (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xvrmallafre-swapi/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[keboola/storage-api-client

Keboola Storage API PHP Client

10405.9k40](/packages/keboola-storage-api-client)[seatsio/seatsio-php

A PHP client for the seats.io API

17793.2k](/packages/seatsio-seatsio-php)

PHPackages © 2026

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