PHPackages                             enm/json-api-client - 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. enm/json-api-client

ActiveLibrary[API Development](/categories/api)

enm/json-api-client
===================

Abstract client-side php implementation of the json api specification (jsonapi.org)

4.0.1(6y ago)1835.2k↓44.6%7[1 PRs](https://github.com/eosnewmedia/JSON-API-Client/pulls)1MITPHP

Since Jul 20Pushed 3y ago6 watchersCompare

[ Source](https://github.com/eosnewmedia/JSON-API-Client)[ Packagist](https://packagist.org/packages/enm/json-api-client)[ RSS](/packages/enm-json-api-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (13)Used By (1)

JSON API Client
===============

[](#json-api-client)

[![Build Status](https://camo.githubusercontent.com/d7dd246ea159c249c6da083b72fbbb7f484116431d887a2519bc66f482bee307/68747470733a2f2f7472617669732d63692e6f72672f656f736e65776d656469612f4a534f4e2d4150492d436c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/eosnewmedia/JSON-API-Client)

Abstract client-side PHP implementation of the [json api specification](http://jsonapi.org/format/).

Installation
------------

[](#installation)

```
composer require enm/json-api-client
```

It's recommended to install `kriswallsmith/buzz` as http-client and `nyholm/psr7` for http factories.

```
composer require kriswallsmith/buzz nyholm/psr7
```

You can also use any HTTP client which implements [PSR-18](https://www.php-fig.org/psr/psr-18/).

Usage
-----

[](#usage)

First you should read the docs at [enm/json-api-common](https://eosnewmedia.github.io/JSON-API-Common/) where all basic structures are defined.

Your API client is an instance of `Enm\JsonApi\Client\JsonApiClient`, which requires a PSR-18 HTTP client (`Psr\Http\Client\ClientInterface`) to execute requests.

```
$client = new JsonApiClient(
    'http://example.com/api',
    $httpClient, // instance of Psr\Http\Client\ClientInterface
    $uriFactory, // instance of Psr\Http\Message\UriFactoryInterface
    $requestFactory, // instance of Psr\Http\Message\RequestFactoryInterface
    $streamFactory, // instance of Psr\Http\Message\StreamFactoryInterface
    new Serializer(),
    new Deserializer()
);

$request = $client->createGetRequest(new Uri('/myResources/1')); // will fetch the resource at http://example.com/api/myResources/1
$request->requestInclude('myRelationship'); // include a relationship

$response = $client->execute($request);

$document = $response->document();
$myResource = $document->data()->first(); // the resource fetched by this request
$myIncludedResources = $document->included()->all(); // the included resources fetched with the include parameter
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~122 days

Recently: every ~187 days

Total

9

Last Release

2245d ago

Major Versions

1.2.0 → 3.0.02018-09-27

3.0.1 → 4.0.02019-08-29

### Community

Maintainers

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

---

Top Contributors

[![pmarien](https://avatars.githubusercontent.com/u/8394874?v=4)](https://github.com/pmarien "pmarien (2 commits)")[![bogomolov-dev](https://avatars.githubusercontent.com/u/127733?v=4)](https://github.com/bogomolov-dev "bogomolov-dev (1 commits)")[![MaDKaTZe](https://avatars.githubusercontent.com/u/963759?v=4)](https://github.com/MaDKaTZe "MaDKaTZe (1 commits)")[![richgerdes](https://avatars.githubusercontent.com/u/1626100?v=4)](https://github.com/richgerdes "richgerdes (1 commits)")

---

Tags

abstractionapiapi-clientclientjson-apiphpphp7

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/enm-json-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/enm-json-api-client/health.svg)](https://phpackages.com/packages/enm-json-api-client)
```

###  Alternatives

[kbsali/redmine-api

Redmine API client

4221.1M24](/packages/kbsali-redmine-api)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[prokerala/astrology-sdk

Prokerala.com Astrology API Client Library for PHP.

2610.0k](/packages/prokerala-astrology-sdk)[luzrain/telegram-bot-api

PHP Wrapper for Telegram Bot API

1032.8k1](/packages/luzrain-telegram-bot-api)

PHPackages © 2026

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