DEV Community

Aurelix Solutions
Aurelix Solutions

Posted on

Get new Google Maps reviews every morning in Python

A bad review that sits unanswered for a week costs more than one answered the same day. If you run several locations, or look after reviews for clients, the hard part isn't replying: it's noticing. Checking every Google Maps listing by hand doesn't scale past a handful of places.

The Google Maps Reviews tool reads the reviews Google shows on each place, with no login. It takes Google Maps links, place IDs or "name + city". With only new reviews turned on, each run returns just the reviews written since the last run. This post turns it into a daily digest in Python.

What you get, and the honest limit

Each row has the place (name, place ID, address, average rating, total review count) and the review: rating, text, written and updated dates, likes, photo count, owner reply and its date, and the reviewer's public name.

Google shows logged-out visitors about 5 reviews per place (sometimes up to 8), so this is not a full-history export. It is built for watching what's new: run it daily and the newest reviews are exactly what Google puts on the page.

Run it from Python

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("aurelix/google-maps-reviews-scraper").call(run_input={
    "places": [
        "Tim Hortons, 1 Place Ville Marie, Montreal",
        "https://www.google.com/maps/place/?q=place_id:ChIJb5gBC-u0RIYRHkntaUcdJGs",
    ],
    "onlyNewReviews": True,
    "stateKey": "my-locations",
})

for r in client.dataset(run["defaultDatasetId"]).iterate_items():
    if r.get("review_id"):
        flag = "⚠️" if r["rating"] <= 3 else "  "
        print(flag, r["rating"], r["place_name"], "-", (r["text"] or "")[:80])
Enter fullscreen mode Exit fullscreen mode

The first run saves a baseline and returns what Google shows today. Every later run with the same stateKey returns only reviews written after the newest one it has seen. A day with nothing new costs almost nothing.

Make it daily

  1. In Apify Console, save the input above as a task.
  2. Click Schedule, pick Daily, and choose the hour.
  3. Optional: paste a Slack webhook into Slack webhook URL to get the new reviews as a message, or a webhook URL for your own system.

Low ratings without an owner_response are your reply list for the day.

Price

$0.30 per 1,000 reviews ($0.25 on paid Apify plans), a fraction of a cent for a place with nothing to return, and a small start fee per run. Apify's free plan's $5 monthly credit covers thousands of reviews.

Try it: Google Maps Reviews on Apify

Top comments (0)