Skip to content

Instantly share code, notes, and snippets.

@sangheestyle
Last active September 23, 2019 13:36
Show Gist options
  • Save sangheestyle/ce8436cd74e59771fe9a to your computer and use it in GitHub Desktop.
Save sangheestyle/ce8436cd74e59771fe9a to your computer and use it in GitHub Desktop.
Get reviews from google play
var request = require('request');
var cheerio = require('cheerio');
// Set the headers
var headers = { 'User-Agent': 'Wild/0.0.1'
, 'Content-Type': 'application/x-www-form-urlencoded'
}
// Configure the request
var options = { url: 'https://play.google.com/store/getreviews'
, method: 'POST'
, headers: headers
, form: { 'reviewType': 0
, 'pageNum': 1
, 'id': 'com.github.mobile'
, 'reviewSortOrder': 2
}
}
// Start the request
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
var htmlString = JSON.parse(body.slice(7, -1))[2];
var reviews = [];
$ = cheerio.load(htmlString);
$('.single-review').each(function(i, elem) {
reviews[i] = $(this).text();
});
console.log(reviews[0]);
}
})
Dave Miyares March 7, 2015 Needs work. Can't log out or have 2nd account? I have an account at work and a personal account but have been unable to figure out how to set up two accounts or even log out. Full Review
@MobileSam
Copy link

I used this script and for some reason, I had to ask request to use ipv6 specifically.

I added this below headers:
family: 6

@MobileSam
Copy link

Finally, this API stopped working on Sept. 5th 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment