Skip to main content

Unofficial python api for google play

Project description

Repo on GitLab Repo on GitHub license commit-activity Mastodon Follow

Google Play Store Python API

This project is fork of googleplay-api. It contains an unofficial API for google play interactions.

This fork was created to have a better base for the gplaycrawler.

The code was updated with the following changes:

  • add (anonymous) login via token dispenser
  • add login via environment variables
  • updated protobuf and device configuration (they are now the same as the GPlayApi from AuroraOSS)
  • remove python2 support
  • raise exceptions for bad HTTP status codes
  • add possibility to use a delay between requests
  • add streamDetails (used for related apps)
  • add support for next pages to search and streamDetails


Install protobuf:

Using apt:

$ apt install -y protobuf-compiler

Using pacman:

$ pacman -S protobuf

Check version:

$ protoc --version  # Ensure compiler version is 3+

Install playstoreapi using pip:

$ pip install playstoreapi

Or clone the repo and run:

$ python build

These are the recommended ways to build the package, since pip/setuptools will take care of generating the file needed by the library (check the


Check scripts in test and examples directory for more examples on how to use this API.

from playstoreapi.googleplay import GooglePlayAPI

mail = ''
passwd = 'mypasswd'

api = GooglePlayAPI('en_GB', 'Europe/London')
api.login(email=mail, password=passwd)
print(f'authSubToken: {api.authSubToken} gsfId: {api.gsfId}')

result ='firefox')
for doc in result:
    if 'id' in doc:
        print('doc: {}'.format(doc['id']))
    for cluster in doc['subItem']:
        print('\tcluster: {}'.format(cluster['id']))
        for app in cluster['subItem']:
            print('\t\tapp: {}'.format(app['id']))

For first time logins, you should only provide email and password. The module will take care of initalizing the api, upload device information to the google account you supplied, and retrieving a Google Service Framework ID (which, from now on, will be the android ID of your fake device).

For the next logins you should save the gsfId and the authSubToken, and provide them as parameters to the login function or set them as environement variables. If you login again with email and password, this is the equivalent of re-initalizing your android device with a google account, invalidating previous gsfId and authSubToken.

Environment variables

# for envLogin()
export PLAYSTORE_TOKEN='ya29.fooooo'
export PLAYSTORE_GSFID='1234567891234567890'

# requests
export HTTP_PROXY='http://localhost:8080'
export HTTPS_PROXY='http://localhost:8080'
export CURL_CA_BUNDLE='/usr/local/myproxy_info/cacert.pem'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

playstoreapi-0.5.6.tar.gz (58.6 kB view hashes)

Uploaded source

Built Distribution

playstoreapi-0.5.6-py3-none-any.whl (123.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page