S
S
SMedin2016-02-01 12:34:14
In contact with
SMedin, 2016-02-01 12:34:14

VK API: how to implement search by age among friends of another user?

To get a list of friends of another user (by id), I use the friends.get method . This method is able to return the field "bdate" (date of birth), but it is not always possible to determine the age from this field, because for someone this field is hidden in the profile, for someone the year of birth is hidden.
Is there a VK API method that allows you to search for a user's friends by age? This functionality is implemented in the web interface:
n6cg7qPrubU.jpg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
riot26, 2016-02-01
@riot26

Is there a VK API method that allows you to search for a user's friends by age?

No, you have to drag everyone and check the age

A
AltQ, 2016-02-01
@AltQ

There is no such method in the VK API, but no one bothers to make a request to the address "vk.com/friends" with the necessary parameters, in response to which a structure containing user IDs will come. True, authorization is required to fully receive it.
For example, a request to

vk.com/friends?act=filter_friends&age_from=20&age_to=21&al=1&city=0&sex=2&uid=1
will return
<!--19037<!><!>0<!>6693<!>0<!><!json>["11481439","16148679","132570235","2203645","9147420","19187792","21524190","53101632","15915916","4280695","48805326","6125743","97023942","2783717","88636728","177234275","6053012","28078"]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question