借助开源JS项目https://github.com/facundoolano/google-play-scraper#list
主要有以下几个API
app: Retrieves the full detail of an application.
list: Retrieves a list of applications from one of the collections at Google Play.
search: Retrieves a list of apps that results of searching by the given term.
developer: Returns the list of applications by the given developer name.
suggest: Given a string returns up to five suggestion to complete a search query term.
reviews: Retrieves a page of reviews for a specific application.
similar: Returns a list of similar apps to the one specified.
permissions: Returns the list of permissions an app has access to.
categories: Retrieve a full list of categories present from dropdown menu on Google Play.
API功能
App
1. 根据Google Play 包名获取App的信息
var gplay = require('google-play-scraper');
gplay.app({appId: 'com.google.android.apps.translate'})
.then(console.log, console.log);
这个并不会在一开始用,因为Google Play的包名一开始并不知道。往往需要先获取到包名,再调用这个API
List
根据分类,国家,排名获取App列表,这个是最常用。
var gplay = require('google-play-scraper');
gplay.list({
category: gplay.category.GAME_ACTION,
collection: gplay.collection.TOP_FREE,
num: 2
})
.then(console.log, console.log);
我们需要采集的类型和地区有
var categories = new Array(
gplay.category.EDUCATION,
gplay.category.WEATHER,
gplay.category.TOOLS,
gplay.category.TRAVEL_AND_LOCAL,
gplay.category.SPORTS,
gplay.category.SOCIAL,
gplay.category.NEWS_AND_MAGAZINES,
gplay.category.LIFESTYLE,
gplay.category.HEALTH_AND_FITNESS,
gplay.category.ENTERTAINMENT,
gplay.category.SHOPPING)
地区是:
var counrties = new Array(
'us',
'uk',
'th',
'in',
'jp',
)