PHPackages                             league/fractal-serializer-jsonapi - 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. league/fractal-serializer-jsonapi

ActiveLibrary[API Development](/categories/api)

league/fractal-serializer-jsonapi
=================================

Handle the output of complex data structures ready for API output.

2164[3 PRs](https://github.com/thephpleague/fractal-serializer-jsonapi/pulls)PHP

Since Jul 5Pushed 5y ago3 watchersCompare

[ Source](https://github.com/thephpleague/fractal-serializer-jsonapi)[ Packagist](https://packagist.org/packages/league/fractal-serializer-jsonapi)[ RSS](/packages/league-fractal-serializer-jsonapi/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Fractal Serializer JSON:API
===========================

[](#fractal-serializer-jsonapi)

[![Latest Version](https://camo.githubusercontent.com/7d2d69aa07c2a730de73729cfed8959e82e4ef953b47037fab9cceb32aeba69e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7468657068706c65616775652f6672616374616c2d73657269616c697a65722d6a736f6e6170692e7376673f7374796c653d666c61742d737175617265)](https://github.com/thephpleague/fractal-serializer-jsonapi/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/7ebb7af457d7b8a195fd4222e09b0e9eccff6af0e03d1375feb3e17d9a4e6ee5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7468657068706c65616775652f6672616374616c2d73657269616c697a65722d6a736f6e6170692f6d61737465722e7376673f7374796c653d666c61742d737175617265266c6162656c3d7465737473)](https://travis-ci.org/thephpleague/fractal-serializer-jsonapi)[![Build Status](https://camo.githubusercontent.com/3b2218606d0b21b95b9a2053a52e8ce67c4331e17513e29d077244e119f6588e/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f6275696c642f67682f7468657068706c65616775652f6672616374616c2d73657269616c697a65722d6a736f6e6170692f6d61737465722e7376673f7374796c653d666c61742d737175617265266c6162656c3d636f64652b7374796c65)](https://circleci.com/gh/thephpleague/fractal-serializer-jsonapi)[![Coverage Status](https://camo.githubusercontent.com/ca9d71f1f072dd33310c66950350f0b8066532d517e58c1233886d51c1639fc9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7468657068706c65616775652f6672616374616c2d73657269616c697a65722d6a736f6e6170692f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/fractal-serializer-jsonapi/code-structure)[![Quality Score](https://camo.githubusercontent.com/ddbf2cb83046c87d746007f29847566bd9241f07e2c72a23d969f9969901f019/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7468657068706c65616775652f6672616374616c2d73657269616c697a65722d6a736f6e6170692f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/fractal-serializer-jsonapi)[![Total Downloads](https://camo.githubusercontent.com/ab8dd56fb22e20e5b927ca2ded17fe0f7375f808f1ee0b001cda8affe172809b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65616775652f6672616374616c2d73657269616c697a65722d6a736f6e6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/league/fractal-serializer-jsonapi)

Fractal provides a presentation and transformation layer for complex data output, the like found in RESTful APIs, and works really well with JSON. Think of this as a view layer for your JSON/YAML/etc.

When building an API it is common for people to just grab stuff from the database and pass it to `json_encode()`. This might be passable for "trivial" APIs but if they are in use by the public, or used by mobile applications then this will quickly lead to inconsistent output.

Install
-------

[](#install)

Via Composer

```
$ composer require league/fractal-serializer-jsonapi
```

Requirements
------------

[](#requirements)

The following versions of PHP are supported by this version.

- PHP 7.2
- PHP 7.3
- PHP 7.4
- HHVM

Documentation
-------------

[](#documentation)

Fractal has [full documentation](http://fractal.thephpleague.com), powered by [Jekyll](http://jekyllrb.com/).

Contribute to this documentation in the [gh-pages branch](https://github.com/thephpleague/fractal/tree/gh-pages/).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/thephpleague/fractal/blob/master/LICENSE) for more information.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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/be6d3979e325bfabb0b44a688ecd4b064381dcfd1b6facca14c88e17684ec0f2?d=identicon)[philipobenito](/maintainers/philipobenito)

![](https://www.gravatar.com/avatar/842d2fe13512e82f0f9b6f0d79dba8eba1595a3cefd31dd51723960436133307?d=identicon)[KorvinSzanto](/maintainers/KorvinSzanto)

---

Top Contributors

[![KorvinSzanto](https://avatars.githubusercontent.com/u/1007419?v=4)](https://github.com/KorvinSzanto "KorvinSzanto (9 commits)")

### Embed Badge

![Health badge](/badges/league-fractal-serializer-jsonapi/health.svg)

```
[![Health](https://phpackages.com/badges/league-fractal-serializer-jsonapi/health.svg)](https://phpackages.com/packages/league-fractal-serializer-jsonapi)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

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

GitHub API v3 client

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

PHP SDK for Facebook Business

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

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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