Need help with android-market-api-py?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

liato
124 Stars 43 Forks 14 Commits 6 Opened issues

Description

A Python port of the java Android Market API.

Services available

!
?

Need anything else?

Contributors list

# 24,146
Shell
disasse...
TeX
gbz80
8 commits
# 249,695
Shell
python-...
openwea...
Java
3 commits
# 425,629
Python
Java
Google
1 commit

Python Android Market Library

This is a Python port of the Android Market API Java Project

Requirements

Usage

Begin by starting a new session and entering your google credentials.

session = MarketSession()
session.login("[email protected]", "password")

Search for "bankdroid" on the market and print the first result

results = session.searchApp("bankdroid")
app = results[0]
pprint(app)

which prints:

{'apptype': 1L,
 'creator': u'Nullbyte',
 'creatorid': u'Nullbyte',
 'id': u'-4924482311466714951',
 'packagename': u'com.liato.bankdroid',
 'rating': u'4.526643598615917',
 'ratingscount': 1445L,
 'title': u'Bankdroid',
 'version': u'1.6.3',
 'versioncode': 102L,
 'extendedinfo': {'category': u'Finance',
                  'contactemail': u'[email protected]',
                  'contactwebsite': u'http://github.com/liato/android-bankdroid',
                  'downloadscount': 0L,
                  'downloadscounttext': u'10,000-50,000',
                  'installsize': 1323486L,
                  'packagename': u'com.liato.bankdroid',
                  'screenshotscount': 2L
...
}

Print the last two comments for the app

results = session.getComments(app["id"])
pprint(results[:2])

and you get:

[{'authorid': u'02028671193556683049',
  'authorname': u'Vincent',
  'creationtime': 1299254796868L,
  'rating': 5L,
  'text': u'Changed my (everyday) life!'},
 {'authorid': u'15970848302407799024',
  'authorname': u'primetomas',
  'creationtime': 1299101108485L,
  'rating': 5L,
  'text': u'This is awesome. Keep up the good work!'}]

Download and save the first screenshot to disk:

data = session.getImage(app["id"])
f = open("screenshot.png", "wb")
f.write(data)
f.close()

Download and save the app icon to disk:

data = session.getImage(app["id"], imagetype=market_proto.GetImageRequest.ICON)
f = open("icon.png", "wb")
f.write(data)
f.close()

Get all the categories and subcategories:

results = session.getCategories()
pprint(results)

Prints:

[{'apptype': 1L,
  'subcategories': [{'apptype': 1L,
                     'subtitle': u'Pandora Radio, Google Maps, Gmail',
                     'title': u'All applications'},
                    {'apptype': 1L,
                     'categoryid': u'BOOKS_AND_REFERENCE',
                     'subtitle': u'Google Sky Map, Dictionary.com, Bible',
                     'title': u'Books & Reference'},
                     ...],
  'title': u'APPLICATION'},
...
]

Check out examples.py for working examples.

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.