I
I
Ilkhomjon Matazimov2020-04-22 12:37:25
JavaScript
Ilkhomjon Matazimov, 2020-04-22 12:37:25

Friends.get count returns a maximum of 5k items. How to decide?

Good day.
I have this request:

https://api.vk.com/method/friends.get?count=10000&fields=${$fields}&access_token=${$token}&v=5.103


Responsereturns only a maximum of 5k items, and without a parameter fields- I get all 10k.
How to solve it?

In addition, there is also filtering:
$humans = await data.response.items.filter(function($humans) {
    return $humans.last_seen && $humans.last_seen.time > (time() - $1day)
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBird Rose, 2020-04-22
@mr_qpdb

use offset
set offset=0, count=5000 and get 0-5000.
then you set offset=5000, count=5000 and you get 5001-10000.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question