PHPackages                             fullpipe/php-json-rpc-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. fullpipe/php-json-rpc-client

ActiveLibrary[API Development](/categories/api)

fullpipe/php-json-rpc-client
============================

JSON-RPC 2.0 client

v1.0.0(5y ago)090MITPHPPHP ^7.2 || ^8.0CI failing

Since Feb 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/fullpipe/php-json-rpc-client)[ Packagist](https://packagist.org/packages/fullpipe/php-json-rpc-client)[ RSS](/packages/fullpipe-php-json-rpc-client/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

JSON-RPC 2.0 PHP client
=======================

[](#json-rpc-20-php-client)

Install
-------

[](#install)

```
composer require fullpipe/php-json-rpc-client

```

Usage
-----

[](#usage)

```
use Fullpipe\RpcClient\Client;
use Fullpipe\RpcClient\Error\AppError;
use Fullpipe\RpcClient\Error\MethodNotFound;
use Fullpipe\RpcClient\Error\InvalidParams;
...

$client = new Client('https://api.server/rpc', [
    'retries' => 0,
    'delay' => 500,
    'http' => ['timeout' => 1],
]);

// Simple call
$userData = $client->call('user.get', ['id' => 123]);

// Simple call with single retry
$userData = $client->retryOnce()->call('user.get', ['id' => 123]);

// Call and catch application error
try {
    $userData = $client->call('user.get', ['id' => 123]);
} catch (AppError $e) {
    if ($e->getCode() !== 404) {
        throw $e;
    }

    $userData = $this->createNewUser();
} catch (MethodNotFound | InvalidParams $e) {
    $this->sentry->catchException($e);
}
```

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

[](#configuration)

### Default

[](#default)

By default retries disabled. And CurlHandler used as handler for guzzle.

```
[
    'retries' => 0,
    'retryCodes' => [500, 502, 503],
    'delay' => 500,
    'http' => ['timeout' => 1], // options for CurlHandler
]
```

### Custom handler

[](#custom-handler)

You could use you own handler. For tests for example.

```
use GuzzleHttp\Handler\MockHandler;
...

$handler = new MockHandler([
    new Response(200, [], \json_encode([
        'jsonrpc' => '2.0',
        'result' => 'foo',
        'id' => 1,
    ])),
]);

$client = new Client('https://api.server/rpc', [
    'handler' => $handler
]);
```

### Retry codes

[](#retry-codes)

You could overwrite retryCode to retry on RPC errors

```
[
    'retries' => 1,
    'retryCodes' => [500, 502, 503, -32603],
]

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Total

2

Last Release

1947d ago

Major Versions

v0.0.1 → v1.0.02021-01-17

PHP version history (2 changes)v0.0.1PHP ^7.2

v1.0.0PHP ^7.2 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![fullpipe](https://avatars.githubusercontent.com/u/929659?v=4)](https://github.com/fullpipe "fullpipe (16 commits)")

---

Tags

json-rpcjson-rpc-client

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fullpipe-php-json-rpc-client/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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