video

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.

To call this method, you can use:
• user access token (access right required: video — this is issued in exceptional cases by a request to support at devsupport@corp.vk.com)

Parameters

q

string

Search query string, for example The Beatles . A search on an empty query is possible only if there is a parameter owner_id .

sort

integer

Criteria for video sorting. Possible values:

  • 0 - by the date of addition of video recordings.
  • 1 - by duration.
  • 2 by relevance.
hd

integer

Information about whether to look for high-quality videos. Possible values:

  • 1 Look for high quality videos.
  • 0 Do not search for high-quality videos. The value is used by default.
adult

checkbox

Filter "Secure search". Possible values:

  • 1 - off.
  • 0 - on.
live

checkbox

filters

string

A list of criteria by which you need to filter videos. Possible values:

  • vk Return only VK videos.
  • youtube Return only YouTube videos.
  • vimeo - return only Vimeo-videos.
  • short Return only short videos.
  • long Return only long videos.
search_own

checkbox

Information about whether to perform a search on the list of user videos. Possible values:

  • 1 Search the list of user videos.
  • 0 Do not search the list of user videos. The value is used by default.
offset

positive

Offset to return videos relative to the start of the list.

longer

positive

The minimum number of seconds that the returned videos should have.

shorter

positive

The maximum number of seconds that the returned videos should have.

count

positive

Number of videos returned.

Note. Even when using a parameter offset Only the first 500 videos are available.

extended

checkbox

Information on whether to return additional fields profiles and groups containing information about users and communities. Possible values:

  • 1 Return additional fields.
  • 0 Do not return additional fields. The value is used by default.
owner_id

integer

The owner’s ID, which you need to filter the video.

The option is allowed with version 5.167.

fields

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]
Object Array users . The parameter is returned if the parameter extended It matters 1 .
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 :

JSON
{ "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 :

JSON
{ "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

106
Unable to process action

Common errors may occur during execution

Linked versions

Go to API versions page

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.