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'
Metadata
Release files for playstoreapi 0.5.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| playstoreapi-0.5.8.tar.gz | 58.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| playstoreapi-0.5.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 181.5 kB
Release files / playstoreapi-0.5.8.tar.gz
| Download URL | playstoreapi-0.5.8.tar.gz |
|---|---|
| Size | 58.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a24827ffae17bcb4adfea305a505526f1dc7387240f186a20748c0cade9987d3
|
|
BLAKE2b-256 checksum How to use checksums |
b33623542cdde1f4beabcc73c139662e10b139d8cbcdcc18001ddaedc4725cd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / playstoreapi-0.5.8-py3-none-any.whl
| Download URL | playstoreapi-0.5.8-py3-none-any.whl |
|---|---|
| Size | 123.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52bd18527f086f6f916830c25104b72bc14bfd4fe53b7cba23d54ca230c7e015
|
|
BLAKE2b-256 checksum How to use checksums |
bb881525d8afc855ee024739c6d599349db8aba386d8b1dd745473a4dbb2d4f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for playstoreapi 0.5.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.