PHPackages                             matryoshka-model/service-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. matryoshka-model/service-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

matryoshka-model/service-api
============================

A set of utilities aimed at consuming HTTP API services

v0.3.1(10y ago)038311BSD-2-ClausePHPPHP &gt;=5.5.0

Since Oct 31Pushed 9y agoCompare

[ Source](https://github.com/matryoshka-model/service-api)[ Packagist](https://packagist.org/packages/matryoshka-model/service-api)[ Docs](http://github.com/matryoshka-model/service-api)[ RSS](/packages/matryoshka-model-service-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (6)Used By (1)

[![](https://github.com/matryoshka-model/matryoshka/raw/master/docs/assets/images/matryoshka_logo_hi_res_512.png)](https://github.com/matryoshka-model/matryoshka/blob/master/docs/assets/images/matryoshka_logo_hi_res_512.png)

Service API ----------- [![Latest Stable Version](https://camo.githubusercontent.com/e8610376954051398b264ce56f3d07f291b3dae5dfb5b4041a0c146d53b77432/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d617472796f73686b612d6d6f64656c2f736572766963652d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/matryoshka-model/service-api) [![Build Status](https://camo.githubusercontent.com/ba369a219b027670a83017a73071fae27bffc3c3906233155bb642429e467932/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d617472796f73686b612d6d6f64656c2f736572766963652d6170692e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/matryoshka-model/service-api) [![Coveralls branch](https://camo.githubusercontent.com/3411f6bc0e905fe166a9c939a786f9d9d7d0a84230e4886f3f50cfb0b6a47920/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6d617472796f73686b612d6d6f64656c2f736572766963652d6170692f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/matryoshka-model/service-api?branch=master) [![Matryoshka Model's Slack](https://camo.githubusercontent.com/7b173ae656e6f68002d07e15d05a8323c38983856f38238b76f6baf1821d8b54/687474703a2f2f6d617472796f73686b612d736c61636b696e2e6865726f6b756170702e636f6d2f62616467652e7376673f7374796c653d666c61742d737175617265)](http://matryoshka-slackin.herokuapp.com)

> A set of utilities aimed at consuming HTTP API services.

#### Community

[](#community)

For questions and support please visit the [slack channel](http://matryoshka.slack.com) (get an invite [here](http://matryoshka-slackin.herokuapp.com)).

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

[](#installation)

Install it using [composer](http://getcomposer.org).

```
composer require matryoshka-model/service-api

```

Configuration
-------------

[](#configuration)

This library provides two factories for **Zend\\ServiceManager** to make **Zend\\Http\\Client** and **Matryoshka\\Service\\Api\\Client\\HttpApi** available as services.

In order to use them in a ZF2 application register the provided factories into its configuration:

```
'service_manager'    => [
    'factories' => [
        'Matryoshka\Service\Api\Client\HttpClient' => 'Matryoshka\Service\Api\Service\HttpClientServiceFactory',
    ],
    'abstract_factories' => [
        'Matryoshka\Service\Api\Service\HttpApiAbstractServiceFactory',
    ],
],
```

Then, in your configuration you can add the `matryoshka-httpclient` and `matryoshka-service-api` nodes and configure them as in the following example:

```
'matryoshka-httpclient' => [
    'uri'       => 'http://example.net/path', //base uri
    ... //any other options available for Zend\Http\Client
],

'matryoshka-service-api'    => [
    'YourApiServiceName' => [
        'http_client'        => 'Matryoshka\Service\Api\Client\HttpClient', // http client service name
        'base_request'       => 'Zend\Http\Request',                        // base request service name
        'valid_status_code'  => [],                                         // Array of int code valid
        'request_format'     => 'json',                                     // string json/xml
        'profiler'           => '',                                         // profiler service name
    ],
    ...
],
```

---

[![Analytics](https://camo.githubusercontent.com/043f9d94d8ad87256183fe5bae374a532ff4020d1f5e34aa9c34245adcc64fc1/68747470733a2f2f67612d626561636f6e2e61707073706f742e636f6d2f55412d34393635373137362d322f736572766963652d6170693f666c6174)](https://github.com/igrigorik/ga-beacon)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.1% 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 ~272 days

Total

3

Last Release

3664d ago

PHP version history (2 changes)v0.2.0PHP &gt;=5.4.0

v0.3.1PHP &gt;=5.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/120051?v=4)[Leo Di Donato](/maintainers/leodido)[@leodido](https://github.com/leodido)

---

Top Contributors

[![leodido](https://avatars.githubusercontent.com/u/120051?v=4)](https://github.com/leodido "leodido (27 commits)")[![leogr](https://avatars.githubusercontent.com/u/3390997?v=4)](https://github.com/leogr "leogr (10 commits)")[![visa4](https://avatars.githubusercontent.com/u/3627018?v=4)](https://github.com/visa4 "visa4 (1 commits)")

---

Tags

httpapirestrpcrestfulweb servicesmatryoshka

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matryoshka-model-service-api/health.svg)

```
[![Health](https://phpackages.com/badges/matryoshka-model-service-api/health.svg)](https://phpackages.com/packages/matryoshka-model-service-api)
```

###  Alternatives

[nategood/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

1.8k17.2M266](/packages/nategood-httpful)[zfr/zfr-rest

Zend Framework 2 REST Module.

8120.6k](/packages/zfr-zfr-rest)[wellrested/wellrested

Simple PHP Library for RESTful APIs

4818.7k4](/packages/wellrested-wellrested)[msankhala/parsehub-php

Php wrapper classes for Parsehub REST api.

1312.4k](/packages/msankhala-parsehub-php)

PHPackages © 2026

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