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(5mo ago)242MITPHPPHP &gt;=8.1

Since Jan 6Pushed 5mo 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 today

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

34

—

LowBetter than 75% of packages

Maintenance69

Regular maintenance activity

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

179d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/229570739?v=4)[Stackverify Corporation](/maintainers/stackmorgan)[@Stackmorgan](https://github.com/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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M7.0k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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