google-play-scraper
google-play-scraper copied to clipboard
Variable number of reviews returned
The reviews methods seems to return a different number of reviews on each call. I slightly modified the example in the documentation to reproduce the issue:
import gplay from "google-play-scraper";
gplay.reviews({
appId: 'com.facebook.katana',
num: 3000
}).then(function(apps){
console.log(apps.data.length);
}, console.log);
When called multiple times the output is :
300
300
150
150
150
150
1200
This used to work in the past, getting hundreds of thousands of reviews in a single call
In this sister project they have encountered the same issue. Here I provided a workaround around the issue that appears to be working. I would submit a PR to fix the issue but my JavaScript skills are fairly limited.
comment edited - pagination is built-in, just implement cookieJar
Variance in response seems to come from Google's loadbalancer picking different backend that doesn't know about our nextPaginationToken
and responds with error. Providing NID
cookie (that stores user prefs & ad data) gives me constant results.
PR on the way, in a meanwhile you can test with my fork.