PHPackages                             paulgessinger/jsonrpc - 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. paulgessinger/jsonrpc

ActiveLibrary[API Development](/categories/api)

paulgessinger/jsonrpc
=====================

Lightweight framework for JsonRpc APIs.

0.2.3(12y ago)0163[1 issues](https://github.com/paulgessinger/jsonrpc/issues)MITPHPPHP &gt;=5.3.0

Since Dec 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/paulgessinger/jsonrpc)[ Packagist](https://packagist.org/packages/paulgessinger/jsonrpc)[ RSS](/packages/paulgessinger-jsonrpc/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (8)Versions (6)Used By (0)

\#JSONRPC for PHP

[![Build Status](https://camo.githubusercontent.com/2666c1f55bd4e2109bdd0ea7946a9184b0af25caf0d8bf3f295606a82dff9fca/68747470733a2f2f7472617669732d63692e6f72672f7061756c67657373696e6765722f6a736f6e7270632e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/paulgessinger/jsonrpc)

Allows you to write simple and fast JSON RPC APIs by exposing arbitrary objects to HTTP POST requests.

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

[](#installation)

By all means; use Composer!

1. Get [Composer](http://getcomposer.org/)
2. Add `"paulgessinger/jsonrpc": "dev-master"` to your require
3. Install dependencies with `composer install`

Getting started
---------------

[](#getting-started)

Put something like this in your bootstrap file (e.g. index.php).

```
use PG\JsonRpc\Server ;

include __DIR__.'/vendor/autoload.php' ;

$server = new Server() ;

$server->expose('Sample', 'PG\JsonRpc\tests\sample\Sample') ;

$server->run() ;
```

You can then do POST requests on it with a JSON body in the form of

```
{
	"jsonrpc":"2.0",
	"id":1,
	"method":"Sample.divide",
	"params": [11, 5]
}
```

(documented in the [JSON RPC specification](http://www.jsonrpc.org/specification)).

while *Sample* looks like

```
namespace PG\JsonRpc\tests\sample;
use PG\JsonRpc\Exception\ArgumentException;

class Sample {
    public function divide($a, $b) {
        return $a/$b ;
    }

	// ...
}
```

You will get a reponsse in the form of

```
{
	"jsonrpc":"2.0",
	"id":1,
	"result":2.2
}
```

Have fun.

Tests
-----

[](#tests)

The lib tries to be fully unit tested. Go take it for a spin, go to the lib's root directory and run `phpunit`. PHPUnit is also included in the *require-dev*s so you can get it with `composer install --dev` or `composer update`.

Contributors
------------

[](#contributors)

- [Paul Gessinger](http://paulgessinger.com)

License
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2013 Paul Gessinger

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Every ~7 days

Total

5

Last Release

4536d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1058585?v=4)[Paul Gessinger](/maintainers/paulgessinger)[@paulgessinger](https://github.com/paulgessinger)

---

Top Contributors

[![paulgessinger](https://avatars.githubusercontent.com/u/1058585?v=4)](https://github.com/paulgessinger "paulgessinger (20 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paulgessinger-jsonrpc/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M464](/packages/pimcore-pimcore)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.4M25](/packages/googleads-googleads-php-lib)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)

PHPackages © 2026

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