PHPackages                             frost-bit-star/kyphp - 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. frost-bit-star/kyphp

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

frost-bit-star/kyphp
====================

Ky-style minimal and fast PHP HTTP client with async batch support, hooks, retries, and JSON handling.

1.1.0(4mo ago)231MITPHPPHP &gt;=8.1

Since Jan 6Pushed 4mo agoCompare

[ Source](https://github.com/Frost-bit-star/KyPHP)[ Packagist](https://packagist.org/packages/frost-bit-star/kyphp)[ RSS](/packages/frost-bit-star-kyphp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

### KyPHP

[](#kyphp)

KyPHP is a minimal, fast, and chainable PHP HTTP client inspired by Ky from the JavaScript ecosystem.

**It supports:**

- Chainable API for GET/POST requests
- Automatic JSON handling (sendJson())
- Query string builder
- Request hooks (beforeRequest / afterResponse)
- Retry logic
- Async batch requests (sendBatch())
- Clean error handling
- All native PHP, no external dependencies required (just cURL).

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

[](#installation)

**Install via Composer:**

```
composer require frost-bit-star/kyphp

```

**Autoload in your project:**

```
require 'vendor/autoload.php';

use KyPHP\KyPHP;

```

Usage
-----

[](#usage)

Basic GET request

```
$ky = new KyPHP();

$response = $ky->get('https://api.example.com/data')
               ->header('Accept', 'application/json')
               ->send();

print_r($response);

GET with query parameters
$response = $ky->get('https://api.example.com/users')
               ->query(['page' => 1, 'limit' => 10])
               ->sendJson();

print_r($response);

POST JSON request
$response = $ky->post('https://api.example.com/users')
               ->json(['name' => 'John', 'email' => 'john@example.com'])
               ->sendJson();

print_r($response);

Retry logic
$response = $ky->get('https://unstable-api.com/data')
               ->retry(3) // Retry 3 times if fails
               ->sendJson();

```

Hooks
-----

[](#hooks)

```
$ky->beforeRequest(function($request) {
    echo "Sending request to {$request->url}\n";
})->afterResponse(function($response) {
    echo "Received HTTP status {$response['status']}\n";
});

Async Batch Requests
$req1 = (new KyPHP())->get('https://api.example.com/data1')->addToBatch();
$req2 = (new KyPHP())->get('https://api.example.com/data2')->addToBatch();

$responses = KyPHP::sendBatchJson();

print_r($responses);

```

Features
--------

[](#features)

**Chainable API: get()-&gt;post()-&gt;header()-&gt;query()-&gt;json()**

- Automatic JSON decoding: sendJson()
- Query builder: Simplify GET query params

**Hooks: Before and after request hooks for logging or modification**

- Retry: Automatic retries for failed requests
- Async batch requests: Send multiple requests concurrently
- Minimal and fast: Pure PHP using cURL

**Example Project Structure**

```
kyphp/
├── composer.json
├── src/
│   └── KyPHP.php
└── README.md

```

License

MIT © morgan miller

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance76

Regular maintenance activity

Popularity7

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

Every ~0 days

Total

2

Last Release

132d ago

### Community

Maintainers

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

---

Top Contributors

[![Frost-bit-star](https://avatars.githubusercontent.com/u/174954462?v=4)](https://github.com/Frost-bit-star "Frost-bit-star (5 commits)")

---

Tags

http-clienthttp-requestsphpphp-fast-httpphp-http-clientphp-librarytinytiny-http

### Embed Badge

![Health badge](/badges/frost-bit-star-kyphp/health.svg)

```
[![Health](https://phpackages.com/badges/frost-bit-star-kyphp/health.svg)](https://phpackages.com/packages/frost-bit-star-kyphp)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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