PHPackages                             edgetelemetrics/fetch - 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. edgetelemetrics/fetch

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

edgetelemetrics/fetch
=====================

Async PHP implementation of the Javascript FetchAPI

v0.1.0(5mo ago)00MITPHP

Since Nov 25Pushed 5mo agoCompare

[ Source](https://github.com/lucasnetau/php-fetch)[ Packagist](https://packagist.org/packages/edgetelemetrics/fetch)[ RSS](/packages/edgetelemetrics-fetch/feed)WikiDiscussions main Synced 1mo ago

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

PHP Fetch
=========

[](#php-fetch)

Implementation of the Javascript fetch() API

Features
--------

[](#features)

Supports HTTP/2+3, connection pooling (with keep-alive), and the extraction of timing data for the requests.

Requirements
------------

[](#requirements)

The package is compatible with PHP 8.2+ and requires the cURL extension and [edgetelemetrics/reactphp-http-browser-curl](https://github.com/lucasnetau/reactphp-http-browser-curl) library.

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

[](#installation)

You can add the library as a project dependency using [Composer](https://getcomposer.org/):

```
composer require edgetelemetrics/fetch
```

Examples
--------

[](#examples)

See [/examples](/examples) directory. Examples based on examples from reactphp/http under MIT License

Timing
------

[](#timing)

Request timing values are returned in the PSR7 Response object headers under the key [Server-Timing](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing)

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

[](#configuration)

The Browser can be configured with standard CURLOPT\_\* parameters given via the constructor.

```
fetch(
    $uri,
    [
        'curlOpts' => [
            CURLOPT_TIMEOUT => 20,
            CURLOPT_DOH_URL, 'https://1.1.1.1/dns-query',
            CURLOPT_DNS_SERVERS => '1.1.1.1',
        ],
    ]);
```

Connection Metadata
-------------------

[](#connection-metadata)

### Connection Timing

[](#connection-timing)

The request/response timing is provided though the header '`ServerTiming`' in the Response object.

Each timing point is defined as `;dur=`

- namelookup\_time
- connect\_time
- appconnect\_time
- pretransfer\_time
- redirect\_time
- starttransfer\_time
- total\_time

### Connection Details

[](#connection-details)

Additional request/response metadata is provided though the header '`X-Connection`' in the Response object.

Key/Value pairs are as follows:

- effective\_url=``
- connection;count=``
- redirect;count=``
- upload;size=``;speed=``
- download;size=``;speed=``

Synchronous Use
---------------

[](#synchronous-use)

This library can be used in synchronous mode using react\\async.

See [Synchronous Client Example](/examples/30-client-sync-get-request.php)

License
-------

[](#license)

MIT, see [LICENSE file](LICENSE).

### Contributing

[](#contributing)

Bug reports (and small patches) can be submitted via the [issue tracker](https://github.com/lucasnetau/php-fetch/issues). Forking the repository and submitting a Pull Request is preferred for substantial patches.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance70

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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

175d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83ab22a74b2d8a4cbb5b9774d999c409cc355d1d0d948f5f9ee4d1fe0299de62?d=identicon)[lucasnetau](/maintainers/lucasnetau)

---

Top Contributors

[![lucasnetau](https://avatars.githubusercontent.com/u/9331242?v=4)](https://github.com/lucasnetau "lucasnetau (1 commits)")

---

Tags

httpasynccurlfetch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/edgetelemetrics-fetch/health.svg)

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

###  Alternatives

[rmccue/requests

A HTTP library written in PHP, for human beings.

3.6k34.5M258](/packages/rmccue-requests)[nategood/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

1.8k17.2M267](/packages/nategood-httpful)[react/http

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

78126.4M414](/packages/react-http)[mashape/unirest-php

Unirest PHP

1.3k9.7M161](/packages/mashape-unirest-php)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48247.0M384](/packages/php-http-curl-client)[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k4.5M81](/packages/amphp-http-server)

PHPackages © 2026

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