PHPackages                             rem42/scraper - 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. [API Development](/categories/api)
4. /
5. rem42/scraper

ActiveLibrary[API Development](/categories/api)

rem42/scraper
=============

API Scraper website

v3.2.0(2y ago)54.3k[1 issues](https://github.com/rem42/scraper/issues)[4 PRs](https://github.com/rem42/scraper/pulls)19MITPHPPHP ^8.1CI passing

Since Aug 28Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/rem42/scraper)[ Packagist](https://packagist.org/packages/rem42/scraper)[ RSS](/packages/rem42-scraper/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (5)Versions (37)Used By (19)

Scraper
=======

[](#scraper)

Lightweight toolbox to build reusable "scrapers":

- Declare a Request class annotated with the PHP attribute `#[Scraper(...)]`.
- Provide the corresponding Api class (replace "Request" with "Api" in the name) which extends `\Scraper\Scraper\Api\AbstractApi` and implements `execute()`.
- Use `\Scraper\Scraper\Client` with an `HttpClientInterface` to execute the request and retrieve the deserialized object.

Badges
------

[](#badges)

[![Packagist version](https://camo.githubusercontent.com/576c201d6400ef7ddfd876369dbaf2636f4617a58ce65b16e9293a181594b0b5/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f72656d34322f73637261706572)](https://camo.githubusercontent.com/576c201d6400ef7ddfd876369dbaf2636f4617a58ce65b16e9293a181594b0b5/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f72656d34322f73637261706572)[![Packagist download](https://camo.githubusercontent.com/2945316ff7d80204b3c971b6ee46b9c5f97fd4b264c10d8930199b6134a49ece/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f72656d34322f73637261706572)](https://camo.githubusercontent.com/2945316ff7d80204b3c971b6ee46b9c5f97fd4b264c10d8930199b6134a49ece/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f72656d34322f73637261706572)[![Packagist php version](https://camo.githubusercontent.com/9cd34259a5e3d4466778ef9300c62ae10b3596bbf7cda51061f9931ef065bfb7/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f7068702f72656d34322f73637261706572)](https://camo.githubusercontent.com/9cd34259a5e3d4466778ef9300c62ae10b3596bbf7cda51061f9931ef065bfb7/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f7068702f72656d34322f73637261706572)[![Github licence](https://camo.githubusercontent.com/842e9499f984398077d67f3dd28b671014b614af7cf7c422d898e560782e97a8/68747470733a2f2f666c61742e62616467656e2e6e65742f6769746875622f6c6963656e73652f72656d34322f73637261706572)](https://camo.githubusercontent.com/842e9499f984398077d67f3dd28b671014b614af7cf7c422d898e560782e97a8/68747470733a2f2f666c61742e62616467656e2e6e65742f6769746875622f6c6963656e73652f72656d34322f73637261706572)

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

[](#installation)

```
composer require rem42/scraper "^3.0"
```

Short introduction
------------------

[](#short-introduction)

The package centralizes the following logic:

1. A Request (under `src/Request/`) defines the necessary data and exposes getters used in path variables.
2. The attribute `#[\Scraper\Scraper\Attribute\Scraper(...)]` (on the Request) describes `method`, `scheme`, `host`, `path`.
3. `\Scraper\Scraper\Client::send()` reads this attribute (via `ExtractAttribute`), builds the HTTP options (headers, query, body, json, auth) according to the interfaces implemented by the Request, then performs the HTTP call.
4. The matching Api class (eg: `FooApi`) is instantiated and its `execute()` method returns the final object/array/string.

Quickstart (minimal example)
----------------------------

[](#quickstart-minimal-example)

Schematic example (adapt according to your autoload/imports). Examples use `use` imports:

```
use Symfony\Component\HttpClient\HttpClient;
use Scraper\Scraper\Client;
use Scraper\Scraper\Request\ScraperRequest;
use Scraper\Scraper\Attribute\Scraper;
use Scraper\Scraper\Attribute\Method;
use Scraper\Scraper\Attribute\Scheme;
use Scraper\Scraper\Api\AbstractApi;

#[Scraper(
	method: Method::GET,
	scheme: Scheme::HTTPS,
	host: 'example.com',
	path: '/items/{id}'
)]
class ItemRequest extends ScraperRequest
{
	public function __construct(private string $id) {}
	public function getId(): string { return $this->id; }
}

// Provide a matching Api: ItemApi extends AbstractApi

$http = HttpClient::create();
$client = new Client($http);
$result = $client->send(new ItemRequest('42'));
```

Important conventions
---------------------

[](#important-conventions)

- PSR-4 root namespace: `Scraper\\Scraper\\` -&gt; `src/` (see `composer.json`).
- Naming convention: `XRequest` -&gt; `XApi` (Client performs this replacement automatically using reflection).
- In the `path` attribute, variables `{name}` are replaced by calling `getName()` on the Request instance (see `src/Attribute/ExtractAttribute.php`).
- Implement the interfaces in `src/Request/` to enable options: `RequestHeaders`, `RequestQuery`, `RequestBody`, `RequestBodyJson`, `RequestAuthBearer`, `RequestAuthBasic`.

Tests / quality / style
-----------------------

[](#tests--quality--style)

- Run unit tests:

```
composer run unit-test
# or
./vendor/bin/phpunit
```

- Static analysis (phpstan):

```
composer run static-analysis
```

- Check / apply coding style (php-cs-fixer):

```
composer run code-style-check
composer run code-style-fix
```

PHP compatibility
-----------------

[](#php-compatibility)

`composer.json` requires `php: ^8.4` — the code uses enums and recent types, so PHP 8.4+ is recommended.

Resources and documentation for agents
--------------------------------------

[](#resources-and-documentation-for-agents)

- Agent helper file: `AGENTS.md` (tips, patterns, commands). See `packages/scraper/AGENTS.md`.
- Key code points: `src/Client.php`, `src/Attribute/ExtractAttribute.php`, `src/Factory/SerializerFactory.php`.

Non-exhaustive list of published scrapers
-----------------------------------------

[](#non-exhaustive-list-of-published-scrapers)

- rem42/scraper-allocine
- rem42/scraper-colissimo
- rem42/scraper-deezer
- rem42/scraper-giantbomb
- rem42/scraper-jeuxvideo
- rem42/scraper-prestashop
- rem42/scraper-shopify
- rem42/scraper-tmdb
- rem42/scraper-tnt

Contributing
------------

[](#contributing)

See `AGENTS.md` for rules and patterns to follow. For PRs: green tests + highest phpstan level.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance52

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 91.5% 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 ~70 days

Recently: every ~83 days

Total

31

Last Release

758d ago

Major Versions

v1.0.9 → v2.0-beta.12020-04-11

v1.0.10 → v2.0-beta.32020-05-13

v1.0.11 → v2.0-beta.42021-02-17

v2.2 → 3.x-dev2022-10-28

PHP version history (4 changes)v1.0PHP &gt;=5.5.9

v2.0-beta.1PHP ^7.4

v2.1PHP ^7.4|^8.0

3.x-devPHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/502da95a8b38571cd9cb4a4781e265335e1070c69c28a39454f91612c9145844?d=identicon)[rem42](/maintainers/rem42)

---

Top Contributors

[![rem42](https://avatars.githubusercontent.com/u/1371193?v=4)](https://github.com/rem42 "rem42 (54 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (3 commits)")[![deepsourcebot](https://avatars.githubusercontent.com/u/60907429?v=4)](https://github.com/deepsourcebot "deepsourcebot (1 commits)")[![mend-bolt-for-github[bot]](https://avatars.githubusercontent.com/in/16809?v=4)](https://github.com/mend-bolt-for-github[bot] "mend-bolt-for-github[bot] (1 commits)")

---

Tags

phpscraper

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rem42-scraper/health.svg)

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

###  Alternatives

[symfony/http-client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

2.0k338.8M5.0k](/packages/symfony-http-client)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[bitrix24/b24phpsdk

An official PHP library for the Bitrix24 REST API

10244.2k5](/packages/bitrix24-b24phpsdk)

PHPackages © 2026

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