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

ActiveLibrary[API Development](/categories/api)

jschaedl/api-client
===================

A generic api client implementation to avoid writing the same boiler plate code over and over again.

0.0.1(1y ago)11.2kMITPHPPHP ~8.2||~8.3

Since Sep 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jschaedl/api-client)[ Packagist](https://packagist.org/packages/jschaedl/api-client)[ Docs](https://github.com/jschaedl/api-client)[ RSS](/packages/jschaedl-api-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (18)Versions (2)Used By (0)

api-client
==========

[](#api-client)

 [ ![ci status](https://github.com/jschaedl/api-client/actions/workflows/ci.yaml/badge.svg) ](https://github.com/jschaedl/api-client/actions) [![php-8.2%2B](https://camo.githubusercontent.com/b6d7fab037a1eee93fd0ea69e7436802ca66022c2098ddd31f54505745f1ac8d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d6c69676874626c75652e737667)](https://camo.githubusercontent.com/b6d7fab037a1eee93fd0ea69e7436802ca66022c2098ddd31f54505745f1ac8d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d6c69676874626c75652e737667) [ ![latest version](https://camo.githubusercontent.com/629c9b066513335573f0061bde236c38710f51dc0c8a9ef25f5216be483ed1cf/68747470733a2f2f706f7365722e707567782e6f72672f6a7363686165646c2f6170692d636c69656e742f762f737461626c65) ](https://packagist.org/packages/jschaedl/api-client) [ ![total downloads](https://camo.githubusercontent.com/bbcc576e420907c698053934574ee89ecf08684f118db7b5cf4f8d5f8c83eed3/68747470733a2f2f706f7365722e707567782e6f72672f6a7363686165646c2f6170692d636c69656e742f646f776e6c6f616473) ](https://packagist.org/packages/jschaedl/api-client) [![license](https://camo.githubusercontent.com/a2e945671cfa589626c63ef68db4267a7eb8b0c564390a0c003e838ec6de7f7e/68747470733a2f2f706f7365722e707567782e6f72672f6a7363686165646c2f6170692d636c69656e742f6c6963656e7365)](https://camo.githubusercontent.com/a2e945671cfa589626c63ef68db4267a7eb8b0c564390a0c003e838ec6de7f7e/68747470733a2f2f706f7365722e707567782e6f72672f6a7363686165646c2f6170692d636c69656e742f6c6963656e7365)

Are you tired of spending countless hours writing repetitive boilerplate code to create API clients? Say goodbye to the hassle and welcome `jschaedl/api-client`, the library that will help you to build robust API clients effortlessly. It provides a simple, yet powerful foundation of classes to make building API clients fun again.

Key Benefits
------------

[](#key-benefits)

**Faster Development:** With `jschaedl/api-client`, you can create API clients in minutes, thanks to the provided classes. No more wasting time on mundane tasks!

**Versatility:** `jschaedl/api-client` supports a wide range of APIs, making it a versatile solution for various projects. Whether you're working with RESTful, SOAP, or GraphQL APIs, it got you covered.

**Customization:** Tailor API clients to your specific needs with ease. `jschaedl/api-client` provides a flexible framework that allows developers to customize requests, responses, and error handling effortlessly.

**Standards:** `jschaedl/api-client` follows PSR-7 (HTTP message interfaces), PSR-17 (HTTP factoring interfaces), and PSR-18 (HTTP client interfaces) to ensure compatibility and interoperability with industry-approved practices.

When you should use this library?
---------------------------------

[](#when-you-should-use-this-library)

**No Existing SDK:** When there's no SDK available for the API you want to consume, and you find yourself needing to implement an API client from scratch, `jschaedl/api-client` is your go-to solution.

**Selective Endpoint Calls:** In cases where there is an SDK for the API you want to consume, but you only require specific endpoints and don't want to deal with the overhead of the entire bloated SDK, `jschaedl/api-client` steps in.

**Avoiding 3rd Party SDK Dependencies:** Tired of integrating 3rd party SDKs that bring along a cascade of dependencies? Opt for `jschaedl/api-client` to sidestep the hassle.

---

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

[](#installation)

To install `jschaedl/api-client` via composer use

```
composer require jschaedl/api-client
```

---

Examples
--------

[](#examples)

...

Features
--------

[](#features)

### Client

[](#client)

### GenericRequest and Response

[](#genericrequest-and-response)

### Request and Response Handlers

[](#request-and-response-handlers)

### Request/Response Body Encoder/Decoder

[](#requestresponse-body-encoderdecoder)

### Custom Requests and Responses

[](#custom-requests-and-responses)

### RetryClient

[](#retryclient)

### Testing with Mocks

[](#testing-with-mocks)

---

FAQ
---

[](#faq)

**How can I add custom headers to requests?**

...

**How can I send authentication information along with a request?**

...

**How can use a Client in my tests?**

...

---

Author
------

[](#author)

[Jan Schädlich](http://janschaedlich.de)

[Contributors](https://github.com/jschaedl/api-client/graphs/contributors)

---

How to Contribute
-----------------

[](#how-to-contribute)

Please read our [contributing guidelines](/CONTRIBUTING.md).

---

License
-------

[](#license)

MIT License

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

610d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8acaabe0e1615dfef9df61eeb41cba71b3094686eabb0156bb83706f5f8db0a1?d=identicon)[jschaedl](/maintainers/jschaedl)

---

Top Contributors

[![jschaedl](https://avatars.githubusercontent.com/u/1880467?v=4)](https://github.com/jschaedl "jschaedl (10 commits)")

---

Tags

phpapiclientgeneric

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[openai-php/symfony

Symfony Bundle for OpenAI

215715.5k3](/packages/openai-php-symfony)[gemini-api-php/client

API client for Google's Gemini API

216221.4k5](/packages/gemini-api-php-client)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[gemini-api-php/laravel

Gemini API client for Laravel

8915.7k](/packages/gemini-api-php-laravel)[google-gemini-php/symfony

Symfony Bundle for Gemini

149.4k1](/packages/google-gemini-php-symfony)

PHPackages © 2026

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