# Google Reviews Analyzer (`optimus-fulcria/google-reviews-analyzer`) Actor

Scrape Google Maps reviews with sentiment analysis and word frequency. Filter by language, sort order.

- **URL**: https://apify.com/optimus-fulcria/google-reviews-analyzer.md
- **Developed by:** [Fulcria Labs](https://apify.com/optimus-fulcria) (community)
- **Categories:** Marketing
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Reviews Analyzer

An Apify actor that scrapes Google Maps reviews for any business and provides structured data with sentiment analysis and word frequency insights.

### Features

- **Flexible input**: Accepts a Google Maps place URL or a business name + city
- **Review extraction**: Scrapes reviewer name, star rating, date, review text, and owner responses
- **Sentiment categorization**: Classifies each review as positive (4-5 stars), neutral (3 stars), or negative (1-2 stars)
- **Word frequency analysis**: Identifies the most common words/themes across reviews, broken down by sentiment
- **Summary statistics**: Generates aggregate stats including rating distribution, response rate, and average review length
- **Configurable**: Set max reviews, sort order, language filter, and proxy settings

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `placeUrl` | string | | Google Maps place URL |
| `businessName` | string | | Business name to search (alternative to URL) |
| `location` | string | | City/location to narrow search |
| `maxReviews` | integer | 100 | Maximum reviews to scrape (1-5000) |
| `sortOrder` | string | `newest` | Sort: `newest`, `highest`, `lowest`, `relevant` |
| `language` | string | | ISO 639-1 language code (e.g., `en`, `es`) |
| `includeOwnerResponse` | boolean | true | Include business owner responses |
| `generateSummary` | boolean | true | Generate summary statistics |
| `proxyConfiguration` | object | Apify proxy | Proxy settings |

### Output Format

#### Individual Review Records

Each review is pushed to the dataset as a separate record:

```json
{
    "business_name": "Example Restaurant",
    "review_id": "abc123",
    "reviewer_name": "John D.",
    "rating": 5,
    "date": "2 months ago",
    "text": "Amazing food and great atmosphere. The pasta was incredible.",
    "sentiment": "positive",
    "owner_response": "Thank you for your kind words!",
    "owner_response_date": "1 month ago",
    "reviewer_info": "Local Guide - 42 reviews",
    "review_number": 1
}
```

#### Summary Statistics

When `generateSummary` is enabled, a summary record is also generated:

```json
{
    "_type": "summary",
    "business_name": "Example Restaurant",
    "total_reviews_scraped": 100,
    "average_rating_scraped": 4.3,
    "rating_distribution": {
        "1_star": 3,
        "2_star": 5,
        "3_star": 10,
        "4_star": 32,
        "5_star": 50
    },
    "sentiment_distribution": {
        "positive": 82,
        "neutral": 10,
        "negative": 8
    },
    "owner_response_rate_percent": 45.0,
    "top_words": [
        {"word": "food", "total_count": 45, "in_positive": 38, "in_neutral": 5, "in_negative": 2},
        {"word": "service", "total_count": 30, "in_positive": 20, "in_neutral": 3, "in_negative": 7}
    ]
}
```

The full summary is also stored in the key-value store under the `SUMMARY` key,
and the complete output (business info + all reviews + summary) under the `OUTPUT` key.

### Usage Examples

#### Using a Google Maps URL

```json
{
    "placeUrl": "https://www.google.com/maps/place/Statue+of+Liberty",
    "maxReviews": 50,
    "sortOrder": "newest"
}
```

#### Using business name + location

```json
{
    "businessName": "Central Park",
    "location": "New York",
    "maxReviews": 200,
    "sortOrder": "lowest",
    "language": "en"
}
```

### How It Works

1. **Place resolution**: If a business name is provided instead of a URL, the actor searches Google Maps and follows redirects to find the place page.
2. **Page fetching**: Loads the Google Maps place page with browser-like headers.
3. **HTML parsing**: Extracts review data from DOM elements (`data-review-id` attributes, aria labels, class-based selectors).
4. **Script data extraction**: Falls back to parsing embedded JavaScript data arrays when DOM parsing yields no results.
5. **Search fallback**: As a final fallback, searches Google for the business reviews and extracts from knowledge panel results.
6. **Analysis**: Categorizes sentiment by rating, runs word frequency analysis, and computes summary statistics.

### Proxy Recommendations

Google Maps aggressively rate-limits automated requests. Using Apify proxy (residential or SERP) is strongly recommended for reliable results. Configure the `proxyConfiguration` input to use proxies.

### Limitations

- Google Maps dynamically loads reviews via JavaScript, so the number of reviews extractable from static HTML is limited. The actor uses multiple extraction strategies to maximize coverage.
- Review dates are relative (e.g., "2 months ago") as displayed by Google Maps, not absolute dates.
- Very new or very small businesses may have few or no reviews to scrape.

### Development

```bash
## Install dependencies
pip install -r requirements.txt

## Run locally with Apify CLI
apify run --input '{"placeUrl": "https://www.google.com/maps/place/..."}'
```

# Actor input Schema

## `placeUrl` (type: `string`):

Full Google Maps URL for the business (e.g., https://www.google.com/maps/place/...)

## `businessName` (type: `string`):

Business name to search for (used if Place URL is not provided)

## `location` (type: `string`):

City or location to narrow the search (used with Business Name)

## `maxReviews` (type: `integer`):

Maximum number of reviews to scrape

## `sortOrder` (type: `string`):

How to sort reviews before scraping

## `language` (type: `string`):

Filter reviews by language (ISO 639-1 code, e.g., 'en', 'es', 'fr'). Leave empty for all languages.

## `includeOwnerResponse` (type: `boolean`):

Whether to include business owner responses to reviews

## `generateSummary` (type: `boolean`):

Generate summary stats with sentiment analysis and word frequency

## `proxyConfiguration` (type: `object`):

Proxy settings for avoiding rate limits

## Actor input object example

```json
{
  "placeUrl": "https://www.google.com/maps/place/Statue+of+Liberty",
  "maxReviews": 100,
  "sortOrder": "newest",
  "language": "",
  "includeOwnerResponse": true,
  "generateSummary": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "placeUrl": "https://www.google.com/maps/place/Statue+of+Liberty",
    "businessName": "",
    "location": "",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("optimus-fulcria/google-reviews-analyzer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "placeUrl": "https://www.google.com/maps/place/Statue+of+Liberty",
    "businessName": "",
    "location": "",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("optimus-fulcria/google-reviews-analyzer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "placeUrl": "https://www.google.com/maps/place/Statue+of+Liberty",
  "businessName": "",
  "location": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call optimus-fulcria/google-reviews-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,optimus-fulcria/google-reviews-analyzer"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/p7hNqAchL2cQiWHAg/builds/SN3AAALBhRkTdgPrU/openapi.json
