PHPackages                             sapistudio/restapi - 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. sapistudio/restapi

ActiveLibrary[API Development](/categories/api)

sapistudio/restapi
==================

Core provides a unified interface for building API Clients

3.1.3(4y ago)0852MITPHPPHP &gt;=5.6

Since Nov 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Sapistudio/SapiRestApi)[ Packagist](https://packagist.org/packages/sapistudio/restapi)[ RSS](/packages/sapistudio-restapi/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (2)

provides a unified interface for building API Clients

first create your client class

```
use SapiStudio\RestApi\AbstractHttpClient;

/**
 * Class HttpClient.
 */
class HttpClient extends AbstractHttpClient
{
    protected $headers = [
          any custom header as array
    ];

    protected $requestModifiers = [RequestModifier::class];

    protected $responseFormat = 'xml json or txt';

    protected function buildRequestUri($baseUri,$path=false)
    {
        format your own custom request url
    }
}
```

Next create your modifier

```
use SapiStudio\RestApi\Request\Modifier;

class RequestModifier extends Modifier
{
    public function apply()
    {
        $this->httpClient->setOption('base_uri', $this->httpClient->getConfig('your config key set on init'));//this is a required parameter,the base uri of the api call
        $this->httpClient->addFormParameter('apikey', $this->httpClient->getConfig('apikey'));//if you set an api key in config,you can use it here
        return $this->httpClient;
    }
}
```

And finally , your api class

```
use SapiStudio\RestApi\AbstractApi;

class MyApi extends AbstractApi
{
    public function myapiFunction()
    {
        $this->addFormParameter('apifunc',$functionName);
        return $this->post(true,$parameters);
        return $this->get(true,$parameters);
    }
}
```

And now to use it

```
$class      = new HttpClient();
$class->setConfig(['key'        => value]);
$apicall = $class->api('MyApi')->myapiFunction();
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~175 days

Recently: every ~134 days

Total

7

Last Release

1677d ago

Major Versions

2.0.2 → 3.1.02020-06-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed1a8aae5d1befdaadd91bd113d227ec995b0382d2cf5fc827d479b510454fad?d=identicon)[maharbig](/maintainers/maharbig)

---

Top Contributors

[![Sapistudio](https://avatars.githubusercontent.com/u/15252797?v=4)](https://github.com/Sapistudio "Sapistudio (56 commits)")

---

Tags

rest-api

### Embed Badge

![Health badge](/badges/sapistudio-restapi/health.svg)

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

###  Alternatives

[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[esign/laravel-conversions-api

A laravel wrapper package around the Facebook Conversions API

69145.4k](/packages/esign-laravel-conversions-api)[didww/didww-api-3-php-sdk

PHP SDK for DIDWW API 3

1218.2k](/packages/didww-didww-api-3-php-sdk)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)

PHPackages © 2026

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