video.search
The translation was generated automatically and may contain mistakes
The method receives a list of videos in accordance with the specified search criteria.
Parameters
string
Search query string, for example The Beatles . A search on an empty query is possible only if there is a parameter owner_id .
integer
Criteria for video sorting. Possible values:
- •
0- by the date of addition of video recordings. - •
1- by duration. - •
2by relevance.
integer
Information about whether to look for high-quality videos. Possible values:
- •
1Look for high quality videos. - •
0Do not search for high-quality videos. The value is used by default.
checkbox
Filter "Secure search". Possible values:
- •
1- off. - •
0- on.
checkbox
string
A list of criteria by which you need to filter videos. Possible values:
- •
vkReturn only VK videos. - •
youtubeReturn only YouTube videos. - •
vimeo- return only Vimeo-videos. - •
shortReturn only short videos. - •
longReturn only long videos.
checkbox
Information about whether to perform a search on the list of user videos. Possible values:
- •
1Search the list of user videos. - •
0Do not search the list of user videos. The value is used by default.
positive
Offset to return videos relative to the start of the list.
positive
The minimum number of seconds that the returned videos should have.
positive
The maximum number of seconds that the returned videos should have.
positive
Number of videos returned.
Note. Even when using a parameter offset Only the first 500 videos are available.
checkbox
Information on whether to return additional fields profiles and groups containing information about users and communities. Possible values:
- •
1Return additional fields. - •
0Do not return additional fields. The value is used by default.
integer
The owner’s ID, which you need to filter the video.
The option is allowed with version 5.167.
string
Result
The method returns an object. Object parameters:
Parameter | Type | Description |
|---|---|---|
count | integer | Number of videos. |
items | array[object] | Object Array videos . |
profiles | array[object] | |
groups | array[object] | Object Array community Communities . The parameter is returned if the parameter extended It matters 1 . |
files | string | A link to a video file if the video is hosted on the VKontakte server, or a link to an external resource if the video is embedded from any video hosting. The parameter is returned if your application uses direct Authorization . |
Example response with parameter extended=0 :
{
"response": {
"count": 1547445,
"items": [
{
"can_comment": 0,
"can_like": 1,
"can_repost": 1,
"can_subscribe": 1,
"can_add_to_faves": 1,
"can_add": 1,
"comments": 0,
"date": 1606742914,
"description": "",
"duration": 10802,
"image": [
{
"url": "https://sun9-4.us...bb9/DiIKAZBCUrw.jpg",
"width": 130,
"height": 96,
"with_padding": 1
},
{
"url": "https://sun9-23.u...bb8/Z1daDIW3jkQ.jpg",
"width": 160,
"height": 120,
"with_padding": 1
}
],
"width": 1280,
"height": 720,
"id": 456239101,
"owner_id": -185310931,
"title": "природа",
"is_favorite": false,
"player": "https://vk.com/vi...3a37c9_GI3DGOJXHE3Q",
"added": 0,
"track_code": "video_31eba2b6nVd8JlQi_Zlm8xQj3eEvIsvFCrQzGabs8VpQciX-dLz6Jj4XbJpfPpzJJxxSasuUKU7iBdOWeitEiyIRTaEC1Z5DoZ3s8Uh7mhZJE4LVGhT5",
"type": "video",
"views": 358,
"likes": {
"count": 3,
"user_likes": 0
},
"reposts": {
"count": 3,
"user_reposted": 0
}
}
],
"profiles": [],
"groups": []
}
}Example response with parameter extended=1 :
{
"response": {
"count": 1547445,
"items": [
{
"can_comment": 0,
"can_like": 1,
"can_repost": 1,
"can_subscribe": 1,
"can_add_to_faves": 1,
"can_add": 1,
"comments": 0,
"date": 1606742914,
"description": "",
"duration": 10802,
"image": [
{
"url": "https://sun9-4.us...bb9/DiIKAZBCUrw.jpg",
"width": 130,
"height": 96,
"with_padding": 1
},
{
"url": "https://sun9-23.u...bb8/Z1daDIW3jkQ.jpg",
"width": 160,
"height": 120,
"with_padding": 1
}
],
"width": 1280,
"height": 720,
"id": 456239101,
"owner_id": -185310931,
"title": "природа",
"is_favorite": false,
"player": "https://vk.com/vi...352959_GI3DGOJXHE3Q",
"added": 0,
"track_code": "video_b5f7b977SvdxSSj-fQWT1Z3VeyuVGPQlJUTe_du7E0nRe-gQ-y4thjN4EEbx__zsoDSbziD-fsecpVAcYxjGKKMYgE-NR0lq7YTbTMaSeZKv5CQfoC4",
"type": "video",
"views": 358,
"likes": {
"count": 3,
"user_likes": 0
},
"reposts": {
"count": 3,
"user_reposted": 0
}
}
],
"profiles": [],
"groups": [
{
"id": 185310931,
"name": "природа",
"screen_name": "club185310931",
"is_closed": 0,
"type": "group",
"photo_50": "https://sun9-52.u...1120,1120&ava=1",
"photo_100": "https://sun9-52.u...1120,1120&ava=1",
"photo_200": "https://sun9-52.u...1120,1120&ava=1"
}
]
}
}Error codes
Common errors may occur during execution
Linked versions
Go to API versions page- •
In return objects that describe community , появилось новое поле
is_messages_blocked. - •
В Callback API Added new events:
message_allowandmessage_deny. Методgroups.setCallbackSettingstwo new parameters, and the methodgroups.getCallbackSettingsreturns two new fields, respectively.
If no end date is specified in the method call parameters, return objects that describe community They no longer have a field.. finish_data . Previously, this field was present in the response and contained the default, equal to start_date + 2 hours.