M
M
Mitya ToDaSyo2018-12-14 16:59:05
In contact with
Mitya ToDaSyo, 2018-12-14 16:59:05

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;

I send the request via curl
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);

$code is the request, which at the beginning of the topic

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mitya ToDaSyo, 2018-12-14
@dimastik1986

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 question

Ask a Question

731 491 924 answers to any question