Similar Assets Recommendations

Learn about using the Discovery APIs to provide recommendations for similar videos.

About Similar Assets

To provide Discovery recommendations for similar videos, use the similar/assets route. Use this API to return discovery recommendations based on the relationship to the active video. Relationships are determined based on labels and asset metadata. For example, if a viewer is watching skydiving videos, the Ooyala Discovery algorithms might return other skydiving or extreme sports videos.

To improve the accuracy of recommendations based on similar videos, make sure Backlot assets are well defined with labels and/or metadata, and use the score_type attribute to manage returned results.

Steps

Use the following steps to test Discovery recommendations based on similar assets using The Scratchpad.

  1. Choose an source asset for the similar recommendations and find the asset_id. This is the Content ID shown for the asset in Backlot. For more information refer to Routes and Attributes Common to All Asset TypesRoutes and Attributes Common to All Asset Types.
  2. Open a browser and navigate to The Scratchpad.
  3. Configure the Credentials to work with your Backlot account:
    1. Select the Your Account radio button.
    2. Enter your Backlot API Key.
    3. Enter your Backlot Secret Key
    Enter your Backlot credentials
  4. Enter the following route in the left hand text box replacing asset_id with the content_id of a video from your Backlot account:
    /v2/discover/similar/assets/asset_id?score_type=default?limit=2
    This route is comprised of the following parameters:
    Table 1. Similar Assets With Score Type Details
    Parameter Description
    v2 The version of the API to use for this request.
    discover The API to use for this request.
    similar Use the similar route for this request.
    assets Return similar assets.
    asset_id The content ID for the asset from which to base the results.
    score_type The algorithm to use for the query.
    limit_2 Return no more than two results.
  5. Select Get from the dropdown menu. Enter Route
    Backlot returns results with the following parameters:
    Table 2. Similar Assets With Score Type
    Parameter Example
    duration "duration": "37033"
    name name": "arthurbday.mp4"
    created_at "2014-09-11 21:15:16 +0000"
    preview_images "preview_images": "<previewImage>\n<url>https://ec.c.ooyala.com/12345678abcdefg</url>\n<width>400</width>\n<height>250</height>\n</previewImage>",
    bucket_info "bucket_info": "1{\"encoded\":\"12345678abcdefg\",\"position\":0}", "embed_code": "12345678abcdefg"
    hostedAtURL https://ec.c.ooyala.com"
    content_type "content_type": "Video"
    external_id "preview_image_url": "https://ec.c.ooyala.com/12345678abcdefg/12345678abcdefg",
    preview_image_url "preview_image_url": "https://ec.c.ooyala.com/12345678abcdefg"
    publishing_rule_id publishing_rule_id": "12345678abcdefg"
    description "description": "Video compilation of pictures from Arthur's second birthday."
    reason reason": "label:12345678"
Note:

Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

해당 내용이 도움 되었습니까?