This project fetches Google Play Store app reviews, stores them in BigQuery, and then uses Google Gemini to analyze the reviews, providing summaries and tagging negative feedback.
main.go
: Main program to fetch reviews, push to BigQuery, and interact with the user.mock-play-api
: A separate Go project that mocks the Google Play Developer API reviews endpoint. This allows for local testing and development without needing to interact with the actual API.bq-schema
: Contains the schema definitions for the BigQuery tables (raw_reviews
andreviews_to_process
).bq_review_analysis.sql
: A BigQuery stored procedure that processes reviews using Google Gemini.
-
Install Go: Ensure you have Go installed.
-
Set Environment Variables:
PROJECT_ID
: Your Google Cloud Project ID.GOOGLE_APPLICATION_CREDENTIALS
: Path to your service account key file. This file needs thehttps://www.googleapis.com/auth/androidpublisher
scope for accessing the Play Store API (or at least read access to BigQuery).
-
Create BigQuery Dataset and Tables: Create a BigQuery dataset named
play_store_reviews_demo
and tablesraw_reviews
andreviews_to_process
using the JSON schema files in thebq-schema
directory. -
Create Vertex AI connection: You will also need to create a connection to Vertex AI and a remote model reference named
gemini_model
that points to your Gemini model:CREATE OR REPLACE MODEL `your-project-id.play_store_reviews_demo.gemini_model` REMOTE WITH CONNECTION `us.gemini_analysis` OPTIONS (ENDPOINT = 'gemini-2.0-flash-001');
-
Run the Mock API (optional): Navigate to the
mock-play-api
directory and rungo build . && ./mock-play-api
. This starts a local server that mocks the Play Store API. -
Run the Main Program: Navigate to the root directory of this project and run
go run main.go
. The program will prompt you for the package name and then fetch, process, and analyze the reviews.
You can deploy both mock and main application by simply invoking gcloud run deploy
. First deploy the mock of play store reviews API, write url down and pass it to the main application via MOCK_URI environment variable.
For example:
gcloud run deploy --set-env-vars "PROJECT_ID=your-project-id" --set-env-vars "MOCK_URI=mock-play-api.somedomain.sometld"
The program will guide you through the process:
- Enter the package name of the app you want to analyze.
- Press "Fetch new Reviews". Once the reviews are imported, press "Analyze Imported reviews"
- The program will fetch reviews from the mock API (or the real API if you modify the code).
- It will push the raw reviews to BigQuery.
- It will then use a BigQuery stored procedure to process the reviews
Apache 2.0
This is not an officially supported Google product