I recently needed to generate a QR code for a restaurant client that links directly to their Google "Write a Review" screen.
I found plenty of "free" tools online, but they all had the same problem:
- They created dynamic links (e.g.,
qr.co/xyz) that redirect. - They required a signup.
- They expired after 14 days unless you paid.
I realized I could build this myself using the Google Places API and Python. Here is how I did it.
The Logic
Google has a direct URL format for reviews:
https://search.google.com/local/writereview?placeid=YOUR_PLACE_ID
If you have the place_id, the link is permanent and free. The trick is getting the ID programmatically.
The Code
I used requests to hit the Places API and qrcode to generate the image.
import requests
import qrcode
def get_place_id(api_key, query):
url = "https://places.googleapis.com/v1/places:searchText"
headers = {
"Content-Type": "application/json",
"X-Goog-Api-Key": api_key,
"X-Goog-FieldMask": "places.id"
}
payload = {"textQuery": query}
response = requests.post(url, json=payload, headers=headers)
return response.json()['places'][0]['id']
def generate_qr(place_id):
link = f"https://search.google.com/local/writereview?placeid={place_id}"
img = qrcode.make(link)
img.save("review-qr.png")
The Web App
I wrapped this in a simple Flask app to make it accessible for non-coders.
You can try the live tool here (no signup required):
ReviewReport Free QR Generator
Or grab the source code on GitHub:
GitHub Repo
Hope this saves you from paying $15/month for a static link!
Top comments (0)