Method: videos.getRating

Retrieves the ratings that the authorized user gave to a list of specified videos.

For general error responses, see General errors. For code examples, see videos.getRating code snippets.

HTTP request

GET https://youtube.googleapis.com/youtube/v3/videos/getRating

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
id[]

string

Required. Specifies a comma-separated list (or repeated query parameters) of up to 50 YouTube video IDs for which you are retrieving rating data. Invalid video IDs are silently omitted from items.

Request body

The request body must be empty.

Response body

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

JSON representation
{
  "kind": string,
  "etag": string,
  "items": [
    {
      "videoId": string,
      "rating": enum
    }
  ]
}
Fields
kind

string

Identifies what kind of resource this is. Value: the fixed string "youtube#videoGetRatingResponse".

etag

string

Etag of this resource.

items[]

object

A list of ratings that match the request criteria.

items[].videoId

string

The ID that YouTube uses to uniquely identify the video.

items[].rating

enum

The rating that the authorized user gave to the video. A value of none indicates the user hasn't rated the video or removed a previous rating.

Valid values of this enum field are:

  • none
  • like
  • dislike

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/youtube
  • https://www.googleapis.com/auth/youtubepartner
  • https://www.googleapis.com/auth/youtube.readonly
  • https://www.googleapis.com/auth/youtube.force-ssl

For more information, see the OAuth 2.0 Overview.