PHPackages                             hooshid/rottentomatoes-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. hooshid/rottentomatoes-scraper

ActiveLibrary[API Development](/categories/api)

hooshid/rottentomatoes-scraper
==============================

Library for retrieving movie, tv information from rottentomatoes.com

3.0.1(7mo ago)64141MITPHPPHP &gt;=8.0CI passing

Since Apr 19Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/hooshid/rottentomatoes-scraper)[ Packagist](https://packagist.org/packages/hooshid/rottentomatoes-scraper)[ Docs](https://github.com/hooshid/rottentomatoes-scraper)[ RSS](/packages/hooshid-rottentomatoes-scraper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (29)Used By (0)

Rottentomatoes Scraper
======================

[](#rottentomatoes-scraper)

[![Build Status](https://github.com/hooshid/rottentomatoes-scraper/actions/workflows/tests.yml/badge.svg)](https://github.com/hooshid/rottentomatoes-scraper/actions)[![Total Downloads](https://camo.githubusercontent.com/385a7a0ddffaa8869af2a7dc499f42336f777c6ea28d7300ba2c28c685e06aad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f686f6f736869642f726f7474656e746f6d61746f65732d73637261706572)](https://packagist.org/packages/hooshid/rottentomatoes-scraper)[![Latest Stable Version](https://camo.githubusercontent.com/59b17db0c4292a7318a82f6d3a1fc4a5ea12ea7c7b9bcc52c602bb5ffc4a1546/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686f6f736869642f726f7474656e746f6d61746f65732d73637261706572)](https://packagist.org/packages/hooshid/rottentomatoes-scraper)[![License](https://camo.githubusercontent.com/f885cc334d87398a4642893ca27f463b18e4766954b6c80c5057565543d6aa75/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f686f6f736869642f726f7474656e746f6d61746f65732d73637261706572)](LICENSE.md)

Using this Rottentomatoes API, you are able to search, browse and extract data of Movies, Series on rottentomatoes.com.

Install
-------

[](#install)

This library scrapes rottentomatoes.com so changes their site can cause parts of this library to fail. You will probably need to update a few times a year.

### Requirements

[](#requirements)

- PHP &gt;= 8.0
- PHP cURL extension

### Install via composer

[](#install-via-composer)

```
$ composer require hooshid/rottentomatoes-scraper
```

Run examples
------------

[](#run-examples)

The example gives you a quick demo to make sure everything's working, some sample code and lets you easily see some available data.

From the example folder in the root of this repository start up php's inbuilt webserver and browse to http://localhost:8000/example

`php -S localhost:8000`

Examples
--------

[](#examples)

### Get movie/series data

[](#get-movieseries-data)

#### Movie: The Matrix (1999) / URL:

[](#movie-the-matrix-1999--url-httpswwwrottentomatoescommmatrix)

```
$rottentomatoes = new Hooshid\RottentomatoesScraper\Rottentomatoes();
$extract = $rottentomatoes->extract("/m/matrix");
$result = $extract['result'];
$error = $extract['error'];

// get all available data as json
echo json_encode($extract);
```

in above example we first create a new obj from Rottentomatoes() class, then we call extract method and give the rottentomatoes.com url in first param.

if everything ok, result key filled and if not, the error key filled with error occurred

#### Tv Series: Game of Thrones (2011-2019) / URL: [https://www.rottentomatoes.com/tv/game\_of\_thrones](https://www.rottentomatoes.com/tv/game_of_thrones)

[](#tv-series-game-of-thrones-2011-2019--url-httpswwwrottentomatoescomtvgame_of_thrones)

```
$rottentomatoes = new Hooshid\RottentomatoesScraper\Rottentomatoes();
$extract = $rottentomatoes->extract("/tv/game_of_thrones");
$result = $extract['result'];
$error = $extract['error'];

if ($error) {
    echo $error;
} else {
    echo $result['title']; // movie/series title
    echo $result['thumbnail']; // Poster thumbnail
    echo $result['summary']; // Summary

    echo $result['score']; // Score
    echo number_format($result['votes']); // Votes
    echo $result['user_score']; // User Score
    echo number_format($result['user_votes']); // User Votes
}
```

you must always catch error first and get results.

NOTE: you can pass full url of Rottentomatoes or just path of page

```
extract("https://www.rottentomatoes.com/m/matrix");
extract("/m/matrix");
```

the result same for both extract methods!

### Search

[](#search)

```
$rottentomatoes = new Hooshid\RottentomatoesScraper\Rottentomatoes();
$result = $rottentomatoes->search("The Matrix", "movie");

if($result['result']) {
    foreach ($result['result'] as $row) {
        echo $row['thumbnail'];
        echo $row['title'];
        echo $row['full_url'];
        echo $row['title'];
        echo $row['year'];
        echo $row['score'];
        echo $row['user_score'];
        echo $row['type'];
    }
} else {
    echo "Not found any result!";
}
```

search method always return result key, and you just need to looped and used. search method have two param, first the title of movie or series to search and second the type, type just can be movie or tv.

### Celebrity

[](#celebrity)

```
$rottentomatoes = new Hooshid\RottentomatoesScraper\Rottentomatoes();
$result = $rottentomatoes->celebrity("johnny_depp");

if($result['result']) {
    echo $result['result']['name'];
    echo $result['result']['full_url'];
    echo $result['result']['url_slug'];
    echo $result['result']['thumbnail'];
    // Movies : array
    foreach ($result['result']['movies'] as $row) {
        echo $row['title'];
        echo $row['url'];
        echo $row['year'];
        echo $row['tomatometer'];
        echo $row['audiencescore'];
    }
    // Series : array
    foreach ($result['result']['series'] as $row) {
        echo $row['title'];
        echo $row['url'];
        echo $row['year'];
        echo $row['tomatometer'];
        echo $row['audiencescore'];
    }
} else {
    echo "Not found!";
}
```

### Full examples

[](#full-examples)

just open the example folder, we put all examples and methods demo for you in there!

Related projects
----------------

[](#related-projects)

- [IMDb Scraper](https://github.com/hooshid/imdb-scraper)
- [Metacritic Scraper](https://github.com/hooshid/metacritic-scraper)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance76

Regular maintenance activity

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 98.8% 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 ~47 days

Recently: every ~58 days

Total

28

Last Release

212d ago

Major Versions

0.0.9 → 1.0.02022-09-02

1.0.1 → 2.0.02022-12-30

2.5.5 → 3.0.02025-09-26

PHP version history (2 changes)0.0.1PHP &gt;=7.3

3.0.1PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f7893f496bc282cf40f1872e929ab2d8da6c39cd7b29ee2c7a5513bebff26f0?d=identicon)[hooshid](/maintainers/hooshid)

---

Top Contributors

[![arkamali](https://avatars.githubusercontent.com/u/17387297?v=4)](https://github.com/arkamali "arkamali (85 commits)")[![devruler](https://avatars.githubusercontent.com/u/54912233?v=4)](https://github.com/devruler "devruler (1 commits)")

---

Tags

phprottentomatoesrottentomatoes-metadatarottentomatoes-scraperrottentomatoes-scrapingrottentomatoes-webscrappingscraperscrapingphpapiparserscraperscrapingwebscrappingrottentomatoesrottentomatoes.comrottentomatoes-webscrappingrottentomatoes-scrapingrottentomatoes-scraperrottentomatoes-metadata

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[duzun/hquery

An extremely fast web scraper that parses megabytes of HTML in a blink of an eye. No dependencies. PHP5+

363146.3k4](/packages/duzun-hquery)[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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