Trending and Popular Content

Trending enables viewers to discover videos that are popular or have gained significant momentum during the time period you specify.

Note: Rather than constructing ad hoc requests (with individual parameters for each request), consider using discovery profiles to centralize your settings and recommendations behavior. Discovery profiles are defined configurations of settings created by you, which you then reuse by reference on the GET routes. For more information, see Discovery Profiles.

Get Videos with the Most Momentum

[GET] /v2/discover/trending/momentum

Get the Most Popular Videos

[GET] /v2/discover/trending/top   

Query String Parameters

The following table describes the query string parameters specific to this route.

Parameter Description Required?
Editorial functions See the descriptions of editorial functions, such as discovery_profile_id, in Query String Parameters No
countries Specifies the country or countries to evaluate.

Type: String

Valid Values: all | valid ISO-639-1 two-digit country codes

Default all

Example: countries=us,uk,ca

No
time Specifies the end date and time of the data to return. For example, if you specify December 31st with a monthly window, it returns results from the month of December. If you specify December 31st with a weekly window, it returns data from December 31st and the previous six days.
Note: You can specify a date up to 30 days old.

Type: String

Valid Values: now | YYYY-MM-DD | YYYY-MM-DD-HH

Default now

Example: time=2013-12-31

No
window Specifies the window of time to evaluate. For example, you might want to return the most popular videos for the day for frequent visitors and the most popular videos for the week for less frequent visitors.

Type: String

Valid Values: hour | day | week | month

Default day

Example: window=week

No

Examples

The following example returns the five most popular videos for the day:
[GET] /v2/discover/trending/top?countries=all&time=now&window=day&limit=5

The return response is similar to the following:

		{
		  "results": [
		    {
		      "name": "Cat Video #145678434",
		      "description": "More cats!",
		      "embed_code": "embed_code",
		      "external_id": "external_id",
		      "preview_image_url": "image_url",
		      "duration": "91000",
		      "hostedAtURL": null,
		      "bucket_info": "bucket_info_id",
		      "reason": "top"
		    },
		    {
		      "name": "Cat Video #145678435",
		      "description": "Even more cats!",
		      "embed_code": "embed_code",
		      "external_id": "external_id",
		      "preview_image_url": "image_url",
		      "duration": "91000",
		      "hostedAtURL": null,
		      "bucket_info": "bucket_info_id",
		      "reason": "top"
		    },
		    {
		      "name": "Cat Video #145678436",
		      "description": "Yet even more cats!",
		      "embed_code": "embed_code",
		      "external_id": "external_id",
		      "preview_image_url": "image_url",
		      "duration": "91000",
		      "hostedAtURL": null,
		      "bucket_info": "bucket_info_id",
		      "reason": "top"
		    },
		    {
		      "name": "Cat Video #145678437",
		      "description": "Can you believe it?",
		      "embed_code": "embed_code",
		      "external_id": "external_id",
		      "preview_image_url": "image_url",
		      "duration": "91000",
		      "hostedAtURL": null,
		      "bucket_info": "bucket_info_id",
		      "reason": "top"
		    },
		    {
		      "name": "Dog Video #0000001",
		      "description": "Dogs",
		      "embed_code": "embed_code",
		      "external_id": "external_id",
		      "preview_image_url": "image_url",
		      "duration": "91000",
		      "hostedAtURL": null,
		      "bucket_info": "bucket_info_id",
		      "reason": "top"
		    }
		  ]}  
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.

Was this article helpful?