A
A
Alex Smith2015-06-12 01:47:38
In contact with
Alex Smith, 2015-06-12 01:47:38

Is it possible to find out the number of friends in a group\public from a specific user through api vk.com?

There are users in the group, they have friends who are also members of this group or not. You need to find out who has the most friends in the group.
At the moment, using groups.getMembers, I collect all users. Then, using friends.get, I collect the friends of these users. Then, by querying the database, I find out who has the most friends in the group. The server is bending down.. With 4k people in the community, the number of records in the database is about 800k.
Does the vk.com api have a method to directly query who has how many friends in the group?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
entermix, 2015-06-12
@entermix

Does the vk.com api have a direct request method for who has how many friends in a group?

No
1. Get a list of all community members: groups.getMembers (max 1000/1 request)
2. Get a list of all friends of each user: friends.get (all friends/1 request)
3. Get information about whether the user is a friend community member:
groups.isMember (max 500/1 request)
To speed up the process, use the execute method

A
AlPaco, 2017-11-08
@AlPaco

api.vk.com/method/groups.getMembers?group_id={GROUP ID}&flter=friends&v=5.69

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question