PHPackages                             scraper-apis/g2-reviews-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. scraper-apis/g2-reviews-scraper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

scraper-apis/g2-reviews-scraper
===============================

PHP Scraper library for fetching product reviews from G2.com using an Apify actor

00PHPCI passing

Since Feb 12Pushed 3mo agoCompare

[ Source](https://github.com/Scraper-APIs/g2-reviews-scraper-php)[ Packagist](https://packagist.org/packages/scraper-apis/g2-reviews-scraper)[ RSS](/packages/scraper-apis-g2-reviews-scraper/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[G2 Reviews PHP Scraper](https://github.com/Scraper-APIs/g2-reviews-scraper-php)
================================================================================

[](#g2-reviews-php-scraper)

[![Tests](https://github.com/Scraper-APIs/g2-reviews-scraper-php/actions/workflows/tests.yml/badge.svg)](https://github.com/Scraper-APIs/g2-reviews-scraper-php/actions/workflows/tests.yml)[![PHP Version](https://camo.githubusercontent.com/42df5991a968c0783a689ce697865ac6fbe316246743abc265ab342ae158dc7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e332532422d626c7565)](https://www.php.net/)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

A PHP library for scraping product reviews from [G2.com](https://www.g2.com) using the [Apify G2 Reviews Scraper](https://apify.com/zen-studio/g2-reviews-scraper). Returns fully typed DTOs for easy integration into your application. *Safe, reliable and scalable.*

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

[](#installation)

```
composer require scraper-apis/g2-reviews-scraper
```

Requirements
------------

[](#requirements)

- PHP 8.3+
- Apify API token ([get one here](https://console.apify.com/account/integrations))

Quick Start
-----------

[](#quick-start)

```
use G2ReviewsScraper\Client;

$client = new Client('YOUR_APIFY_TOKEN');

// Scrape reviews for a product
$reviews = $client->scrape('https://www.g2.com/products/notion/reviews');

foreach ($reviews as $review) {
    echo $review->title . ' - ' . $review->starRating . '★' . PHP_EOL;
}
```

Usage
-----

[](#usage)

### Basic Review Scraping

[](#basic-review-scraping)

```
$reviews = $client->scrape(
    url: 'https://www.g2.com/products/notion/reviews',
    limit: 100
);
```

### Sort by Rating

[](#sort-by-rating)

```
use G2ReviewsScraper\SortOrder;

// Get lowest-rated reviews first (for competitor analysis)
$reviews = $client->scrape(
    url: 'https://www.g2.com/products/jira/reviews',
    limit: 500,
    sortOrder: SortOrder::LowestRated
);
```

### Filter by Star Rating

[](#filter-by-star-rating)

```
// Only 1-2 star reviews
$reviews = $client->scrape(
    url: 'https://www.g2.com/products/salesforce/reviews',
    limit: 200,
    starRatings: ['1', '2']
);
```

### Search Reviews

[](#search-reviews)

```
// Reviews mentioning "integration"
$reviews = $client->scrape(
    url: 'https://www.g2.com/products/hubspot/reviews',
    limit: 100,
    searchQuery: 'integration'
);
```

### Get Pros/Cons Summary

[](#get-proscons-summary)

```
// Scrape reviews + AI-generated pros/cons summary
$result = $client->scrapeWithProsCons(
    url: 'https://www.g2.com/products/slack/reviews',
    limit: 500
);

// Access reviews
foreach ($result['reviews'] as $review) {
    echo $review->title . PHP_EOL;
}

// Access AI summary
$prosCons = $result['prosCons'];
echo "Product: {$prosCons->productName}" . PHP_EOL;
echo "Average Rating: {$prosCons->productAverageRating}" . PHP_EOL;

foreach ($prosCons->aiPros as $pro) {
    echo "PRO: {$pro->text} ({$pro->mentions} mentions)" . PHP_EOL;
}

foreach ($prosCons->aiCons as $con) {
    echo "CON: {$con->text} ({$con->mentions} mentions)" . PHP_EOL;
}
```

### Working with Review Data

[](#working-with-review-data)

```
foreach ($reviews as $review) {
    // Basic info
    echo $review->title;
    echo $review->starRating;           // e.g., 5.0
    echo $review->date;                 // e.g., "2026-01-15"

    // Reviewer details
    echo $review->reviewerName;         // e.g., "John Smith"
    echo $review->reviewerTitle;        // e.g., "Software Engineer"
    echo $review->getCompanyInfo();     // e.g., "Mid-Market (51-1000 emp.) | Used for 2+ years"

    // Review content (pros | cons | recommendations)
    echo $review->text;

    // Verification badges
    if ($review->hasValidatedReviewer()) {
        echo "Verified via: {$review->validatedMethod}"; // "LinkedIn" or "Business Email"
    }
    if ($review->isCurrentUser()) {
        echo "Verified current user";
    }
    if ($review->incentivized) {
        echo "Incentivized review";
    }

    // LLM-ready markdown (for RAG pipelines)
    echo $review->markdownContent;
}
```

### Filtering Results

[](#filtering-results)

```
// Filter for validated reviewers only
$validated = array_filter(
    $reviews,
    fn ($r) => $r->hasValidatedReviewer()
);

// Filter for current users only
$currentUsers = array_filter(
    $reviews,
    fn ($r) => $r->isCurrentUser()
);

// Filter by rating
$fiveStarReviews = array_filter(
    $reviews,
    fn ($r) => $r->starRating === 5.0
);

// Filter non-incentivized reviews
$organic = array_filter(
    $reviews,
    fn ($r) => !$r->incentivized
);
```

DTOs
----

[](#dtos)

### Review

[](#review)

PropertyTypeDescription`reviewId`stringUnique review identifier`productName`stringProduct name`productSlug`stringProduct URL slug`title`?stringReview headline`starRating`?floatRating (1.0-5.0)`reviewerName`?stringReviewer's name`reviewerTitle`?stringReviewer's job title`date`?stringReview date (YYYY-MM-DD)`text`?stringFull review text (pros | cons | recommendations)`reviewerInfo`?string\[\]Company size, usage duration`reviewerAvatarUrl`?stringAvatar image URL`reviewerMonogram`?stringAvatar initials`validatedReviewer`boolReviewer identity verified`validatedMethod`?string"LinkedIn" or "Business Email"`verifiedCurrentUser`boolVerified current product user`reviewSource`stringReview source (e.g., "Organic")`incentivized`boolIncentivized review flag`markdownContent`?stringLLM-ready markdown format### ProsCons

[](#proscons)

PropertyTypeDescription`productName`stringProduct name`productSlug`stringProduct URL slug`productId`?stringG2 product ID`productUuid`?stringG2 product UUID`vendorId`?stringVendor ID`vendorName`?stringVendor company name`productType`?stringProduct type`productCategory`?stringPrimary category`productAverageRating`?floatOverall rating`productImageUrl`?stringProduct logo URL`productCategories`?string\[\]All product categories`aiPros`AiSummaryItem\[\]AI-generated pro points`aiCons`AiSummaryItem\[\]AI-generated con points`topPros`ProsConsCategory\[\]Top pro categories with samples`topCons`ProsConsCategory\[\]Top con categories with samples### AiSummaryItem

[](#aisummaryitem)

PropertyTypeDescription`text`stringSummary text`keyword`?stringKey term`mentions`intNumber of mentions### ProsConsCategory

[](#prosconscategory)

PropertyTypeDescription`name`stringCategory name (e.g., "Ease of Use")`summary`stringCategory summary`keyword`?stringKey term`mentions`intTotal mentions`sampleReviews`SampleReview\[\]Sample reviews (max 2)Sort Orders
-----------

[](#sort-orders)

EnumValueDescription`SortOrder::MostRecent``most_recent`Newest reviews first`SortOrder::MostHelpful``most_helpful`Most upvoted reviews first`SortOrder::LowestRated``lowest_rated`1-star reviews first`SortOrder::HighestRated``highest_rated`5-star reviews firstError Handling
--------------

[](#error-handling)

```
use G2ReviewsScraper\Exception\ApiException;
use G2ReviewsScraper\Exception\RateLimitException;
use G2ReviewsScraper\Exception\InvalidUrlException;

try {
    $reviews = $client->scrape($url);
} catch (InvalidUrlException $e) {
    // Invalid G2 product URL
    echo $e->getMessage();
} catch (RateLimitException $e) {
    // Handle rate limiting
    sleep($e->retryAfter);
} catch (ApiException $e) {
    // Handle other API errors
    echo $e->getMessage();
}
```

Deduplication
-------------

[](#deduplication)

When scraping multiple products, use `reviewId` as the unique key:

```
$allReviews = [];

$products = ['notion', 'asana', 'monday-com'];
foreach ($products as $product) {
    $url = "https://www.g2.com/products/{$product}/reviews";
    foreach ($client->scrape($url, limit: 100) as $review) {
        $allReviews[$review->reviewId] = $review;
    }
}

// $allReviews now contains unique reviews only
```

Use Cases
---------

[](#use-cases)

### Competitor Analysis

[](#competitor-analysis)

```
// Get negative reviews for competitor analysis
$reviews = $client->scrape(
    url: 'https://www.g2.com/products/competitor-product/reviews',
    limit: 500,
    sortOrder: SortOrder::LowestRated,
    starRatings: ['1', '2', '3']
);

// Analyze common complaints
$complaints = [];
foreach ($reviews as $review) {
    $complaints[] = $review->text;
}
```

### Sentiment Monitoring

[](#sentiment-monitoring)

```
// Track reviews over time
$result = $client->scrapeWithProsCons(
    url: 'https://www.g2.com/products/your-product/reviews',
    limit: 1000,
    sortOrder: SortOrder::MostRecent
);

$prosCons = $result['prosCons'];
$proMentions = $prosCons->getTotalProMentions();
$conMentions = $prosCons->getTotalConMentions();
$sentimentRatio = $proMentions / max(1, $conMentions);
```

### RAG Pipeline Integration

[](#rag-pipeline-integration)

```
// Export reviews for LLM ingestion
foreach ($reviews as $review) {
    // Use pre-formatted markdown
    $document = $review->markdownContent;

    // Or build custom format
    $metadata = [
        'reviewId' => $review->reviewId,
        'product' => $review->productName,
        'rating' => $review->starRating,
        'validated' => $review->hasValidatedReviewer(),
    ];

    // Store in vector database
    $vectorDb->insert($document, $metadata);
}
```

License
-------

[](#license)

MIT

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance55

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8433587?v=4)[Peter Thaleikis](/maintainers/spekulatius)[@spekulatius](https://github.com/spekulatius)

---

Top Contributors

[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (2 commits)")

---

Tags

apifydata-extractiong2-scraper

### Embed Badge

![Health badge](/badges/scraper-apis-g2-reviews-scraper/health.svg)

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

PHPackages © 2026

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