Method: assetSearch.list

Searches for assets based on asset metadata. The method can retrieve all assets or only assets owned by the content owner. This method mimics the functionality of the advanced search feature on the Assets page in CMS.

HTTP request

GET https://youtubepartner.googleapis.com/youtube/partner/v1/assetSearch

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
createdAfter

string

The createdAfter parameter restricts the set of returned assets to ones originally created on or after the specified datetime. For example: 2015-01-29T23:00:00Z

createdBefore

string

The createdBefore parameter restricts the set of returned assets to ones originally created on or before the specified datetime. For example: 2015-01-29T23:00:00Z

hasConflicts

boolean

The hasConflicts parameter enables you to only retrieve assets that have ownership conflicts. The only valid value is true . Setting the parameter value to false does not affect the results.

includeAnyProvidedlabel

boolean

If includeAnyProvidedlabel parameter is set to true, will search for assets that contain any of the provided labels; else will search for assets that contain all the provided labels.

isrcs

string

A comma-separated list of up to 50 ISRCs. If you specify a value for this parameter, the API server ignores any values set for the following parameters: q , includeAnyProvidedLabel , hasConflicts , labels , metadataSearchFields , sort , and type .

labels

string

The labels parameter specifies the assets with certain asset labels that you want to retrieve. The parameter value is a comma-separated list of asset labels.

metadataSearchFields

string

The metadataSearchField parameter specifies which metadata fields to search by. It is a comma-separated list of metadata field and value pairs connected by colon(:). For example: customId:my_custom_id,artist:Dandexx

onBehalfOfContentOwner

string

The onBehalfOfContentOwner parameter identifies the content owner that the user is acting on behalf of. This parameter supports users whose accounts are associated with multiple content owners.

ownershipRestriction

enum ( OwnershipRestriction )

The ownershipRestriction parameter specifies the ownership filtering option for the search. By default the search is performed in the assets owned by currently authenticated user only.

pageToken

string

The pageToken parameter specifies a token that identifies a particular page of results to return. Set this parameter to the value of the nextPageToken value from the previous API response to retrieve the next page of search results.

q

string

YouTube searches within the id , type , and customId fields for all assets as well as in numerous other metadata fields – such as actor , album , director , isrc , and tmsId – that vary for different types of assets (movies, music videos, etc.).

sort

enum ( Sort )

The sort parameter specifies how the search results should be sorted. Note that results are always sorted in descending order.

type

string

The type parameter specifies the types of assets that you want to retrieve. The parameter value is a comma-separated list of asset types.

Request body

The request body must be empty.

Response body

This response shows a list of YouTube assets matching a search query. Each item in the list contains an asset's metadata.

If successful, the response body contains data with the following structure:

JSON representation
{

  "kind"
: 
string
,

  "pageInfo"
: 
{

    object (
PageInfo
)

  }
,

  "items"
: 
[

    {

      object (
AssetSnippet
)

    }

  ]
,

  "nextPageToken"
: 
string

}
Fields
kind

string

The type of the API response. For this operation, the value is youtubePartner#assetSnippetList .

pageInfo

object ( PageInfo )

The pageInfo object encapsulates paging information for the result set.

items[]

object ( AssetSnippet )

A list of asset resources that match the request criteria.

nextPageToken

string

The token that can be used as the value of the pageToken parameter to retrieve the next page of results.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/youtubepartner

For more information, see the OAuth 2.0 Overview .

OwnershipRestriction

Enum of ownership restriction.

Enums
OWNERSHIP_RESTRICTION_UNSPECIFIED Default value.
MINE Find assets owned by the current user that match the search query. This is the default behavior.
NONE Find all assets that match the search query, regardless of owner.

Sort

Enum of supported sorting orders in asset search list request.

Enums
SORT_UNSPECIFIED Default value.
CLAIMS Sort by the number of claims for each asset.
TIME Sort by the modification time for each asset. This is the default value.
VIEWS Sort by the approximate daily views for each asset.