Google Play Unofficial Python API
Go to file
2021-07-01 19:26:28 +02:00
gpapi Fix APK download 2021-07-01 19:26:28 +02:00
scripts Added script to fetch devices from play-store-api 2018-07-15 13:15:00 +02:00
test Fix protobuf generation and test file 2019-06-15 11:49:51 -04:00
.gitignore generate protobuf python file using setuptools 2019-04-09 14:34:24 +02:00
.travis.yml travis: remove arguments from cmd 2018-12-23 22:41:55 +01:00
googleplay.proto Updated Protobuf definition and parsing 2018-12-12 17:23:07 +01:00
LICENSE.md Typo in LICENSE.md 2017-10-09 16:34:06 +02:00
MANIFEST.in Fix to include device.properties on build 2019-05-19 18:09:15 +04:30
README.md Fixed test code in README.md 2020-01-20 11:38:07 +00:00
setup.cfg Added file for PyPi upload 2017-10-05 22:38:35 +02:00
setup.py Updated setup.py for release v0.4.4 2019-11-27 14:00:19 +01:00

Google play python API Build Status

This project contains an unofficial API for google play interactions. The code mainly comes from GooglePlayAPI project which is not maintained anymore. The code was updated with some important changes:

  • ac2dm authentication with checkin and device info upload
  • updated search and download calls
  • select the device you want to fake from a list of pre-defined values (check device.properties) (defaults to a OnePlus One)

Build

This is the recommended way to build the package, since setuptools will take care of generating the googleplay_pb2.py file needed by the library (check the setup.py)

$ python setup.py build

Usage

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

from gpapi.googleplay import GooglePlayAPI

mail = "mymail@google.com"
passwd = "mypasswd"

api = GooglePlayAPI(locale="en_US", timezone="UTC", device_codename="hero2lte")
api.login(email=mail, password=passwd)

result = api.search("firefox")

for doc in result:
    if 'docid' in doc:
        print("doc: {}".format(doc["docid"]))
    for cluster in doc["child"]:
        print("\tcluster: {}".format(cluster["docid"]))
        for app in cluster["child"]:
            print("\t\tapp: {}".format(app["docid"]))

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. 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.