VK icon

VK

Работа с API ВКонтакте (личная страница)

👥 Сбор аудитории → Список друзей

AI-generated

Summary

Retrieve a list of friends for a specified VK user, optionally customizing the sort order, profile fields, and pagination.

Inputs

  • ID пользователя — The VK user ID whose friends to list; use 0 for the current authenticated user.
  • Сортировка — Sorting order of friends list: by ranking (hints), randomly, or by name.
  • Количество — Maximum number of friends to return in a single request (1-5000).
  • Поля профиля — Comma-separated list of profile fields to include for each friend (e.g., photo_200,city,online).
  • Смещение — Offset from which to start listing friends (used when auto-pagination is disabled).
  • Авто-пагинация — If enabled, automatically fetch all pages up to max items, ignoring offset.
  • Размер страницы — Number of friends to fetch per API request when auto-pagination is enabled (1-1000).
  • Максимум элементов — Total maximum number of friends to return when auto-pagination is enabled.

Output shape

a list of friend objects, each containing requested profile fields

Supports pagination via offset or auto-pagination. Each output item corresponds to a friend's data. Errors are handled per item if continueOnFail is enabled.

Examples

Example 1: Retrieve up to 1000 friends of the current user, including photo and online status, sorted by rating.

Set 'ID пользователя' to 0, 'Сортировка' to 'По рейтингу', 'Количество' to 1000, 'Поля профиля' to 'photo_200,city,online', enable 'Авто-пагинация' with 'Размер страницы' 500 and 'Максимум элементов' 1000.

Links

Discussion