K
K
Konstantin Teploukhov2019-01-05 20:16:34
API
Konstantin Teploukhov, 2019-01-05 20:16:34

API VK. How to know the number of friends correctly?

Hello, I am making this request.

string friend_get = request.Get("https://api.vk.com/method/friends.get?"
                            + "&user_id=" + userID
                            + "&fields=nickname"
                            + "&access_token=" + token).ToString();

In response I get something like
Cry
{"response":[{"uid":227572,"first_name":"Елена","last_name":"Коробова","nickname":"~ La Luz ~","online":0,"user_id":227572},{"uid":8756522,"first_name":"Денис","last_na

Then I count the number of words
first_name

This is a cruel crutch ... how do I get exactly the number of all friends.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stockholm Syndrome, 2019-01-05
@blood-moon

add the version to the query parameters v=5.92
then something like this will come

{
  "response": {
    "count": 3,
    "items": [5485951, 84317567, 997521] 
  }
}

where countis the number of friends

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question