Skip to main content

Google Play 商店应用抓取工具

项目描述

Play 商店刮刀

从 Google Play 商店抓取并解析应用程序数据。

安装

用 pip 安装。

pip install play-scraper

用法

  • details : 获取应用程序的详细信息
  • collection:获取应用程序列表及其详细信息。
  • developer:获取开发人员提供的应用程序。
  • 建议:获取查询字符串建议列表。
  • search:获取与搜索查询匹配的应用程序。
  • similar:获取应用程序的类似应用程序。
  • 类别:获取可用类别的列表。

细节

获取应用程序的详细信息。

选项:

  • app_id要获取的应用 ID,例如com.android.chromeGoogle Chrome。
  • hl(默认en为英语)接收特定语言结果 的语言代码
    • None注意:由于应用程序的附加信息部分 HTML 的显示方式,非默认将导致某些字段
  • glus(美国的默认值)接收来自特定国家/地区的结果的国家/地区代码
>>> import play_scraper
>>> print(play_scraper.details('com.android.chrome'))
{
    'app_id': 'com.android.chrome',
    'category': ['COMMUNICATION'],
    'content_rating': ['Everyone'],
    'current_version': 'Varies with device',
    'description': 'Google Chrome is a fast, easy to use, and secure web browser. Designed for Android, Chrome brings you personalized news ...',
    'description_html': 'Google Chrome is a fast, easy to ... Chrome web browser experience you love across all your devices.<br/> <br/> <b>Browse fast and type less.</b> ...',
    'developer': 'Google LLC',
    'developer_address': '1600 Amphitheatre Parkway, Mountain View 94043',
    'developer_email': 'apps-help@google.com',
    'developer_id': '5700313618786177705',
    'developer_url': 'http://www.google.com/chrome/android',
    'editors_choice': False,
    'free': True,
    'histogram': { 1: 672180, 2: 288519, 3: 735220, 4: 1560066, 5: 6033423},
    'iap': False,
    'iap_range': None,
    'icon': 'https://lh3.googleusercontent.com/nYhPnY2I-e9rpqnid9u9aAODz4C04OycEGxqHG5vxFnA35OGmLMrrUmhM9eaHKJ7liB-',
    'installs': '1,000,000,000+',
    'interactive_elements': ['Unrestricted Internet'],
    'price': '0',
    'recent_changes': u"Thanks for choosing Chrome! You can now find your saved passwords more easily \u2013 just tap the new Search icon in Settings > Passwords. We've also included stability and performance improvements.",
    'required_android_version': 'Varies with device',
    'reviews': 9289408,
    'score': '4.3',
    'screenshots': [ 'https://lh3.googleusercontent.com/lKPDNfsO2QhJD9i77rGDTiH5ILjXlXwPsRi194hhkY4BsbaXbpCFrdjWvcU1zttUwqXz=w720-h310-rw', ...],
    'size': 'Varies with device',
    'title': 'Google Chrome: Fast & Secure',
    'updated': 'May 10, 2018',
    'url': 'https://play.google.com/store/apps/details?id=com.android.chrome',
    'video': None
}

收藏

从集合中获取应用程序列表,可选择按类别过滤。

选项:

  • collection要获取的集合。
  • category(默认无)要过滤的类别。
  • results(默认 60,最大 120)要获取的应用程序数量。
  • page(默认 0)要获取的页码。限制:page * results <= 500
  • age(默认无)过滤的年龄范围。(仅适用于家庭类别)
  • detailed(默认为 False)如果为 True,则为每个应用发送请求以获取完整的详细信息
  • hl(默认en为英语)接收特定语言结果 的语言代码
    • None注意:由于应用程序的附加信息部分 HTML 的显示方式,非默认将导致某些字段
  • glus(美国的默认值)接收来自特定国家/地区的结果的国家/地区代码
>>> import play_scraper
>>> print(play_scraper.collection(
        collection='TRENDING',
        category='GAME_RACING',
        results=5,
        page=1))
