Title: | Access to VK API via R |
---|---|
Description: | Provides an interface to the VK API <https://vk.com/dev/methods>. VK <https://vk.com/> is the largest European online social networking service, based in Russia. |
Authors: | Dmitriy Sorokin [aut, cre], Anton Antonov [ctb] |
Maintainer: | Dmitriy Sorokin <[email protected]> |
License: | GPL-3 |
Version: | 0.2 |
Built: | 2025-03-10 04:34:58 UTC |
Source: | https://github.com/dementiy/vkr |
Predict age for the specified user
age_predict(user_id = "")
age_predict(user_id = "")
user_id |
User ID |
Checks the friendship status between two users
areFriends(source_id, target_id)
areFriends(source_id, target_id)
source_id |
Source user ID |
target_id |
Target user ID |
## Not run: areFriends(me(), 123456) ## End(Not run)
## Not run: areFriends(me(), 123456) ## End(Not run)
Returns a list of comments on a topic on a community's discussion board
boardGetComments( group_id = "", topic_id = "", need_likes = 0, start_comment_id = "", offset = 0, count = 20, sort = "", extended = 0, v = getAPIVersion() )
boardGetComments( group_id = "", topic_id = "", need_likes = 0, start_comment_id = "", offset = 0, count = 20, sort = "", extended = 0, v = getAPIVersion() )
group_id |
ID of the community that owns the discussion board. |
topic_id |
Topic ID. |
need_likes |
1 - to return the likes field, 0 - not to return the likes field (default). |
start_comment_id |
Positive number. |
offset |
Offset needed to return a specific subset of comments. |
count |
Number of comments to return (default 20, maximum 100). |
sort |
Sort order: asc - chronological, desc - reverse chronological. |
extended |
1 — to return information about users who posted comments; 0 — to return no additional fields (default). |
v |
Version of API |
Returns a list of comments on a topic on a community's discussion board
boardGetCommentsExecute( group_id = "", topic_id = "", need_likes = 0, start_comment_id = "", offset = 0, count = 20, sort = "", progress_bar = FALSE, v = getAPIVersion() )
boardGetCommentsExecute( group_id = "", topic_id = "", need_likes = 0, start_comment_id = "", offset = 0, count = 20, sort = "", progress_bar = FALSE, v = getAPIVersion() )
group_id |
ID of the community that owns the discussion board. |
topic_id |
Topic ID. |
need_likes |
1 - to return the likes field, 0 - not to return the likes field (default). |
start_comment_id |
Positive number. |
offset |
Offset needed to return a specific subset of comments. |
count |
Number of comments to return (default 20, 0 - for all comments). |
sort |
Sort order: asc - chronological, desc - reverse chronological. |
progress_bar |
Display progress bar. |
v |
Version of API |
Returns a list of comments on a community's discussion board
boardGetCommentsList(topics, progress_bar = FALSE, v = getAPIVersion())
boardGetCommentsList(topics, progress_bar = FALSE, v = getAPIVersion())
topics |
A list of topics (from getTopicsExecute()) |
progress_bar |
Display progress bar |
v |
Version of API |
Clear text
clear_text(lines, patterns = list())
clear_text(lines, patterns = list())
lines |
List of lines |
patterns |
List of user defined patterns |
Check if collection exists
collection_exists( collection_name, collection_suffix = "", db_name = db_getActive() )
collection_exists( collection_name, collection_suffix = "", db_name = db_getActive() )
collection_name |
Collection name |
collection_suffix |
Collection suffix |
db_name |
Database name |
Create empty collection
create_empty_collection(collection, suffix, db_name = db_getActive())
create_empty_collection(collection, suffix, db_name = db_getActive())
collection |
Collection name |
suffix |
Collection suffix |
db_name |
Database name |
Returns list of chairs on a specified faculty
databaseGetChairs( faculty_id = "", offset = "", count = "100", v = getAPIVersion() )
databaseGetChairs( faculty_id = "", offset = "", count = "100", v = getAPIVersion() )
faculty_id |
ID of the faculty to get chairs from |
offset |
Offset required to get a certain subset of chairs |
count |
Amount of chairs to get |
v |
Version of API |
## Not run: databaseGetChairs(206) ## End(Not run)
## Not run: databaseGetChairs(206) ## End(Not run)
Returns a list of cities
databaseGetCities( country_id = "", region_id = "", q = "", need_all = "1", offset = "", count = "100", v = getAPIVersion() )
databaseGetCities( country_id = "", region_id = "", q = "", need_all = "1", offset = "", count = "100", v = getAPIVersion() )
country_id |
Country ID |
region_id |
Region ID |
q |
Search query |
need_all |
1 - to return all cities in the country; 0 - to return major cities in the country (default) |
offset |
Offset needed to return a specific subset of cities |
count |
Number of cities to return |
v |
Version of API |
## Not run: databaseGetCities(country_id=1, need_all=0) ## End(Not run)
## Not run: databaseGetCities(country_id=1, need_all=0) ## End(Not run)
Returns information about cities by their IDs
databaseGetCitiesById(city_ids = "", v = getAPIVersion())
databaseGetCitiesById(city_ids = "", v = getAPIVersion())
city_ids |
City IDs |
v |
Version of API |
## Not run: databaseGetCitiesById('1,2') ## End(Not run)
## Not run: databaseGetCitiesById('1,2') ## End(Not run)
Returns a list of countries
databaseGetCountries( need_all = "1", code = "", offset = "", count = "100", v = getAPIVersion() )
databaseGetCountries( need_all = "1", code = "", offset = "", count = "100", v = getAPIVersion() )
need_all |
1 - to return a full list of all countries; 0 - to return a list of countries near the current user's country |
code |
Country codes in ISO 3166-1 alpha-2 standard |
offset |
Offset needed to return a specific subset of countries |
count |
Number of countries to return |
v |
Version of API |
## Not run: databaseGetCountries(count=234) ## End(Not run)
## Not run: databaseGetCountries(count=234) ## End(Not run)
Returns information about countries by their IDs
databaseGetCountriesById(country_ids, v = getAPIVersion())
databaseGetCountriesById(country_ids, v = getAPIVersion())
country_ids |
Country IDs |
v |
Version of API |
## Not run: databaseGetCountriesById('1,2,3,4') ## End(Not run)
## Not run: databaseGetCountriesById('1,2,3,4') ## End(Not run)
Returns a list of faculties (i.e., university departments)
databaseGetFaculties( university_id = "", offset = "", count = "100", v = getAPIVersion() )
databaseGetFaculties( university_id = "", offset = "", count = "100", v = getAPIVersion() )
university_id |
University ID |
offset |
Offset needed to return a specific subset of faculties |
count |
Number of faculties to return |
v |
Version of API |
## Not run: databaseGetFaculties(53) ## End(Not run)
## Not run: databaseGetFaculties(53) ## End(Not run)
Returns a list of regions
databaseGetRegions( country_id = "", q = "", offset = "", count = "100", v = getAPIVersion() )
databaseGetRegions( country_id = "", q = "", offset = "", count = "100", v = getAPIVersion() )
country_id |
Country ID, received in database.getCountries method |
q |
Search query |
offset |
Offset needed to return specific subset of regions |
count |
Number of regions to return |
v |
Version of API |
## Not run: databaseGetRegions(229) ## End(Not run)
## Not run: databaseGetRegions(229) ## End(Not run)
Returns a list of available classes
databaseGetSchoolClasses(country_id = "", v = getAPIVersion())
databaseGetSchoolClasses(country_id = "", v = getAPIVersion())
country_id |
Country ID |
v |
Version of API |
## Not run: databaseGetSchoolClasses(1) ## End(Not run)
## Not run: databaseGetSchoolClasses(1) ## End(Not run)
Returns a list of schools
databaseGetSchools( q = "", city_id = "", offset = "", count = "100", v = getAPIVersion() )
databaseGetSchools( q = "", city_id = "", offset = "", count = "100", v = getAPIVersion() )
q |
Search query |
city_id |
City ID |
offset |
Offset needed to return a specific subset of schools |
count |
Number of schools to return |
v |
Version of API |
## Not run: databaseGetSchools(city_id = 2) ## End(Not run)
## Not run: databaseGetSchools(city_id = 2) ## End(Not run)
Returns information about streets by their IDs
databaseGetStreetsById(street_ids = "", v = getAPIVersion())
databaseGetStreetsById(street_ids = "", v = getAPIVersion())
street_ids |
Street IDs |
v |
Version of API |
## Not run: databaseGetStreetsById(1) ## End(Not run)
## Not run: databaseGetStreetsById(1) ## End(Not run)
Returns a list of higher education institutions
databaseGetUniversities( q = "", country_id = "", city_id = "", offset = "", count = "100", v = getAPIVersion() )
databaseGetUniversities( q = "", country_id = "", city_id = "", offset = "", count = "100", v = getAPIVersion() )
q |
Search query |
country_id |
Country ID |
city_id |
City ID |
offset |
Offset needed to return a specific subset of universities |
count |
Number of universities to return |
v |
Version of API |
## Not run: databaseGetUniversities(city_id = '2') ## End(Not run)
## Not run: databaseGetUniversities(city_id = '2') ## End(Not run)
Drop database
db_drop(db_name)
db_drop(db_name)
db_name |
Database name |
Drop collection
db_drop_collection( collection_name, collection_suffix = "", db_name = db_getActive() )
db_drop_collection( collection_name, collection_suffix = "", db_name = db_getActive() )
collection_name |
Collection name |
collection_suffix |
Collection suffix |
db_name |
Database name |
Get collection
db_get_collection( collection_name, collection_suffix = "", db_name = db_getActive() )
db_get_collection( collection_name, collection_suffix = "", db_name = db_getActive() )
collection_name |
Collection name |
collection_suffix |
Collection suffix |
db_name |
Database name |
Get a mongo connection object
db_get_connection( collection_name, collection_suffix = "", db_name = db_getActive() )
db_get_connection( collection_name, collection_suffix = "", db_name = db_getActive() )
collection_name |
Collection name |
collection_suffix |
Collection suffix |
db_name |
Database name |
Initialize database
db_init(db_name = "temp", verbose = FALSE)
db_init(db_name = "temp", verbose = FALSE)
db_name |
Database name ('temp' by default) |
verbose |
Emit some more output |
Insert object into existing collection
db_insert(object, collection, suffix, db_name = db_getActive())
db_insert(object, collection, suffix, db_name = db_getActive())
object |
Object to insert |
collection |
Collection name |
suffix |
Collection suffix |
db_name |
Database name |
Load all collections from db for specified data base
db_load(db_name = db_getActive())
db_load(db_name = db_getActive())
db_name |
Database name |
Load collection from db
db_load_collection( collection_name, collection_suffix = "", db_name = db_getActive() )
db_load_collection( collection_name, collection_suffix = "", db_name = db_getActive() )
collection_name |
Collection name |
collection_suffix |
Collection suffix |
db_name |
Database name |
Save object to db
db_save(object, collection, suffix = "", db_name = db_getActive())
db_save(object, collection, suffix = "", db_name = db_getActive())
object |
Object to save |
collection |
Collection name |
suffix |
Collection suffix |
db_name |
Database name |
Update existing records
db_update( object, key, collection, suffix = "", db_name = db_getActive(), upsert = FALSE )
db_update( object, key, collection, suffix = "", db_name = db_getActive(), upsert = FALSE )
object |
Object to insert |
key |
Key |
collection |
Collection name |
suffix |
Collection suffix |
db_name |
Database name |
upsert |
Insert a new document if no matching document exists |
A universal method for calling a sequence of other methods while saving and filtering interim results
execute(code, params = list())
execute(code, params = list())
code |
Algorithm code in VKScript |
params |
Parameters list |
Filtering attachments by type
filterAttachments(attachments, type)
filterAttachments(attachments, type)
attachments |
List of attachments |
type |
type field may have the following values:
|
Get stop words list for russian language
get_stop_words(stop_words = c())
get_stop_words(stop_words = c())
stop_words |
User defined stop words |
Building a friend graph for an arbitrary list of users
getArbitraryNetwork(users_ids, format = "edgelist")
getArbitraryNetwork(users_ids, format = "edgelist")
users_ids |
User IDs |
format |
Either "edgelist" for a list of edges or "adjmatrix" for an adjacency matrix |
Get country ID and title by given city ID
getCountryByCityId(city_id)
getCountryByCityId(city_id)
city_id |
City ID |
Building a friend graph
getEgoNetwork(users_ids = "")
getEgoNetwork(users_ids = "")
users_ids |
User IDs |
Returns a list of user IDs or detailed information about a user's friends
getFriends( user_id = "", order = "", list_id = "", count = "", offset = "", fields = "", name_case = "", flatten = FALSE, v = getAPIVersion() )
getFriends( user_id = "", order = "", list_id = "", count = "", offset = "", fields = "", name_case = "", flatten = FALSE, v = getAPIVersion() )
user_id |
User ID. By default, the current user ID |
order |
Sort order (name - by name, hints - by rating) |
list_id |
ID 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 uid parameter is set to the current user ID |
count |
Number of friends to return |
offset |
Offset needed to return a specific subset of friends |
fields |
Profile fields to return |
name_case |
Case for declension of user name and surname |
flatten |
Automatically flatten nested data frames into a single non-nested data frame |
v |
Version of API |
## Not run: friends_list <- getFriends(user_id=1, order='name', fields='bdate') friends <- friends_list$items ## End(Not run)
## Not run: friends_list <- getFriends(user_id=1, order='name', fields='bdate') friends <- friends_list$items ## End(Not run)
Returns a list of friends IDs for the specified users
getFriendsBy25(user_ids, v = getAPIVersion())
getFriendsBy25(user_ids, v = getAPIVersion())
user_ids |
User IDs (maximum 25) |
v |
Version of API |
## Not run: my_friends <- getFriends() friends_of_friends <- getFriendsBy25(my_friends$items[1:25]) ## End(Not run)
## Not run: my_friends <- getFriends() friends_of_friends <- getFriendsBy25(my_friends$items[1:25]) ## End(Not run)
Returns a list of friends IDs for the specified users
getFriendsFor(users_ids, v = getAPIVersion())
getFriendsFor(users_ids, v = getAPIVersion())
users_ids |
User IDs |
v |
Version of API |
## Not run: friends <- getFriendsFor(sample(x=seq(1:10000000), size=100, replace=FALSE)) users <- getUsersExecute(friends, fields = 'sex') ## End(Not run)
## Not run: friends <- getFriendsFor(sample(x=seq(1:10000000), size=100, replace=FALSE)) users <- getUsersExecute(friends, fields = 'sex') ## End(Not run)
Returns a list of the communities to which a user belongs
getGroups( user_id = "", extended = "", filter = "", fields = "", offset = "", count = "", v = getAPIVersion() )
getGroups( user_id = "", extended = "", filter = "", fields = "", offset = "", count = "", v = getAPIVersion() )
user_id |
User ID |
extended |
1 - to return complete information about a user's communities; 0 - to return a list of community IDs without any additional fields (default) |
filter |
Types of communities to return: admin, editor, moder, groups, publics, events |
fields |
List of additional fields to be returned |
offset |
Offset needed to return a specific subset of communities |
count |
Number of communities to return (maximum value 1000) |
v |
Version of API |
## Not run: groups <- getGroups(me(), extended = 1, fields = 'city') ## End(Not run)
## Not run: groups <- getGroups(me(), extended = 1, fields = 'city') ## End(Not run)
Returns information about communities by their IDs
getGroupsById(group_ids = "", group_id = "", fields = "", v = getAPIVersion())
getGroupsById(group_ids = "", group_id = "", fields = "", v = getAPIVersion())
group_ids |
IDs or screen names of communities |
group_id |
ID or screen name of the community |
fields |
Group fields to return |
v |
Version of API |
Returns a list of the communities for the specified users
getGroupsForUsers( users, extended = "", filter = "", fields = "", progress_bar = FALSE, v = getAPIVersion() )
getGroupsForUsers( users, extended = "", filter = "", fields = "", progress_bar = FALSE, v = getAPIVersion() )
users |
A list of users |
extended |
1 - to return complete information about a user's communities; 0 - to return a list of community IDs without any additional fields (default) |
filter |
Types of communities to return: admin, editor, moder, groups, publics, events |
fields |
List of additional fields to be returned |
progress_bar |
Display progress bar |
v |
Version of API |
## Not run: members <- getGroupsForUsers(c(me(), 123456), extended = 1, fields='city', progress_bar = TRUE) ## End(Not run)
## Not run: members <- getGroupsForUsers(c(me(), 123456), extended = 1, fields='city', progress_bar = TRUE) ## End(Not run)
Returns a list of community members
getGroupsMembers( group_id = "", sort = "", offset = "", count = "", fields = "", filter = "", v = getAPIVersion() )
getGroupsMembers( group_id = "", sort = "", offset = "", count = "", fields = "", filter = "", v = getAPIVersion() )
group_id |
ID or screen name of the community |
sort |
Sort order |
offset |
Offset needed to return a specific subset of community members |
count |
Number of community members to return (maximum value 1000) |
fields |
List of additional fields to be returned |
filter |
friends - only friends in this community will be returned; unsure - only those who pressed 'I may attend' will be returned (if it's an event) |
v |
Version of API |
## Not run: members <- getGroupsMembers(1, fields='sex,bdate,city') ## End(Not run)
## Not run: members <- getGroupsMembers(1, fields='sex,bdate,city') ## End(Not run)
Returns a list of community members
getGroupsMembersExecute( group_id = "", sort = "", offset = 0, count = 0, fields = "", filter = "", flatten = FALSE, progress_bar = FALSE, v = getAPIVersion() )
getGroupsMembersExecute( group_id = "", sort = "", offset = 0, count = 0, fields = "", filter = "", flatten = FALSE, progress_bar = FALSE, v = getAPIVersion() )
group_id |
ID or screen name of the community |
sort |
Sort order. Available values: id_asc, id_desc, time_asc, time_desc. time_asc and time_desc are availavle only if the method is called by the group's moderator |
offset |
Offset needed to return a specific subset of community members |
count |
Number of community members to (0 - get all community members) |
fields |
List of additional fields to be returned |
filter |
friends - only friends in this community will be returned; unsure - only those who pressed 'I may attend' will be returned (if it's an event) |
flatten |
Automatically flatten nested data frames into a single non-nested data frame |
progress_bar |
Display progress bar |
v |
Version of API |
## Not run: members <- getGroupsMembersExecute(1, fields='sex,bdate,city', progress_bar = TRUE) ## End(Not run)
## Not run: members <- getGroupsMembersExecute(1, fields='sex,bdate,city', progress_bar = TRUE) ## End(Not run)
Returns a list of user IDs of the mutual friends of two users
getMutual( source_id = "", target_uid = "", target_uids = "", order = "", count = "", offset = "", v = getAPIVersion() )
getMutual( source_id = "", target_uid = "", target_uids = "", order = "", count = "", offset = "", v = getAPIVersion() )
source_id |
ID of the user whose friends will be checked against the friends of the user specified in target_uid |
target_uid |
ID of the user whose friends will be checked against the friends of the user specified in source_uid |
target_uids |
List of target uids (list of comma-separated positive numbers, the maximum number of elements allowed is 100) |
order |
Sort order |
count |
Number of mutual friends to return |
offset |
Offset needed to return a specific subset of mutual friends |
v |
Version of API |
## Not run: mutual_friends <- getMutual(target_uid=1) ## End(Not run)
## Not run: mutual_friends <- getMutual(target_uid=1) ## End(Not run)
Returns a list of user IDs of the mutual friends of two users
getMutualExecute( source_id = "", target_uid = "", target_uids = "", order = "", count = "", offset = "", progress_bar = FALSE, v = getAPIVersion() )
getMutualExecute( source_id = "", target_uid = "", target_uids = "", order = "", count = "", offset = "", progress_bar = FALSE, v = getAPIVersion() )
source_id |
ID of the user whose friends will be checked against the friends of the user specified in target_uid |
target_uid |
ID of the user whose friends will be checked against the friends of the user specified in source_uid |
target_uids |
List of target uids |
order |
Sort order |
count |
Number of mutual friends to return |
offset |
Offset needed to return a specific subset of mutual friends |
progress_bar |
Display progress bar |
v |
Version of API |
## Not run: mutual_friends <- getMutualExecute(target_uid=1) ## End(Not run)
## Not run: mutual_friends <- getMutualExecute(target_uid=1) ## End(Not run)
Returns a list of paths between two users
getPaths(source_id, target_id, are_friends = FALSE, max_depth = 5)
getPaths(source_id, target_id, are_friends = FALSE, max_depth = 5)
source_id |
Source ID |
target_id |
Target ID |
are_friends |
By default is FALSE |
max_depth |
Maximum depth |
Returns data required to show the status of a users and/or communities
getStatus( users_ids = c(), groups_ids = c(), progress_bar = FALSE, v = getAPIVersion() )
getStatus( users_ids = c(), groups_ids = c(), progress_bar = FALSE, v = getAPIVersion() )
users_ids |
User IDs |
groups_ids |
Community IDs |
progress_bar |
Display progress bar |
v |
Version of API |
## Not run: status.me <- getStatus() status.friends <- getStatus(users_ids = getFriends()$items) status.groups <- getStatus(groups_ids = getGroups()$items) status.friends_and_groups <- getStatus(users_ids = getFriends()$items, groups_ids = getGroups()$items, progress_bar = T) ## End(Not run)
## Not run: status.me <- getStatus() status.friends <- getStatus(users_ids = getFriends()$items) status.groups <- getStatus(groups_ids = getGroups()$items) status.friends_and_groups <- getStatus(users_ids = getFriends()$items, groups_ids = getGroups()$items, progress_bar = T) ## End(Not run)
Returns a list of topics on a community's discussion board
getTopics( group_id = "", topics_ids = "", order = "", offset = 0, count = 40, extended = 0, preview = 0, preview_length = 90, v = getAPIVersion() )
getTopics( group_id = "", topics_ids = "", order = "", offset = 0, count = 40, extended = 0, preview = 0, preview_length = 90, v = getAPIVersion() )
group_id |
ID of the community that owns the discussion board. |
topics_ids |
IDs of topics to be returned (100 maximum). By default, all topics are returned. If this parameter is set, the order, offset, and count parameters are ignored. |
order |
Sort order:
If no sort order is specified, topics are returned in the order specified by the group administrator. Pinned topics are returned first, regardless of the sorting. |
offset |
Offset needed to return a specific subset of topics. |
count |
Number of topics to return (default 40, maximum value 100). |
extended |
1 — to return information about users who created topics or who posted there last; 0 — to return no additional fields (default). |
preview |
1 — to return the first comment in each topic; 2 — to return the last comment in each topic; 0 — to return no comments. |
preview_length |
Number of characters after which to truncate the previewed comment. To preview the full comment, specify 0. |
v |
Version of API |
Returns a list of topics on a community's discussion board
getTopicsExecute( group_id = "", order = "", offset = 0, count = 40, preview = 0, preview_length = 90, use_db = FALSE, db_params = list(), progress_bar = FALSE, v = getAPIVersion() )
getTopicsExecute( group_id = "", order = "", offset = 0, count = 40, preview = 0, preview_length = 90, use_db = FALSE, db_params = list(), progress_bar = FALSE, v = getAPIVersion() )
group_id |
ID of the community that owns the discussion board. |
order |
Sort order:
If no sort order is specified, topics are returned in the order specified by the group administrator. Pinned topics are returned first, regardless of the sorting. |
offset |
Offset needed to return a specific subset of topics. |
count |
Number of topics to return (default 40, 0 - for all topics). |
preview |
1 — to return the first comment in each topic; 2 — to return the last comment in each topic; 0 — to return no comments. |
preview_length |
Number of characters after which to truncate the previewed comment. To preview the full comment, specify 0. |
use_db |
Use database |
db_params |
Collection name and suffix |
progress_bar |
Display progress bar |
v |
Version of API |
Extract URLs from messages
getURLs(messages, message_body = FALSE)
getURLs(messages, message_body = FALSE)
messages |
Array of messages |
message_body |
Add message body to URLs |
Returns detailed information on users
getUsers( user_ids = "", fields = "", name_case = "nom", flatten = FALSE, v = getAPIVersion() )
getUsers( user_ids = "", fields = "", name_case = "nom", flatten = FALSE, v = getAPIVersion() )
user_ids |
User IDs or screen names (screen_name). By default, current user ID (the maximum number of elements allowed is 1000) |
fields |
Profile fields to return (see fetails for more information about fields) |
name_case |
Case for declension of user name and surname |
flatten |
Automatically flatten nested data frames into a single non-nested data frame |
v |
Version of API |
User object describes a user profile, contains the following fields:
uid User ID
first_name First name
last_name Last name
deactivated Returns if a profile is deleted or blocked. Gets the value deleted or banned. Keep in mind that in this case no additional fields are returned
hidden: 1 Returns while operating without access_token if a user has set the "Who can see my profile on the Internet" -> "Only VK users" privacy setting. Keep in mind that in this case no additional fields are returned
verified Returns 1 if the profile is verified, 0 if not
blacklisted Returns 1 if a current user is in the requested user's blacklist
sex User sex (1 - female; 2 - male; 0 - not specified)
bdate User's date of birth. Returned as DD.MM.YYYY or DD.MM (if birth year is hidden). If the whole date is hidden, no field is returned
city ID of the city specified on user's page in "Contacts" section. Returns city ID that can be used to get its name using places.getCityById method. If no city is specified or main information on the page is hidden for in privacy settings, then it returns 0
country ID of the country specified on user's page in "Contacts" section. Returns country ID that can be used to get its name using places.getCountryById method. If no country is specified or main information on the page is hidden in privacy settings, then it returns 0
home_town User's home town
photo_50 Returns URL of square photo of the user with 50 pixels in width. In case user does not have a photo, http://vk.com/images/camera_c.gif is returned
photo_100 Returns URL of square photo of the user with 100 pixels in width. In case user does not have a photo, http://vk.com/images/camera_b.gif is returned
photo_200_orig Returns URL of user's photo with 200 pixels in width. In case user does not have a photo, http://vk.com/images/camera_a.gif is returned
photo_200 Returns URL of square photo of the user with 200 pixels in width. If the photo was uploaded long time ago, there can be no image of such size and in this case the reply will not include this field
photo_400_orig Returns URL of user's photo with 400 pixels in width. If user does not have a photo of such size, reply will not include this field
photo_max Returns URL of square photo of the user with maximum width. Can be returned a photo both 200 and 100 pixels in width. In case user does not have a photo, http://vk.com/images/camera_b.gif is returned
photo_max_orig Returns URL of user's photo of maximum size. Can be returned a photo both 400 and 200 pixels in width. In case user does not have a photo, http://vk.com/images/camera_a.gif is returned
online Information whether the user is online. Returned values: 1 - online, 0 - offline. If user utilizes a mobile application or site mobile version, it returns online_mobile additional field that includes 1. With that, in case of application, online_app additional field is returned with application ID.
lists Information about friend lists. Returns IDs of friend lists the user is member of, separated with a comma. The field is available for friends.get method only. To get information about ID and names of friend lists use friends.getLists method. If user is not a member of any friend list, then when accepting data in XML format the respective <user> node does not contain <lists> tag
domain Page screen name. Returns a string with a page screen name (only subdomain is returned, like andrew). If not set, "id'+uid is returned, e.g. id35828305
has_mobile Information whether the user's mobile phone number is available. Returned values: 1 - available, 0 - not available. We recommend you to use it prior to call of secure.sendSMSNotification method
contacts Information about user's phone numbers. If data are available and not hidden in privacy settings, the following fields are returned (mobile_phone - user's mobile phone number (only for standalone applications); home_phone - user's additional phone number)
site Returns a website address from a user profile
education Information about user's higher education institution. The following fields are returned:
university University ID
university_name University name
faculty Faculty ID
faculty_name Faculty name
graduation Graduation year
universities List of higher education institutions where user studied. Returns universities array with university objects with the following fields:
id University ID
country ID of the country the university is located in
city ID of the city the university is located in
name University name
faculty Faculty ID
faculty_name Faculty name
chair University chair ID
chair_name Chair name
graduation Graduation year
schools List of schools where user studied in. Returns schools array with school objects with the following fields:
id School ID
country ID of the country the school is located in
city ID of the city the school is located in
name School name
year_from Year the user started to study
year_to Year the user finished to study
year_graduated Graduation year
class School class letter
speciality Speciality
type Type ID
type_str Type name
status User status. Returns a string with status text that is in the profile below user's name
last_seen Last visit date. Returns last_seen object with the following fields:
time Last visit date (in Unix time)
platform Type of the platform that used for the last authorization. See more at Using LongPoll server
followers_count Number of user's followers
common_count Number of common friends with a current user
counters Number of various objects the user has. Can be used in users.get method only when requesting information about a user. Returns an object with fields:
albums Number of photo albums
videos Number of videos
audios Number of audios
notes Number of notes
friends Number of friends
groups Number of communities
online_friends Number of online friends
mutual_friends Number of mutual friends
user_videos Number of videos the user is tagged on
followers Number of followers
user_photos Number of photos the user is tagged on
subscriptions Number of subscriptions
occupation Current user's occupation. Returns following fields:
type Can take the values: work, school, university
id ID of school, university, company group (the one a user works in)
name Name of school, university or work place
nickname User nickname
relatives Current user's relatives list. Returns a list of objects with id and type fields (name instead of id if a relative is not a VK user). type - relationship type. Possible values:
sibling
parent
child
grandparent
grandchild
relation User relationship status. Returned values:
1 - Single
2 - In a relationship
3 - Engaged
4 - Married
5 - It's complicated
6 - Actively searching
7 - In love
personal Information from the "Personal views" section
political Political views:
1 - Communist
2 - Socialist
3 - Moderate
4 - Liberal
5 - Conservative
6 - Monarchist
7 - Ultraconservative
8 - Apathetic
9 - Libertian
langs Languages
religion World view
inspired_by Inspired by
people_main Improtant in others:
1 - Intellect and creativity
2 - Kindness and honesty
3 - Health and beauty
4 - Wealth and power
5 - Courage and persistance
6 - Humor and love for life
life_main Personal priority:
1 - Family and children
2 - Career and money
3 - Entertainment and leisure
4 - Science and research
5 - Improving the world
6 - Personal development
7 - Beauty and art
8 - Fame and influence
smoking Views on smoking (1 - very negative; 2 - negative; 3 - neutral; 4 - compromisable; 5 - positive)
alcohol Views on alcohol (1 - very negative; 2 - negative; 3 - neutral; 4 - compromisable; 5 - positive)
connections Returns specified services such as: skype, facebook, twitter, livejournal, instagram
exports External services with export configured (twitter, facebook, livejournal, instagram)
wall_comments Wall comments allowed(1 - allowed, 0 - not allowed)
activities Activities
interests Interests
music Favorite music
movies Favorite movies
tv Favorite TV shows
books Favorite books
games Favorite games
about "About me"
quotes Favorite quotes
can_post Can post on the wall: 1 - allowed, 0 - not allowed
can_see_all_posts Can see other users' posts on the wall: 1 - allowed, 0 - not allowed
can_see_audio Can see other users' audio on the wall: 1 - allowed, 0 - not allowed
can_write_private_message Can write private messages to a current user: 1 - allowed, 0 - not allowed
timezone user time zone. Retuns only while requesting current user info
screen_name User page's screen name (subdomain)
## Not run: user <- getUsers('1', fields='sex,bdate,city') ## End(Not run)
## Not run: user <- getUsers('1', fields='sex,bdate,city') ## End(Not run)
Returns detailed information on arbitrary number of users
getUsersExecute( users_ids, fields = "", name_case = "nom", drop = FALSE, flatten = FALSE, use_db = FALSE, db_params = list(), progress_bar = FALSE, v = getAPIVersion() )
getUsersExecute( users_ids, fields = "", name_case = "nom", drop = FALSE, flatten = FALSE, use_db = FALSE, db_params = list(), progress_bar = FALSE, v = getAPIVersion() )
users_ids |
User IDs or screen names (screen_name). By default, current user ID |
fields |
Profile fields to return |
name_case |
Case for declension of user name and surname |
drop |
Drop deleted or banned users |
flatten |
Automatically flatten nested data frames into a single non-nested data frame |
use_db |
Use database |
db_params |
Collection name and suffix |
progress_bar |
Display progress bar |
v |
Version of API |
User object describes a user profile, contains the following fields:
uid User ID
first_name First name
last_name Last name
deactivated Returns if a profile is deleted or blocked. Gets the value deleted or banned. Keep in mind that in this case no additional fields are returned
hidden: 1 Returns while operating without access_token if a user has set the "Who can see my profile on the Internet" -> "Only VK users" privacy setting. Keep in mind that in this case no additional fields are returned
verified Returns 1 if the profile is verified, 0 if not
blacklisted Returns 1 if a current user is in the requested user's blacklist
sex User sex (1 - female; 2 - male; 0 - not specified)
bdate User's date of birth. Returned as DD.MM.YYYY or DD.MM (if birth year is hidden). If the whole date is hidden, no field is returned
city ID of the city specified on user's page in "Contacts" section. Returns city ID that can be used to get its name using places.getCityById method. If no city is specified or main information on the page is hidden for in privacy settings, then it returns 0
country ID of the country specified on user's page in "Contacts" section. Returns country ID that can be used to get its name using places.getCountryById method. If no country is specified or main information on the page is hidden in privacy settings, then it returns 0
home_town User's home town
photo_50 Returns URL of square photo of the user with 50 pixels in width. In case user does not have a photo, http://vk.com/images/camera_c.gif is returned
photo_100 Returns URL of square photo of the user with 100 pixels in width. In case user does not have a photo, http://vk.com/images/camera_b.gif is returned
photo_200_orig Returns URL of user's photo with 200 pixels in width. In case user does not have a photo, http://vk.com/images/camera_a.gif is returned
photo_200 Returns URL of square photo of the user with 200 pixels in width. If the photo was uploaded long time ago, there can be no image of such size and in this case the reply will not include this field
photo_400_orig Returns URL of user's photo with 400 pixels in width. If user does not have a photo of such size, reply will not include this field
photo_max Returns URL of square photo of the user with maximum width. Can be returned a photo both 200 and 100 pixels in width. In case user does not have a photo, http://vk.com/images/camera_b.gif is returned
photo_max_orig Returns URL of user's photo of maximum size. Can be returned a photo both 400 and 200 pixels in width. In case user does not have a photo, http://vk.com/images/camera_a.gif is returned
online Information whether the user is online. Returned values: 1 - online, 0 - offline. If user utilizes a mobile application or site mobile version, it returns online_mobile additional field that includes 1. With that, in case of application, online_app additional field is returned with application ID.
lists Information about friend lists. Returns IDs of friend lists the user is member of, separated with a comma. The field is available for friends.get method only. To get information about ID and names of friend lists use friends.getLists method. If user is not a member of any friend list, then when accepting data in XML format the respective <user> node does not contain <lists> tag
domain Page screen name. Returns a string with a page screen name (only subdomain is returned, like andrew). If not set, "id'+uid is returned, e.g. id35828305
has_mobile Information whether the user's mobile phone number is available. Returned values: 1 - available, 0 - not available. We recommend you to use it prior to call of secure.sendSMSNotification method
contacts Information about user's phone numbers. If data are available and not hidden in privacy settings, the following fields are returned (mobile_phone - user's mobile phone number (only for standalone applications); home_phone - user's additional phone number)
site Returns a website address from a user profile
education Information about user's higher education institution. The following fields are returned:
university University ID
university_name University name
faculty Faculty ID
faculty_name Faculty name
graduation Graduation year
universities List of higher education institutions where user studied. Returns universities array with university objects with the following fields:
id University ID
country ID of the country the university is located in
city ID of the city the university is located in
name University name
faculty Faculty ID
faculty_name Faculty name
chair University chair ID
chair_name Chair name
graduation Graduation year
schools List of schools where user studied in. Returns schools array with school objects with the following fields:
id School ID
country ID of the country the school is located in
city ID of the city the school is located in
name School name
year_from Year the user started to study
year_to Year the user finished to study
year_graduated Graduation year
class School class letter
speciality Speciality
type Type ID
type_str Type name
status User status. Returns a string with status text that is in the profile below user's name
last_seen Last visit date. Returns last_seen object with the following fields:
time Last visit date (in Unix time)
platform Type of the platform that used for the last authorization. See more at Using LongPoll server
followers_count Number of user's followers
common_count Number of common friends with a current user
counters Number of various objects the user has. Can be used in users.get method only when requesting information about a user. Returns an object with fields:
albums Number of photo albums
videos Number of videos
audios Number of audios
notes Number of notes
friends Number of friends
groups Number of communities
online_friends Number of online friends
mutual_friends Number of mutual friends
user_videos Number of videos the user is tagged on
followers Number of followers
user_photos Number of photos the user is tagged on
subscriptions Number of subscriptions
occupation Current user's occupation. Returns following fields:
type Can take the values: work, school, university
id ID of school, university, company group (the one a user works in)
name Name of school, university or work place
nickname User nickname
relatives Current user's relatives list. Returns a list of objects with id and type fields (name instead of id if a relative is not a VK user). type - relationship type. Possible values:
sibling
parent
child
grandparent
grandchild
relation User relationship status. Returned values:
1 - Single
2 - In a relationship
3 - Engaged
4 - Married
5 - It's complicated
6 - Actively searching
7 - In love
personal Information from the "Personal views" section
political Political views:
1 - Communist
2 - Socialist
3 - Moderate
4 - Liberal
5 - Conservative
6 - Monarchist
7 - Ultraconservative
8 - Apathetic
9 - Libertian
langs Languages
religion World view
inspired_by Inspired by
people_main Improtant in others:
1 - Intellect and creativity
2 - Kindness and honesty
3 - Health and beauty
4 - Wealth and power
5 - Courage and persistance
6 - Humor and love for life
life_main Personal priority:
1 - Family and children
2 - Career and money
3 - Entertainment and leisure
4 - Science and research
5 - Improving the world
6 - Personal development
7 - Beauty and art
8 - Fame and influence
smoking Views on smoking (1 - very negative; 2 - negative; 3 - neutral; 4 - compromisable; 5 - positive)
alcohol Views on alcohol (1 - very negative; 2 - negative; 3 - neutral; 4 - compromisable; 5 - positive)
connections Returns specified services such as: skype, facebook, twitter, livejournal, instagram
exports External services with export configured (twitter, facebook, livejournal, instagram)
wall_comments Wall comments allowed(1 - allowed, 0 - not allowed)
activities Activities
interests Interests
music Favorite music
movies Favorite movies
tv Favorite TV shows
books Favorite books
games Favorite games
about "About me"
quotes Favorite quotes
can_post Can post on the wall: 1 - allowed, 0 - not allowed
can_see_all_posts Can see other users' posts on the wall: 1 - allowed, 0 - not allowed
can_see_audio Can see other users' audio on the wall: 1 - allowed, 0 - not allowed
can_write_private_message Can write private messages to a current user: 1 - allowed, 0 - not allowed
timezone user time zone. Retuns only while requesting current user info
screen_name User page's screen name (subdomain)
## Not run: random_ids <- sample(x=seq(1:10000000), size=10000, replace=FALSE) users <- getUsersExecute(random_ids, fields='sex,bdate,city') ## End(Not run)
## Not run: random_ids <- sample(x=seq(1:10000000), size=10000, replace=FALSE) users <- getUsersExecute(random_ids, fields='sex,bdate,city') ## End(Not run)
Returns a list of posts on a user wall or community wall
getWall( owner_id = "", domain = "", offset = "", count = "", filter = "owner", extended = "", fields = "", v = getAPIVersion() )
getWall( owner_id = "", domain = "", offset = "", count = "", filter = "owner", extended = "", fields = "", v = getAPIVersion() )
owner_id |
ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. |
domain |
User or community short address. |
offset |
Offset needed to return a specific subset of posts. |
count |
Number of posts to return (maximum 100). |
filter |
Filter to apply:
|
extended |
1 - to return wall, profiles, and groups fields, 0 - to return no additional fields (default). |
fields |
List of comma-separated words |
v |
Version of API |
Returns a list of post objects. If extended is set to 1, also returns the following:
wall - Contains a list of post objects.
profiles - Contains user objects with additional fields photo and online.
groups - Contains community objects.
## Not run: wall <- getWall(domain='spbrug', count=10, progress_bar=TRUE) ## End(Not run)
## Not run: wall <- getWall(domain='spbrug', count=10, progress_bar=TRUE) ## End(Not run)
Returns a list of posts on a user wall or community wall
getWallExecute( owner_id = "", domain = "", offset = 0, count = 10, filter = "owner", extended = "", fields = "", use_db = FALSE, db_params = list(), progress_bar = FALSE, v = getAPIVersion() )
getWallExecute( owner_id = "", domain = "", offset = 0, count = 10, filter = "owner", extended = "", fields = "", use_db = FALSE, db_params = list(), progress_bar = FALSE, v = getAPIVersion() )
owner_id |
ID of the user or community that owns the wall. By default, current user ID. Use a negative value to designate a community ID. |
domain |
User or community short address. |
offset |
Offset needed to return a specific subset of posts. |
count |
Number of posts to return (0 for all posts). |
filter |
Filter to apply:
|
extended |
1 - to return wall, profiles, and groups fields, 0 - to return no additional fields (default). |
fields |
List of comma-separated words |
use_db |
Use database |
db_params |
Collection name and suffix |
progress_bar |
Display progress bar |
v |
Version of API |
Returns a list of post objects. If extended is set to 1, also returns the following:
wall - Contains a list of post objects.
profiles - Contains user objects with additional fields photo and online.
groups - Contains community objects.
## Not run: # get all posts from wall wall <- getWallExecute(domain='spbrug', count=0, progress_bar=TRUE) ## End(Not run)
## Not run: # get all posts from wall wall <- getWallExecute(domain='spbrug', count=0, progress_bar=TRUE) ## End(Not run)
Returns a list of communities matching the search criteria
groupsSearch( q = "", type = "", country_id = "", city_id = "", future = 0, market = 0, sort = 0, offset = 0, count = 20, v = getAPIVersion() )
groupsSearch( q = "", type = "", country_id = "", city_id = "", future = 0, market = 0, sort = 0, offset = 0, count = 20, v = getAPIVersion() )
q |
Search query string |
type |
Community type. Possible values: group, page, event |
country_id |
Country ID |
city_id |
City ID. If this parameter is transmitted, country_id is ignored |
future |
1 — to return only upcoming events. Works with the type = event only |
market |
1 — to return communities with enabled market only |
sort |
Sort order. Possible values:
|
offset |
Offset needed to return a specific subset of results |
count |
Number of communities to return (default 20, maximum value 1000) |
v |
Version of API |
Captcha error handler
handle_captcha(error)
handle_captcha(error)
error |
Error object |
Validation error handler
handle_validation(error)
handle_validation(error)
error |
Error object |
Get error code from response
has_error(response)
has_error(response)
response |
httr response object |
Returns a list of IDs of users who added the specified object to their Likes list
likesGetList( type = "", owner_id = "", item_id = "", page_url = "", filter = "", friends_only = "0", extended = "", offset = "", count = "100", skip_own = 0, v = getAPIVersion() )
likesGetList( type = "", owner_id = "", item_id = "", page_url = "", filter = "", friends_only = "0", extended = "", offset = "", count = "100", skip_own = 0, v = getAPIVersion() )
type |
Object type |
owner_id |
ID of the user, community, or application that owns the object |
item_id |
Object ID |
page_url |
URL of the page where the Like widget is installed. Used instead of the item_id parameter |
filter |
Filters to apply: likes - returns information about all users who liked the object (default); copies - returns information only about users who told their friends about the object |
friends_only |
Specifies which users are returned: 1 - to return only the current user's friends; 0 - to return all users (default) |
extended |
Specifies whether extended information will be returned. 1 - to return extended information about users and communities from the Likes list; 0 - to return no additional information (default) |
offset |
Offset needed to select a specific subset of users |
count |
Number of user IDs to return (maximum 1000) |
skip_own |
Flag, either 1 or 0 |
v |
Version of API |
Returns a list of IDs of users who added the specified objects to their Likes list
likesGetListForObjects( objects, type = "post", filter = "likes", friends_only = 0, extended = 0, skip_own = 0, progress_bar = FALSE, v = getAPIVersion() )
likesGetListForObjects( objects, type = "post", filter = "likes", friends_only = 0, extended = 0, skip_own = 0, progress_bar = FALSE, v = getAPIVersion() )
objects |
List of objects (objects must contain fields owner_id and id) |
type |
Object type (post or comment) |
filter |
Filters to apply: likes - returns information about all users who liked the object (default); copies - returns information only about users who told their friends about the object |
friends_only |
Specifies which users are returned: 1 - to return only the current user's friends; 0 - to return all users (default) |
extended |
Specifies whether extended information will be returned. 1 - to return extended information about users and communities from the Likes list; 0 - to return no additional information (default) |
skip_own |
flag, either 1 or 0 |
progress_bar |
Display progress bar |
v |
Version of API |
## Not run: wall <- getWallExecute(domain = 'privivkanet', count = 10, progress_bar = TRUE) post_likers <- likesGetListForObjects(wall, type = 'post', progress_bar = TRUE) post_likers_extended <- likesGetListForObjects(wall, type = 'post', extended = 1, progress_bar = TRUE) ## End(Not run)
## Not run: wall <- getWallExecute(domain = 'privivkanet', count = 10, progress_bar = TRUE) post_likers <- likesGetListForObjects(wall, type = 'post', progress_bar = TRUE) post_likers_extended <- likesGetListForObjects(wall, type = 'post', extended = 1, progress_bar = TRUE) ## End(Not run)
Returns a list of the current user's incoming or outgoing private messages
messagesGet( out = "", offset = "", count = "", time_offset = "", filters = "", preview_length = "", last_message_id = "", v = getAPIVersion() )
messagesGet( out = "", offset = "", count = "", time_offset = "", filters = "", preview_length = "", last_message_id = "", v = getAPIVersion() )
out |
1 - to return outgoing messages; 0 - to return incoming messages (default) |
offset |
Offset needed to return a specific subset of messages |
count |
Number of messages to return |
time_offset |
Maximum time since a message was sent, in seconds. To return messages without a time limitation, set as 0 |
filters |
Filter to apply: 1 - unread only; 2 - not from the chat; 4 - messages from friends |
preview_length |
Number of characters after which to truncate a previewed message. To preview the full message, specify 0 |
last_message_id |
ID of the message received before the message that will be returned last |
v |
Version of API |
Returns message history for the specified user or group chat
messagesGetHistory( offset = "", count = "", user_id = "", peer_id = "", start_message_id = "", rev = "", v = getAPIVersion() )
messagesGetHistory( offset = "", count = "", user_id = "", peer_id = "", start_message_id = "", rev = "", v = getAPIVersion() )
offset |
Offset needed to return a specific subset of messages |
count |
Number of messages to return (maximum value 200) |
user_id |
ID of the user whose message history you want to return |
peer_id |
Destination ID (user ID, group ID or chat ID) |
start_message_id |
Starting message ID from which to return history |
rev |
Sort order: 1 - return messages in chronological order; 0 - return messages in reverse chronological order |
v |
Version of API |
Returns all message history for the specified user or group chat
messagesGetHistoryAll(user_id = "", peer_id = "", rev = 0, v = getAPIVersion())
messagesGetHistoryAll(user_id = "", peer_id = "", rev = 0, v = getAPIVersion())
user_id |
ID of the user whose message history you want to return |
peer_id |
Destination ID (user ID, group ID or chat ID) |
rev |
Sort order: 1 - return messages in chronological order; 0 - return messages in reverse chronological order |
v |
Version of API |
Returns message history for the specified user or group chat
messagesGetHistoryExecute( offset = 0, count = 0, user_id = "", peer_id = "", start_message_id = "", rev = 0, progress_bar = FALSE, v = getAPIVersion() )
messagesGetHistoryExecute( offset = 0, count = 0, user_id = "", peer_id = "", start_message_id = "", rev = 0, progress_bar = FALSE, v = getAPIVersion() )
offset |
Offset needed to return a specific subset of messages |
count |
Number of messages to return (0 for all history) |
user_id |
ID of the user whose message history you want to return |
peer_id |
Destination ID (user ID, group ID or chat ID) |
start_message_id |
Starting message ID from which to return history |
rev |
Sort order: 1 - return messages in chronological order; 0 - return messages in reverse chronological order |
progress_bar |
Display progress bar |
v |
Version of API |
Sends a message.
messagesSend( user_id, random_id = "", peer_id = "", domain = "", chat_id = "", user_ids = "", message = "", lat = "", long = "", attachment = "", forward_messages = "", sticker_id = "", v = getAPIVersion() )
messagesSend( user_id, random_id = "", peer_id = "", domain = "", chat_id = "", user_ids = "", message = "", lat = "", long = "", attachment = "", forward_messages = "", sticker_id = "", v = getAPIVersion() )
user_id |
User ID (by default — current user). |
random_id |
Unique identifier to avoid resending the message. |
peer_id |
Destination ID. |
domain |
User's short address (for example, illarionov). |
chat_id |
ID of conversation the message will relate to. |
user_ids |
IDs of message recipients (if new conversation shall be started). |
message |
Text of the message (required if attachments is not set). |
lat |
Geographical latitude of a check-in, in degrees (from -90 to 90). |
long |
Geographical longitude of a check-in, in degrees (from -180 to 180). |
attachment |
List of objects attached to the message, separated by commas, in the following format: <type><owner_id>_<media_id> <type> — Type of media attachment:
<owner_id> — ID of the media attachment owner. <media_id> — media attachment ID. |
forward_messages |
ID of forwarded messages, separated with a comma. Listed messages of the sender will be shown in the message body at the recipient's. |
sticker_id |
Sticker id. |
v |
Version of API. |
Split messages by days, weeks, months
messagesSplitByDate(messages, format = "%y-%m-%d")
messagesSplitByDate(messages, format = "%y-%m-%d")
messages |
List of messages from messagesGet() |
format |
Character string giving a date-time format as used by strptime |
Returns search results by statuses
newsfeedSearch( q = "", extended = "", count = "", latitude = "", longitude = "", start_time = "", end_time = "", start_from = "", fields = "", v = getAPIVersion() )
newsfeedSearch( q = "", extended = "", count = "", latitude = "", longitude = "", start_time = "", end_time = "", start_from = "", fields = "", v = getAPIVersion() )
q |
Search query string (e.g., New Year). |
extended |
1 — to return additional information about the user or community that placed the post |
count |
Number of posts to return |
latitude |
Geographical latitude point (in degrees, -90 to 90) within which to search |
longitude |
Geographical longitude point (in degrees, -180 to 180) within which to search |
start_time |
Earliest timestamp (in Unix time) of a news item to return. By default, 24 hours ago |
end_time |
Latest timestamp (in Unix time) of a news item to return. By default, the current time |
start_from |
String, accessible for versions from 5.13 |
fields |
Additional fields of profiles and communities to return |
v |
Version of API |
Logical or operator
or(expr1, expr2)
or(expr1, expr2)
expr1 |
Expression 1 |
expr2 |
Expression 2 |
Returns a list of comments on a post on a user wall or community wall
postGetComments( owner_id = "", post_id = "", need_likes = 1, start_comment_id = "", offset = 0, count = 10, sort = "", preview_length = 0, extended = "", progress_bar = FALSE, v = getAPIVersion() )
postGetComments( owner_id = "", post_id = "", need_likes = 1, start_comment_id = "", offset = 0, count = 10, sort = "", preview_length = 0, extended = "", progress_bar = FALSE, v = getAPIVersion() )
owner_id |
User ID or community ID. Use a negative value to designate a community ID. |
post_id |
Post ID. |
need_likes |
1 - to return the likes field (default), 0 - not to return the likes field. |
start_comment_id |
Positive number |
offset |
Offset needed to return a specific subset of comments. |
count |
Number of comments to return. |
sort |
Sort order: asc - chronological, desc - reverse chronological. |
preview_length |
Number of characters at which to truncate comments when previewed. Specify 0 (default) if you do not want to truncate comments. |
extended |
Flag, either 1 or 0. |
progress_bar |
Display progress bar |
v |
Version of API |
Helper function for working with profile fields
profile_fields(fields = "")
profile_fields(fields = "")
fields |
Profile fields to return |
## Not run: # get list of all fields fields <- profile_fields('all') # get list of all fields except specified fields <- profile_fields('all - photo_50,photo_100,photo_200') # get only specified fields fields <- profile_fields('sex,bdate') ## End(Not run)
## Not run: # get list of all fields fields <- profile_fields('all') # get list of all fields except specified fields <- profile_fields('all - photo_50,photo_100,photo_200') # get only specified fields fields <- profile_fields('sex,bdate') ## End(Not run)
Returns a query string
queryBuilder(method_name, ...)
queryBuilder(method_name, ...)
method_name |
Method name |
... |
Method arguments |
Repeat last function call
repeat_last_query(params = list(), n = 1)
repeat_last_query(params = list(), n = 1)
params |
Query params |
n |
The number of generations to go back |
VK can accept maximum 3 requests to API methods per second from a client.
request_delay()
request_delay()
Converts the given igraph object to GEXF format and saves it at the given filepath location
saveAsGEXF(g, filepath = "converted_graph.gexf")
saveAsGEXF(g, filepath = "converted_graph.gexf")
g |
Input igraph object to be converted to gexf format |
filepath |
File location where the output gexf file should be saved |
Gopalakrishna Palem, [email protected]
Allows the programmer to do a quick search for any substring
search.getHints( q = "", limit = "", filters = "", search_global = "", v = getAPIVersion() )
search.getHints( q = "", limit = "", filters = "", search_global = "", v = getAPIVersion() )
q |
Search query string |
limit |
Maximum number of results to return |
filters |
List of comma-separated words |
search_global |
Flag, either 1 or 0, default 1 |
v |
Version of API |
Set access token
setAccessToken(access_token = "")
setAccessToken(access_token = "")
access_token |
Access token |
Set API version
setAPIVersion(v)
setAPIVersion(v)
v |
API version |
Set maximum number of repeats
setRepeats(n)
setRepeats(n)
n |
Repeats number |
Returns user id by tag
tag2Id(tag)
tag2Id(tag)
tag |
Tag |
Check response for errors
try_handle_error(response)
try_handle_error(response)
response |
httr response object |
Try to handle network error
try_handle_network_error(error)
try_handle_network_error(error)
error |
Error |
Switch database
use_db(db_name)
use_db(db_name)
db_name |
Database name |
Returns a list of IDs of followers of the user in question, sorted by date added, most recent first
usersGetFollowers( user_id = "", offset = 0, count = 0, fields = "", name_case = "", drop = FALSE, flatten = FALSE, progress_bar = FALSE, v = getAPIVersion() )
usersGetFollowers( user_id = "", offset = 0, count = 0, fields = "", name_case = "", drop = FALSE, flatten = FALSE, progress_bar = FALSE, v = getAPIVersion() )
user_id |
User ID |
offset |
Offset needed to return a specific subset of followers |
count |
Number of followers to return |
fields |
Profile fields to return |
name_case |
Case for declension of user name and surname |
drop |
Drop deleted or banned followers |
flatten |
Automatically flatten nested data frames into a single non-nested data frame |
progress_bar |
Display progress bar |
v |
Version of API |
## Not run: my_followers <- usersGetFollowers(me()) ## End(Not run)
## Not run: my_followers <- usersGetFollowers(me()) ## End(Not run)
Returns a list of IDs of users and communities followed by the user
usersGetSubscriptions( user_id = "", extended = "1", offset = 0, count = 0, fields = "", flatten = FALSE, progress_bar = FALSE, v = getAPIVersion() )
usersGetSubscriptions( user_id = "", extended = "1", offset = 0, count = 0, fields = "", flatten = FALSE, progress_bar = FALSE, v = getAPIVersion() )
user_id |
User ID |
extended |
1 - to return a combined list of users and communities, 0 - to return separate lists of users and communities |
offset |
Offset needed to return a specific subset of subscriptions |
count |
Number of users and communities to return |
fields |
Profile fields to return |
flatten |
Automatically flatten nested data frames into a single non-nested data frame |
progress_bar |
Display progress bar |
v |
Version of API |
## Not run: my_subscriptions <- usersGetSubscriptions(me()) ## End(Not run)
## Not run: my_subscriptions <- usersGetSubscriptions(me()) ## End(Not run)
Returns a list of users matching the search criteria
usersSearch( q = "", sort = "", offset = "", count = "20", fields = "", city = "", country = "", hometown = "", university_country = "", university = "", university_year = "", university_faculty = "", university_chair = "", sex = "", status = "", age_from = "", age_to = "", birth_day = "", birth_month = "", birth_year = "", online = "", has_photo = "", school_country = "", school_city = "", school_class = "", school = "", school_year = "", religion = "", interests = "", company = "", position = "", group_id = "", from_list = "", flatten = FALSE, v = getAPIVersion() )
usersSearch( q = "", sort = "", offset = "", count = "20", fields = "", city = "", country = "", hometown = "", university_country = "", university = "", university_year = "", university_faculty = "", university_chair = "", sex = "", status = "", age_from = "", age_to = "", birth_day = "", birth_month = "", birth_year = "", online = "", has_photo = "", school_country = "", school_city = "", school_class = "", school = "", school_year = "", religion = "", interests = "", company = "", position = "", group_id = "", from_list = "", flatten = FALSE, v = getAPIVersion() )
q |
Search query string (e.g., Vasya Babich) |
sort |
Sort order: 1 - by date registered; 0 - by rating |
offset |
Offset needed to return a specific subset of users |
count |
Number of users to return |
fields |
Profile fields to return |
city |
City ID |
country |
Country ID |
hometown |
City name in a string |
university_country |
ID of the country where the user graduated |
university |
ID of the institution of higher education |
university_year |
Year of graduation from an institution of higher education |
university_faculty |
Faculty ID |
university_chair |
Chair ID |
sex |
1 - female; 2 - male; 0 - any (default) |
status |
Relationship status: 1 - Not married; 2 - In a relationship; 3 - Engaged; 4 - Married; 5 - It's complicated; 6 - Actively searching; 7 - In love |
age_from |
Minimum age |
age_to |
Maximum age |
birth_day |
Day of birth |
birth_month |
Month of birth |
birth_year |
Year of birth |
online |
1 - online only; 0 - all users |
has_photo |
1 - with photo only; 0 - all users |
school_country |
ID of the country where users finished school |
school_city |
ID of the city where users finished school |
school_class |
Positive number |
school |
ID of the school |
school_year |
School graduation year |
religion |
Users' religious affiliation |
interests |
Users' interests |
company |
Name of the company where users work |
position |
Job position |
group_id |
ID of a community to search in communities |
from_list |
List of comma-separated words |
flatten |
Automatically flatten nested data frames into a single non-nested data frame |
v |
Version of API |
Custom error
vk_stop(message = "", call = sys.call(), error_code = "")
vk_stop(message = "", call = sys.call(), error_code = "")
message |
Error message |
call |
Call expression |
error_code |
Error code |
Returns a data frame of the same number of rows as length of 'objs', each element of which is the result of applying 'method' to the corresponding element of 'objs'
vkApply(objs, method)
vkApply(objs, method)
objs |
A vector of objects |
method |
The function to be applied to each element of 'objs' |
## Not run: users <- vkApply(c("",1234567), function(user) getUsers(user, fields="sex")) countries <- vkApply(c(2,5122182,1906578), getCountryByCityId) ## End(Not run)
## Not run: users <- vkApply(c("",1234567), function(user) getUsers(user, fields="sex")) countries <- vkApply(c(2,5122182,1906578), getCountryByCityId) ## End(Not run)
Client authorization
vkOAuth(client_id, scope = "friends", email, password)
vkOAuth(client_id, scope = "friends", email, password)
client_id |
Application ID |
scope |
Requested application access permissions (see below). |
email |
Email or phone number |
password |
Password |
List of Available Settings of Access Permissions:
friends Access to friends.
photos Access to photos.
audio Access to audios.
video Access to videos.
docs Access to documents.
notes Access to user notes.
pages Access to wiki pages.
status Access to user status.
wall Access to standard and advanced methods for the wall.
groups Access to user groups.
messages Access to advanced methods for messaging.
notifications Access to notifications about answers to the user.
## Not run: # an example of an authenticated request vkOAuth(client_id = 123456, scope = "friends,groups,messages", email = "[email protected]", password = "your_secret_password") # save access token for future sessions at <- getAccessToken() # an example of request me() # an example of an authenticated request without specifying email and password vkOAuth(client_id = 123456, scope = "friends,groups,messages") # copy access token from browser address bar setAccessToken("your_secret_access_token") ## End(Not run)
## Not run: # an example of an authenticated request vkOAuth(client_id = 123456, scope = "friends,groups,messages", email = "[email protected]", password = "your_secret_password") # save access token for future sessions at <- getAccessToken() # an example of request me() # an example of an authenticated request without specifying email and password vkOAuth(client_id = 123456, scope = "friends,groups,messages") # copy access token from browser address bar setAccessToken("your_secret_access_token") ## End(Not run)
Client authorization (for web application)
vkOAuthWeb(app_name, client_id, client_secret)
vkOAuthWeb(app_name, client_id, client_secret)
app_name |
Application name |
client_id |
Application ID |
client_secret |
Application secret key |
Create post object
vkPost(...)
vkPost(...)
... |
List of attributes |
This package provides a series of functions that allow R users to access VK's API (https://vk.com/dev/methods) to get information about users, messages, groups, posts and likes.
VK (https://vk.com/) is the largest European online social networking service, based in Russia. It is available in several languages, and is especially popular among Russian-speaking users. VK allows users to message each other publicly or privately, to create groups, public pages and events, share and tag images, audio and video, and to play browser-based games [1].
Dmitriy Sorokin [email protected]
[1] https://en.wikipedia.org/wiki/VK_(social_networking)
vkOAuth
,
getUsersExecute
, getWallExecute
,
getFriends
, getFriendsFor
,
getGroupsForUsers
, getGroupsMembersExecute
,
likesGetListForObjects
, messagesGetHistoryExecute
,
getArbitraryNetwork
, getStatus
Returns a list of posts from user or community walls by their IDs
wallGetById( posts = "", extended = "", copy_history_depth = "", fields = "", v = getAPIVersion() )
wallGetById( posts = "", extended = "", copy_history_depth = "", fields = "", v = getAPIVersion() )
posts |
User or community IDs and post IDs, separated by underscores. Use a negative value to designate a community ID. |
extended |
1 - to return user and community objects needed to display posts, 0 - no additional fields are returned (default). |
copy_history_depth |
Sets the number of parent elements to include in the array copy_history that is returned if the post is a repost from another wall. |
fields |
List of comma-separated words |
v |
Version of API |
Returns a list of post objects. If extended is set to 1, returns the following:
wall - Contains post objects.
profiles - Contains user objects with additional fields sex, photo, photo_medium_rec, and online.
groups - Contains community objects.
If the post is a copy of another post, returns an additional array copy_history with information about original posts.
Returns a list of comments on a post on a user wall or community wall
wallGetComments( owner_id = "", post_id = "", need_likes = "", start_comment_id = "", offset = "", count = "10", sort = "", preview_length = "0", extended = "", v = getAPIVersion() )
wallGetComments( owner_id = "", post_id = "", need_likes = "", start_comment_id = "", offset = "", count = "10", sort = "", preview_length = "0", extended = "", v = getAPIVersion() )
owner_id |
User ID or community ID. Use a negative value to designate a community ID. |
post_id |
Post ID. |
need_likes |
1 - to return the likes field, 0 - not to return the likes field (default). |
start_comment_id |
Positive number. |
offset |
Offset needed to return a specific subset of comments. |
count |
Number of comments to return (maximum 100). |
sort |
Sort order: asc - chronological, desc - reverse chronological. |
preview_length |
Number of characters at which to truncate comments when previewed. By default, 90. Specify 0 if you do not want to truncate comments. |
extended |
Flag, either 1 or 0. |
v |
Version of API |
Returns a list of comments on a user wall or community wall
wallGetCommentsList(posts, progress_bar = FALSE, v = getAPIVersion())
wallGetCommentsList(posts, progress_bar = FALSE, v = getAPIVersion())
posts |
A list of posts or wall object (from getWallExecute()) |
progress_bar |
Display progress bar |
v |
Version of API |
Returns information about reposts of a post on user wall or community wall
wallGetReposts( owner_id = "", post_id = "", offset = "", count = "20", v = getAPIVersion() )
wallGetReposts( owner_id = "", post_id = "", offset = "", count = "20", v = getAPIVersion() )
owner_id |
User ID or community ID. By default, current user ID. Use a negative value to designate a community ID. |
post_id |
Post ID. |
offset |
Offset needed to return a specific subset of reposts. |
count |
Number of reposts to return. |
v |
Version of API |
Returns an object containing the following fields:
items - An array of wall reposts.
profiles - Information about users with additional fields sex, online, photo, photo_medium_rec, and screen_name.
groups - Information about communities.
Allows to search posts on user or community walls
wallSearch( owner_id = "", domain = "", query = "", owners_only = "", count = "20", offset = "0", extended = "", fields = "", v = getAPIVersion() )
wallSearch( owner_id = "", domain = "", query = "", owners_only = "", count = "20", offset = "0", extended = "", fields = "", v = getAPIVersion() )
owner_id |
User or community id. Remember that for a community owner_id must be negative. |
domain |
User or community screen name. |
query |
Search query string. |
owners_only |
1 - returns only page owner's posts. |
count |
Count of posts to return. |
offset |
Results offset. |
extended |
Show extended post info. |
fields |
List of comma-separated words |
v |
Version of API |
If executed successfully, returns a list of post objects.