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 1mo ago

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 49% 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

2268d ago

Major Versions

v0.2.0 → 1.0.02020-02-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e4ebca3fcae65ae8dffb87c1645e3d708ba7c80bfc40054cea0aea45501e7aa?d=identicon)[xvrmallafre](/maintainers/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.4k5.6M647](/packages/sylius-sylius)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[alexacrm/dynamics-webapi-toolkit

Web API toolkit for Microsoft Dynamics 365 and Dynamics CRM

81324.1k1](/packages/alexacrm-dynamics-webapi-toolkit)[keboola/storage-api-client

Keboola Storage API PHP Client

10387.5k25](/packages/keboola-storage-api-client)[tamara-solution/php-sdk

Tamara PHP Client Library

10259.4k1](/packages/tamara-solution-php-sdk)

PHPackages © 2026

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