Playstore Scraper

This Python code scrapes app data from the Play Store and saves it as a CSV file. It extracts details like titles, ratings, descriptions, and more, for further analysis or comparison. with competitors.

You can scrape and download data from your competitors find out where they are lacking and use it to your advantage.

How to use it?

  1. Open in your Google Collab
  2. Replace the file_name with your actual file name
  3. Replace the drive location with df_busu.to_csv(‘/content/drive/My Drive/file_name.csv’) # path to save your exported CSV file

Use Cases:

  1. To do sentiment analysis
  2. Get a better understanding of in-depth positive and negative feedback
  3. You can also run this as a cron to get and connect it to Analytical tools such as PowerBI.

Import the required libraries

pip install google-play-scraper

from google_play_scraper import app
import pandas as pd
import numpy as np

Enter the app package name from the Play Store URL, also mention the country, language, and the sort method you want:

from google_play_scraper import Sort, reviews_all

us_reviews = reviews_all(
    'app.rocket.com', # package name of the app you want to scrape
    sleep_milliseconds=0, # defaults to 0
    lang='en', # defaults to 'en'
    country='in', # defaults to 'in'
    sort=Sort.NEWEST, # defaults to Sort.MOST_RELEVANT
)

Convert it into a data frame:

df_busu = pd.DataFrame(np.array(us_reviews),columns=['review'])

df_busu = df_busu.join(pd.DataFrame(df_busu.pop('review').tolist()))

# to displpay the top reviews
df_busu.head()
# Data will appear here

Convert the data frame to CSV:

df_busu.to_csv('file_name.csv') # your filename here

from google.colab import drive
drive.mount('/content/drive') # mounting google drive to store

df_busu.to_csv('/content/drive/My Drive/file_name.csv') # path to save your exported csv file

Check your drive, you’ll find the scraper review data in the specified “.csv” format.

Leave a Comment