[ { 'app_id': 'blaze.andthemonstermachinesferr',
    'description': 'Blaze The Monster Truck Mud Mountain Rescue - Monster Machines game for kids',
    'developer': 'app Star',
    'developer_id': 'app+Star',
    'free': True,
    'full_price': None,
    'icon': 'https://lh3.googleusercontent.com/cUk9UciJkqFUE4HVBiif9JUD8rWEXJCewG2JKVK9abWRaK3AMmIaSB61xlKGzIdw8w',
    'price': '0',
    'score': '4.3',
    'title': 'Blaze and the Monster Machines Free',
    'url': 'https://play.google.com/store/apps/details?id=blaze.andthemonstermachinesferr'},
  { 'app_id': 'com.notdoppler.earntodie2',
    'description': 'Drive your car through a zombie apocalypse in this epic sequel to Earn to Die!',
    'developer': 'Not Doppler',
    'developer_id': 'Not+Doppler',
    'free': True,
    'full_price': None,
    'icon': 'https://lh3.googleusercontent.com/PeYxYz56AltCaJaRu5OebqewOTqUoR9vU_jPavcphz1CywaU4d69My-cc9Stzx4DTTI',
    'price': '0',
    'score': '4.6',
    'title': 'Earn to Die 2',
    'url': 'https://play.google.com/store/apps/details?id=com.notdoppler.earntodie2'}, ...]

开发商

获取开发人员提供的应用程序。

