PHPackages                             yggverse/scrapeer - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. yggverse/scrapeer

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

yggverse/scrapeer
=================

Essential PHP library that scrapes HTTP(S) and UDP trackers for torrent information

0.5.4(2y ago)0421CC-BY-SA-3.0PHP

Since Oct 9Pushed 2y agoCompare

[ Source](https://github.com/YGGverse/scrapeer)[ Packagist](https://packagist.org/packages/yggverse/scrapeer)[ RSS](/packages/yggverse-scrapeer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (1)

Scrapeer
========

[](#scrapeer)

Essential PHP library that scrapes HTTP(S) and UDP trackers for torrent information.

[![scrapeer image](https://camo.githubusercontent.com/8226938ce6fccd124a157639476787847d8918284e1a6597e652a70d09930df2/68747470733a2f2f692e696d6775722e636f6d2f48594746426c672e6a7067)](https://camo.githubusercontent.com/8226938ce6fccd124a157639476787847d8918284e1a6597e652a70d09930df2/68747470733a2f2f692e696d6775722e636f6d2f48594746426c672e6a7067)

*Original image by [@alinnnaaaa](https://unsplash.com/photos/ZiQkhI7417A).*

Features
========

[](#features)

- Retrieves seeders, leechers and completed torrent information
- Supports HTTP, HTTPS and UDP trackers
- Automatically discards invalid trackers and info-hashes
- Allows setting timeout per tracker and max. number of trackers
- Supports up to 64 info-hashes per scrape
- Aims to be as lightweight, straightforward and efficient as possible
- Supports scraping via scrape (default) and announce requests ✨

Note
====

[](#note)

This is the only official source for Scrapeer. Other repositories — e.g. the ones on Packagist — are unofficial and should be avoided!

Basic usage examples
====================

[](#basic-usage-examples)

### Single info-hash and single tracker:

[](#single-info-hash-and-single-tracker)

```
require 'scraper.php';

$scraper = new Scrapeer\Scraper();

$tracker = array( 'udp://tracker.coppersurfer.tk:6969/announce' );
$hash = array( '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hash, $tracker );
print_r( $info );
```

```
Array ( ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 88 ["completed"] => 7737 ["leechers"] => 6 ) )
```

- If not specified, the port will default to 80 for HTTP/UDP and to 443 for HTTPS.
- Single elements may also be strings instead of arrays.

### Single info-hash and multiple trackers (recommended usage):

[](#single-info-hash-and-multiple-trackers-recommended-usage)

```
$trackers = array( 'http://www.opentrackr.org/announce', 'udp://tracker.coppersurfer.tk:6969/announce' );
$hash = array( '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hash, $trackers );
print_r( $info );
```

```
Array ( ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 59 ["completed"] => 83 ["leechers"] => 3 ) )
```

- First tracker in the array will be used, if it fails (invalid tracker, invalid info-hash or invalid info-hash for that tracker) the second tracker will be used and so on.
- In this case we get a valid result from the first tracker, notice that we get different information for the same torrent - this is to be expected, as different trackers may be more or less up-to-date than others.

### Multiple info-hashes and single tracker:

[](#multiple-info-hashes-and-single-tracker)

```
$tracker = array( 'http://tracker.internetwarriors.net:1337/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hashes, $tracker );
print_r( $info );
```

```
Array ( ["699cda895af6fbd5a817fff4fe6fa8ab87e36f48"] => Array ( ["seeders"] => 4 ["completed"] => 236 ["leechers"] => 0 ) ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 7 ["completed"] => 946 ["leechers"] => 3 ) )
```

- Info-hashes can be upper or lower case.

### Multiple info-hashes and multiple trackers:

[](#multiple-info-hashes-and-multiple-trackers)

```
$trackers = array( 'udp://tracker.coppersurfer.tk:6969/announce', 'http://explodie.org:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hashes, $trackers );
print_r( $info );
```

```
Array ( ["699cda895af6fbd5a817fff4fe6fa8ab87e36f48"] => Array ( ["seeders"] => 52 ["completed"] => 2509 ["leechers"] => 1 ) ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 97 ["completed"] => 7751 ["leechers"] => 11 ) )
```

Advanced usage examples
=======================

[](#advanced-usage-examples)

Error logging
-------------

[](#error-logging)

```
$trackers = array( 'http://invalidtracker:6767/announce', 'udp://tracker.coppersurfer.tk:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hashes, $trackers );

print_r( $info );

// Check if we have any errors.
if ( $scraper->has_errors() ) {
	// Get the errors and print them.
	print_r( $scraper->get_errors() );
}
```

```
Array ( ["699cda895af6fbd5a817fff4fe6fa8ab87e36f48"] => Array ( ["seeders"] => 49 ["completed"] => 2509 ["leechers"] => 1 ) ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 99 ["completed"] => 7754 ["leechers"] => 7 ) ) Array ( [0] => "Invalid scrape connection (invalidtracker:6767)." )
```

- The first tracker is not valid, it will be skipped and an error will be added to the error logger.
- The scraper keeps scraping until one valid tracker is found or there are no more trackers to try.
- Invalid info-hashes will be logged and skipped.

Advanced options
----------------

[](#advanced-options)

### Maximum trackers

[](#maximum-trackers)

```
$trackers = array( 'http://invalidtracker:6767/announce', 'udp://tracker.coppersurfer.tk:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

// The max. amount of trackers to try is 1.
$info = $scraper->scrape( $hashes, $trackers, 1 );
```

- The scraper will stop after the first tracker, regardless of its validity.
- Default: All trackers in the array.

### Timeout per tracker

[](#timeout-per-tracker)

```
$trackers = array( 'http://invalidtracker:6767/announce', 'udp://tracker.coppersurfer.tk:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

// The max. amount of trackers to try is 2 and timeout per tracker is 3s.
$info = $scraper->scrape( $hashes, $trackers, 2, 3 );
```

- Each tracker will have a timeout of 3 seconds (total timeout in this case would be 6 seconds).
- Default: 2 seconds (recommended).

### Announce scraping

[](#announce-scraping)

```
$trackers = array( 'udp://tracker.opentrackr.org:1337/announce', 'http://explodie.org:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hashes, $trackers, 2, 3, true );
```

- Default: false.
- Prefer scrape over announce requests for multiple info-hashes (usually faster).
- *Note:* UDP trackers only return seeders and leechers information. This is a [protocol limitation](http://www.bittorrent.org/beps/bep_0015.html).

FAQs
====

[](#faqs)

- What are info-hashes? How do I get them?

From [The BitTorrent Protocol Specification](http://www.bittorrent.org/beps/bep_0003.html):

> The 20 byte sha1 hash of the bencoded form of the info value from the metainfo file. Note that this is a substring of the metainfo file. The info-hash must be the hash of the encoded form as found in the .torrent file, regardless of it being invalid. This value will almost certainly have to be escaped.

There are many ways to retrieve the info-hashes from your torrents, a PHP based solution would be [torrent-bencode](https://github.com/bhutanio/torrent-bencode) for example.

- I need public trackers! Where can I find some?

Check out [newTrackon](https://newtrackon.com/) and [trackerslist](https://github.com/ngosang/trackerslist/blob/master/trackers_all.txt).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 96% 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

950d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67b0f652ebac064d26ca06ba5fd4271fab0ac5482d6c2d4865b8f3697721bc31?d=identicon)[d47081](/maintainers/d47081)

![](https://www.gravatar.com/avatar/d4eafa818f51a43c026ee538ac36192684eef5e128e1eac8d622b74d1bfd4de4?d=identicon)[YGGverse](/maintainers/YGGverse)

---

Top Contributors

[![medariox](https://avatars.githubusercontent.com/u/2893509?v=4)](https://github.com/medariox "medariox (48 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")[![psociety](https://avatars.githubusercontent.com/u/29523682?v=4)](https://github.com/psociety "psociety (1 commits)")

---

Tags

announcebittorrentcomposerlibraryparserphpscrapescrapeerscrapertorrenttracker

### Embed Badge

![Health badge](/badges/yggverse-scrapeer/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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