PHPackages                             hubgit/web-resource - 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. hubgit/web-resource

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

hubgit/web-resource
===================

A PHP interface for fetching HTTP resources from the web

v0.4(9y ago)0251[1 issues](https://github.com/hubgit/web-resource-php/issues)MITPHPPHP &gt;=5.5

Since Jan 9Pushed 9y agoCompare

[ Source](https://github.com/hubgit/web-resource-php)[ Packagist](https://packagist.org/packages/hubgit/web-resource)[ RSS](/packages/hubgit-web-resource/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Composer
--------

[](#composer)

```
composer require hubgit/web-resource
```

Usage
-----

[](#usage)

See [examples](https://github.com/hubgit/web-resource-php/tree/master/examples).

### Fetch a single resource

[](#fetch-a-single-resource)

```
use WebResource\Resource;

$resource = new Resource('https://api.spotify.com/v1/artists/0gusqTJKxtU1UTmNRMHZcv');

$artist = $resource->get(); // `$artist` is an array
```

### Fetch a paginated collection

[](#fetch-a-paginated-collection)

```
use WebResource\Collection;

$collection = new Collection('https://api.github.com/users/hubgit/repos');

foreach ($collection as $repo) {
  // do something with the `$repo` array
}
```

### Fetch a paginated collection with custom processing and pagination

[](#fetch-a-paginated-collection-with-custom-processing-and-pagination)

```
use WebResource\Collection;

class SpotifyCollection extends Collection {
  // find the array of items in the JSON response
  protected function items($data, $response) {
    return $data['items'];
  }

  // find the URL of the next page in the JSON response
  protected function next($data, $response) {
    return isset($data['next']) ? $data['next'] : null;
  }
}

// first parameter is a URL, second parameter is an array of query parameters
$collection = new SpotifyCollection('https://api.spotify.com/v1/artists/0gusqTJKxtU1UTmNRMHZcv/albums', [
  'album_type' => 'single',
]);

foreach ($collection as $album) {
  // do something with the `$album` array
}
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

3451d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3925067?v=4)[Ashley Eaton](/maintainers/aeaton)[@aeaton](https://github.com/aeaton)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/hubgit-web-resource/health.svg)

```
[![Health](https://phpackages.com/badges/hubgit-web-resource/health.svg)](https://phpackages.com/packages/hubgit-web-resource)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k34](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.0k38](/packages/dreamfactory-df-core)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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