Unofficial python api for google play
Project description
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
Setup
Install playstoreapi using pip:
$ pip install playstoreapi
Or clone the repo and run:
$ python setup.py build
Usage
Check scripts in test
and examples
directory for more examples on how to use this API.
from playstoreapi.googleplay import GooglePlayAPI
mail = 'mymail@google.com'
passwd = 'mypasswd'
api = GooglePlayAPI('en_GB', 'Europe/London')
api.login(email=mail, password=passwd)
print(f'authSubToken: {api.authSubToken} gsfId: {api.gsfId}')
result = api.search('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'
export PLAYSTORE_DISPENSER_URL='http://goolag.store:1337/api/auth'
# 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
Built Distribution
File details
Details for the file playstoreapi-0.5.8.tar.gz
.
File metadata
- Download URL: playstoreapi-0.5.8.tar.gz
- Upload date:
- Size: 58.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a24827ffae17bcb4adfea305a505526f1dc7387240f186a20748c0cade9987d3 |
|
MD5 | 1770ec485e8b701fdf3b37546978532a |
|
BLAKE2b-256 | b33623542cdde1f4beabcc73c139662e10b139d8cbcdcc18001ddaedc4725cd5 |
File details
Details for the file playstoreapi-0.5.8-py3-none-any.whl
.
File metadata
- Download URL: playstoreapi-0.5.8-py3-none-any.whl
- Upload date:
- Size: 123.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52bd18527f086f6f916830c25104b72bc14bfd4fe53b7cba23d54ca230c7e015 |
|
MD5 | 5bfc79afd499723b37f176fbe12a534d |
|
BLAKE2b-256 | bb881525d8afc855ee024739c6d599349db8aba386d8b1dd745473a4dbb2d4f4 |