Answer the question
In order to leave comments, you need to log in
How to get a list of all group members?
For example, I took a group id123377669, numbering 11293 people, tried to make a request, but in response I get an array of exactly 293 people ... What am I doing wrong? Thank you!
var members = API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"0"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"1000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"2000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"3000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"4000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"5000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"6000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"7000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"8000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"9000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"10000"});
members = members + API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"11000"});
return members;
function GetVK($url, $params) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); //CURLOPT_IPRESOLVE_V4);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
$Group = json_decode(GetVK('https://api.vk.com/method/execute', array(
'code' => $code,
'access_token' => $System['access_token'],
'v' => $System['api_ver']
)), true);
Answer the question
In order to leave comments, you need to log in
helped to add to the end of the query}).items;
API.groups.getMembers({"group_id":"123377669","count":"1000","offset":"0"}).items;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question