选项:

  • developer获取应用程序的开发人员名称,例如Disney. (区分大小写)
  • results(默认 24,最大 120)要获取的应用程序数量。(开发人员可能或多或少地发布了应用程序)
  • page(默认 0)要获取的页码。限制:0 < (results // 20) * page < 12
  • detailed(默认为 False)如果为 True,则为每个应用程序发送一个请求以获取详细信息,如details中所示。
  • hl(默认en为英语)接收特定语言结果 的语言代码
    • None注意:由于应用程序的附加信息部分 HTML 的显示方式,非默认将导致某些字段
  • glus(美国的默认值)接收来自特定国家/地区的结果的国家/地区代码
>>> import play_scraper
>>> print(play_scraper.developer('Disney', results=5))
[ { 'app_id': 'com.disney.datg.videoplatforms.android.watchdc',
    'description': 'Disney Channel, Disney XD & Disney Junior\u2019s new home for shows, games & live TV!',
    'developer': 'Disney',
    'developer_id': 'Disney',
    'free': True,
    'full_price': None,
    'icon': 'https://lh3.googleusercontent.com/C6CkMLr6s5bglWHr-2tH0Tdm138_6LCaevR14_fGV9kEPsoCF5t-L5pOQyOic4WsAnoU',
    'price': '0',
    'score': '4.3',
    'title': 'DisneyNOW \u2013 TV Shows & Games',
    'url': 'https://play.google.com/store/apps/details?id=com.disney.datg.videoplatforms.android.watchdc'},
  { 'app_id': 'com.disney.wdw.android',
    'description': 'Walt Disney World Resort maps, wait times, tickets, FastPass+, dining & more.',
    'developer': 'Disney',
    'developer_id': 'Disney',
    'free': True,
    'full_price': None,
    'icon': 'https://lh3.googleusercontent.com/NERZ9v0bPh_RBFRAbJe9cgGvk_DDIQCyWJc0YQ6LhRSGC51tQErHa8Rs9oFmzPRb9KQ',
    'price': '0',
    'score': '4.7',
    'title': 'My Disney Experience',
    'url': 'https://play.google.com/store/apps/details?id=com.disney.wdw.android'}, ...]

建议

获取自动完成的查询建议列表。

选项:

  • hl(默认en为英语)接收特定语言结果 的语言代码
    • None注意:由于应用程序的附加信息部分 HTML 的显示方式,非默认将导致某些字段
  • glus(美国的默认值)接收来自特定国家/地区的结果的国家/地区代码
>>> import play_scraper
>>> print(play_scraper.suggestions('cat'))
['cat games', 'cats', 'cat simulator', 'catan', 'cats in the cradle']

搜索

获取与搜索查询匹配的应用程序列表。一次检索20应用程序。

选项:

  • query要搜索的查询词。
  • page(默认 0,最大 12)要检索的结果的页码。
  • detailed(默认为 False)如果为 True,则为每个应用程序发送一个请求以获取详细信息,如details中所示。
  • hl(默认en为英语)接收特定语言结果 的语言代码
    • None注意:由于应用程序的附加信息部分 HTML 的显示方式,非默认将导致某些字段
  • glus(美国的默认值)接收来自特定国家/地区的结果的国家/地区代码
>>> import play_scraper
>>> print(play_scraper.search('dogs', page=2))
[ { 'app_id': 'com.tivola.doghotel',
    'description': 'Be head of your own hotel and care for labradors, terrier and many more dogs!',
    'developer': 'Tivola',
    'developer_id': '8927372468482477196',
    'free': True,
    'full_price': None,
    'icon': 'https://lh3.googleusercontent.com/_PS_uqG8tjaqS014cN4bNUxQlHKsICWPW6bALReSrpK85CdI-ZkUOA3MT-vO20mVCP1w',
    'price': '0',
    'score': '4.4',
    'title': 'DogHotel : My Dog Boarding Kennel',
    'url': 'https://play.google.com/store/apps/details?id=com.tivola.doghotel'},
  { 'app_id': 'com.clan.of.dogs',
    'description': 'Clan of Dogs 3D Animal Adventure Simulator',
    'developer': 'Wild Foot Games',
    'developer_id': '6061726228463739055',
    'free': True,
    'full_price': None,
    'icon': 'https://lh3.googleusercontent.com/JO2cxKk5L3onmu2dchAeRRZyWJuJ5q7veWenP7uSZfItcJLsq1pZPIEoDqc_QNOqp-Q',
    'price': '0',
    'score': '4.2',
    'title': 'Clan of Dogs',
    'url': 'https://play.google.com/store/apps/details?id=com.clan.of.dogs'}, ...]

相似的

获取类似应用程序的列表。

选项:

  • app_id要获取的应用程序 ID,例如com.supercell.clashofclans《部落冲突》。
  • results(默认 24,最大 60)要获取的应用程序数量。
  • detailed(默认为 False)如果为 True,则为每个应用程序发送一个请求以获取详细信息,如details中所示。
  • hl(默认en为英语)接收特定语言结果 的语言代码
    • None注意:由于应用程序的附加信息部分 HTML 的显示方式,非默认将导致某些字段
  • glus(美国的默认值)接收来自特定国家/地区的结果的国家/地区代码
>>> import play_scraper
>>> print(play_scraper.similar('com.supercell.clashofclans', results=5))
[ { 'app_id': 'com.supercell.clashroyale',
    'description': 'Clash Royale is a real-time, head-to-head battle game set in the Clash Universe.',
    'developer': 'Supercell',
    'developer_id': '6715068722362591614',
    'free': True,
    'full_price': None,
    'icon': 'https://lh3.googleusercontent.com/K-MNjDiO2WwRNwJqPZu8Wd5eOmFEjLYkEEgjZlv35hTiua_VylRPb04Lig3YZXLERvI',
    'price': '0',
    'score': '4.6',
    'title': 'Clash Royale',
    'url': 'https://play.google.com/store/apps/details?id=com.supercell.clashroyale'},
  { 'app_id': 'com.supercell.boombeach',
    'description': 'Storm the beach and win the day!',
    'developer': 'Supercell',
    'developer_id': '6715068722362591614',
    'free': True,
    'full_price': None,
    'icon': 'https://lh3.googleusercontent.com/sw4Zb0qt_0-Iqm4YHpXEaGhmj6e3GlHmYroBI8oBuBr4JpRnFF37VmMDaqLMT-MDvhg',
    'price': '0',
    'score': '4.5',
    'title': 'Boom Beach',
    'url': 'https://play.google.com/store/apps/details?id=com.supercell.boombeach'}, ...]

类别

获取可用类别的列表。

选项:

  • hl(默认en为英语)接收特定语言结果 的语言代码
    • None注意:由于应用程序的附加信息部分 HTML 的显示方式,非默认将导致某些字段
  • glus(美国的默认值)接收来自特定国家/地区的结果的国家/地区代码
>>> import play_scraper
>>> play_scraper.categories()
{'ANDROID_WEAR': { 'category_id': 'ANDROID_WEAR',
                 'name': 'Wear OS by Google',
                 'url': 'https://play.google.com/store/apps/category/ANDROID_WEAR'},
 'ART_AND_DESIGN': { 'category_id': 'ART_AND_DESIGN',
                     'name': 'Art & Design',
                     'url': 'https://play.google.com/store/apps/category/ART_AND_DESIGN'}, ...}

测试

运行测试:

make test

项目详情