Developers » API methods » Friends » friends.get
Friendsfriends.get
Returns a list of user IDs or detailed information about a user's friends.
If you use VK user's social graph in your application, please, note section 4.4. of Platform Rules.
This method can be called by a service token. Only public data is returned.
This method can be called with a user token.
Parameters
user_idUser ID. By default, the current user ID.
int (number)
orderSort order:
  • hints — by rating, similar to how friends are sorted in My friends section. (This order can be returned only with a user token received in Standalone-app via Implicit Flow);
  • random — random order;
  • mobile — in the first places returns friends with mobile apps installed;
  • name — by name (enabled only if the fields parameter is used). Note that this sorting type is slow.

By default the list is sorted in ascending order of user IDs.
string
list_idID of the friend list returned by the friends.getLists method to be used as the source. This parameter is taken into account only when the user_id parameter is set to the current user ID.

This parameter is available only with a user token received in Standalone-app via Implicit Flow.
positive number
countNumber of friends to return.
positive number, default 5000
offsetOffset needed to return a specific subset of friends.
positive number
fieldsProfile fields to return. Sample values: nickname, domain, sex, bdate, city, country, timezone, photo_50, photo_100, photo_200_orig, has_mobile, contacts, education, online, relation, last_seen, status, can_write_private_message, can_see_all_posts, can_post, universities.
list of comma-separated words
name_caseCase for declension of user name and surname:
  • nom — nominative (by default);
  • gen — genitive;
  • dat — dative;
  • acc — accusative;
  • ins — instrumental;
  • abl — prepositional.
string
ref
string, maximum length 255
Result
If the fields parameter is not used, returns the total results number in count field and an array of IDs (id) of the user's friends.

If the fields parameter is used, returns the total results number in count field and an array of objects describing users in items field.

Returns not more than 5000 friends if fields are used.
Errors
30This profile is private
Global errors can occur while running. See their descriptions on this page.
Version historyShow all
5.8
Fields city and country in fields return object instead of id.