PHPackages                             balpom/universal-downloader - 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. balpom/universal-downloader

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

balpom/universal-downloader
===========================

Downloads the contents of the specified URI (or file).

v1.4.1(2y ago)0371MITPHPPHP &gt;=8.1

Since May 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/balpom/universal-downloader)[ Packagist](https://packagist.org/packages/balpom/universal-downloader)[ Docs](https://www.balpom.ru)[ RSS](/packages/balpom-universal-downloader/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (6)Versions (8)Used By (1)

balpom/universal-downloader
===========================

[](#balpomuniversal-downloader)

Simple interfaces for content downloading on the specified URI (or file location) and it's trivial realisations.
----------------------------------------------------------------------------------------------------------------

[](#simple-interfaces-for-content-downloading-on-the-specified-uri-or-file-location-and-its-trivial-realisations)

This downloader will be useful for websites parsing, working with the REST API and other work with WEB resources via the HTTP protocol. This version of the package contains an interface implementation for use with any PSR-18 HTTP clients. It is planned to make an implementation that works through [Selenium WebDriver](https://github.com/php-webdriver/php-webdriver).

### Requirements

[](#requirements)

- **PHP &gt;= 8.1**

### Installation

[](#installation)

#### Using composer (recommended)

[](#using-composer-recommended)

```
composer require balpom/universal-downloader
```

### Simple downloader usage sample

[](#simple-downloader-usage-sample)

```
$downloader = new \Balpom\UniversalDownloader\SimpleDownloader();
$downloader = $downloader->get('https://ipmy.ru/ip');
echo $downloader->content() . PHP_EOL; // Must be your IP.
```

### PSR18 downloader usage sample

[](#psr18-downloader-usage-sample)

PSR18 downloader requires objects that implement the ResponseFactoryInterface, StreamFactoryInterface and UriFactoryInterface interfaces which defined in the [PSR-17 specification](https://www.php-fig.org/psr/psr-17/). An excellent library that implements all these interfaces at once (all-in-one) is [Nyholm/psr7](https://github.com/Nyholm/psr7) - will use it.

PSR18 downloader realisation also requires an HTTP client that implements the ClientInterface which defined in the [PSR-18 specification](https://www.php-fig.org/psr/psr-18/). For example, will use [phpwebclient/webclient](https://github.com/phpwebclient/webclient) and [guzzle/guzzle](https://github.com/guzzle/guzzle).

#### Installing third-party packages

[](#installing-third-party-packages)

```
composer require nyholm/psr7
```

```
composer require webclient/webclient
```

```
composer require guzzlehttp/guzzle
```

#### Downloader creation based on Webclient.

[](#downloader-creation-based-on-webclient)

```
$factory = new \Nyholm\Psr7\Factory\Psr17Factory();
$client = new \Webclient\Http\Webclient($factory, $factory);
// Psr17Factories(RequestFactoryInterface $request, StreamFactoryInterface $stream, UriFactoryInterface $uri)
$factories = new \Balpom\UniversalDownloader\Factory\Psr17Factories($factory, $factory, $factory, $factory);
$downloader = new \Balpom\UniversalDownloader\Downloader($client, $factories);
```

#### Downloader creation based on GuzzleHttp.

[](#downloader-creation-based-on-guzzlehttp)

```
$client = new \GuzzleHttp\Client();
$factory = new \Nyholm\Psr7\Factory\Psr17Factory();
$factories = new \Balpom\Downloader\Factory\Psr17Factories($factory, $factory, $factory, $factory);
// In my realisation Psr17Factory factories required.
// You may make your own realisation, bases on GuzzleHttp options (it has own Psr17Factory).
$downloader = new \Balpom\UniversalDownloader\Downloader($client, $factories);
```

#### Download URI

[](#download-uri)

For test purpose will make request to site .

```
$downloader = $downloader->get('http://ipmy.ru/ip');
$result = $downloader->result();
echo $result->code(); echo PHP_EOL; // Must be 200.
echo $result->content(); echo PHP_EOL; // Must be your IP.
echo $result->mime(); echo PHP_EOL; // Must be "text/html".
```

Extended sample you may find in "tests/test-psr18.php" file - just run it:

```
php tests/test-psr18.php
```

### License

[](#license)

MIT License See [LICENSE.MD](LICENSE.MD)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

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

Total

7

Last Release

766d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/141855513?v=4)[Mikhail](/maintainers/balpom)[@balpom](https://github.com/balpom)

---

Top Contributors

[![balpom](https://avatars.githubusercontent.com/u/141855513?v=4)](https://github.com/balpom "balpom (18 commits)")

---

Tags

httpurlurihttpsclientwebhttp clientpsr-18filecontentdownloadsitedownloaderpsr18https-client

### Embed Badge

![Health badge](/badges/balpom-universal-downloader/health.svg)

```
[![Health](https://phpackages.com/badges/balpom-universal-downloader/health.svg)](https://phpackages.com/packages/balpom-universal-downloader)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

185702.8k44](/packages/laudis-neo4j-php-client)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28150.5k](/packages/phpro-http-tools)

PHPackages © 2026

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