Google Play Developer Publishing API samples
A collection of command-line samples for the Play Developer Publishing API.
- Download Google APIs Client Library for Python (google-api-python-client): https://code.google.com/p/google-api-python-client/
or use pip:
$ pip install google-api-python-client
- Make sure you can import the client library:
$ python >>> import apiclient >>>
First request using OAuth2: Installed application
client_secrets.jsonfile and add the client ID and client secret.
Execute any of the scripts to begin the auth flow:
$ python basic_list_apks.py com.myapp.package
A browser window will open and ask you to login. Make sure the account has enough permissions in the Google Play Developer console.
- Accept the permissions dialog. The browser should display
The authentication flow has completed.
Close the window and go back to the shell.
The script will output a list of apks.
The tokens will be stored in
androidpublisher.dat. Remove this file to restart the auth flow.
First request using OAuth2: Service accounts
basic_list_apks_service_account.pyand add the service account Email address.
Copy the service account key file, generated in the Google APIs Console into the same directory and rename it to
Execute the script:
$ python basic_list_apks_service_account.py com.myapp.package
- The script will output a list of apks.