|
truveo.videos.getVideos
Description
This method can be used to submit a query to the Truveo video search service. This method returns the set of video results that match the submitted query.
Request Parameters
The URL for this method accepts the following parameters:
|
appid
|
String value. Required.
The Application ID, which is a unique identifier, assigned by Truveo, for your application. To view your current Application ID or request a new one, please consult your My API Account page.
|
|
method
|
String value. Required.
The name of the method to invoke. In this case, the value of this argument should be set to 'truveo.videos.getVideos'.
|
|
query
|
String value. Optional. Default value of ' '.
The query string that will be submitted to the Truveo video search engine. This string contains your search terms and can also include Boolean operators, modifiers, filters and sorters. For a complete listing of the supported functionality, see the documentation on search query syntax. If no query string or a blank query string is provided, this method will return the top videos ordered by vrank.
|
|
results
|
Integer between 1 and 50. Optional. Default value of 10.
The number of results the search engine should attempt to return in response to your request.
|
|
start
|
Integer not less than zero. Optional. Default value of 0.
The starting position of the first result, out of the entire set of matching results, that should be returned in response to your request.
|
|
showRelatedItems
|
Integer equal to 0 or 1. Optional. Default value of 0.
The flag which indicates if related tags, channels, categories and users should be included in the results returned in response to your request. A value of 1 indicates that these items should be included, and a value of 0 indicates that they should not.
|
|
tagResults
|
Integer between 1 and 50. Optional. Default value of 10.
The number of related tags the search engine should attempt to return in response to your request. This parameter is only relevant if 'showRelatedItems' is set to 1.
|
|
channelResults
|
Integer between 1 and 50. Optional. Default value of 10.
The number of related channels the search engine should attempt to return in response to your request. This parameter is only relevant if 'showRelatedItems' is set to 1.
|
|
categoryResults
|
Integer between 1 and 50. Optional. Default value of 10.
The number of related categories the search engine should attempt to return in response to your request. This parameter is only relevant if 'showRelatedItems' is set to 1.
|
|
userResults
|
Integer between 1 and 50. Optional. Default value of 10.
The number of related users the search engine should attempt to return in response to your request. This parameter is only relevant if 'showRelatedItems' is set to 1.
|
|
showAdult
|
Integer equal to 0 or 1. Optional. Default value of 0.
The flag which indicates if adult content should be included or excluded in the results returned in response to your request. A value of 1 indicates that adult content should be included, and a value of 0 indicates that adult content should be excluded.
|
|
format
|
String value. xml by default
The format in which the response is returned. In this case it is 'json'
|
|
callback
|
String value.
The name of the callback javascript function to be invoked in client code for JSONP support. If not specified JSON format is assumed
|
Response Fields
The JSON response for this method can contain the following fields:
|
<response>
|
The top-level object for the JSON response.
|
|
<method>
|
Parent object: <response>
An object containing the name of the API method and its authentication level used to retrieve the response.
|
|
<data>
|
Parent object: <response>
An object containing all of the actual data in response to the request. Everything other than 'status' and 'method' goes in here
|
|
<query>
|
Parent object: <data>
An object containing all of the query related information associated with this response
|
|
<queryOriginal>
|
Parent object: <query>
A string containing the original submitted query associated with this response.
|
|
<querySuggestion>
|
Parent object: <query>
A string containing a suggested query, if available, for the original submitted query associated with this response.
|
|
<queryCategory>
|
Parent object: <query>
A string containing the category, if available, for the original submitted query associated with this response.
|
|
<results>
|
Parent object: <data>
An object containing all of the result sets. Eg, videoSet, categorySet, channelSet, showSet, userSet, tagSet.
|
|
<videoSet>
|
Parent object: <results>
An object containing all of the video records in the set of returned videos and some information about the set.
|
|
<totalResultsAvailable>
|
Parent object: <videoSet>
An integer representing the total number of videos in the entire set of matching videos.
|
|
<totalResultsReturned>
|
Parent object: <videoSet>
An integer representing the total number of videos returned in this VideoSet.
|
|
<firstResultPosition>
|
Parent object: <videoSet>
An integer representing the position of the first Video in the entire set of matching videos.
|
|
<title>
|
Parent object: <videoSet>
A string containing a human-readable title for the set of videos returned in response to the submitted request. For example, this field would return a string such as "Most popular 'madonna' videos in Music on MTV" for the query 'madonna category:Music channel:MTV sort:mostPopular'.
|
|
<rssUrl>
|
Parent object: <videoSet>
A string containing the URL which will return an RSS feed for the set of videos returned in response to the submitted query.
|
|
<embedTag>
|
Parent object: <videoSet>
A string containing an HTML fragment that can be used to embed the returned video search results into a web page. When this HTML fragment is pasted into an existing webpage, it will automatically display a set of clickable thumbnails for the videos that match the submitted query.
|
|
<videos>
|
Parent object: <videoSet>
An array containing all of the video records in the set of returned videos. Each element in the array contains all of the available metadata fields for an individual video record.
|
|
<id>
|
Parent object: <videos>
A string which serves as a unique identifier for the video record. Each returned video will always have a valid id value.
|
|
<title>
|
Parent object: <videos>
A string containing the title of the video in this result. Each returned video will always contain a title.
|
|
<videoUrl>
|
Parent object: <videos>
A string containing the URL which, when be loaded into a browser window, will play the video. Loading this URL into a browser will result in two possible behaviors. For video that plays from an embedded player inside a web page, loading this URL will simply open the web page that contains the embedded video player. For video that plays in a standalone media player, loading this URL will first open the web page which links to the video (also called the 'referrer page') and then open a standalone media player which will play the video. Each returned video will always have a valid videoUrl value.
|
|
<channel>
|
Parent object: <videos>
A string containing the name of the channel associated with this video record. For example, this string might contain a value such as 'CNN', 'ESPN', 'MTV', 'YouTube', etc.. Each returned video will always have a valid channel value.
|
|
<channelUrl>
|
Parent object: <videos>
A string containing the URL for the channel associated with this video record. For example, this string might contain 'http:\www.cnn.com', 'http:\www.espn.com', etc.. Each returned video will always have a valid channelUrl value.
|
|
<dateFound>
|
Parent object: <videos>
A string representation of the date when this video was first indexed by the Truveo video search engine. The format of this date conforms to the RFC 2822 specification. For example, 'Thu, 21 Dec 2000 16:01:07 +0200' is the typical date format. Each returned video will always have a valid dateFound value.
|
|
<vRank>
|
Parent object: <videos>
A decimal value between 0 and 1 which represents the rank of this video record in the Truveo video search engine. VRank is an aggregate metric that is continuously calculated and assigned to each video record based on factors such as video popularity, recency, quality, etc.. Unless an alternate sorting operator is applied to the search results, the videos returned in response to a request will be ordered by descending vRank value. Each returned video will always have a valid vRank value.
|
|
<textRelevancy>
|
Parent object: <videos>
A decimal value between 0 and 1 indicating how closely the text in the submitted query matches the text in this video record. A higher value indicates that the text in this video record is more closely related to the submitted query.
|
|
<description>
|
Parent object: <videos>
A string containing a text description of the video in this result. When provided, this length of this description is typically one to three sentences.
|
|
<referrerPageUrl>
|
Parent object: <videos>
A string containing the URL of the web page where a link to the video in this result is located.
|
|
<actor>
|
Parent object: <videos>
A string containing the names of one or multiple actors associated with the video in this result. When available, this string is typically a comma-separated list of actor names.
|
|
<director>
|
Parent object: <videos>
A string containing the names of one or multiple directors associated with the video in this result. When available, this string is typically a comma-separated list of director names.
|
|
<writer>
|
Parent object: <videos>
A string containing the names of one or multiple writers associated with the video in this result. When available, this string is typically a comma-separated list of writer names.
|
|
<producer>
|
Parent object: <videos>
A string containing the names of one or multiple producers associated with the video in this result. This field is commonly used for movie trailers and clips. When available, this string is typically a comma-separated list of director names.
|
|
<artist>
|
Parent object: <videos>
A string containing the name of the musical artist or group associated with the video in this result. This field is typically used for clips such as music videos.
|
|
<album>
|
Parent object: <videos>
A string containing the name of the musical album associated with the video in this result. This field is typically used for clips such as music videos.
|
|
<distributor>
|
Parent object: <videos>
A string containing the name of the distribution organization, such as 'Warner Brothers' or 'Sony Pictures', associated with the video in this result.
|
|
<author>
|
Parent object: <videos>
A string containing the name of the person or organization responsible for authoring the video associated with this result.
|
|
<copyright>
|
Parent object: <videos>
A string containing any applicable copyright message for the video in this result.
|
|
<rating>
|
Parent object: <videos>
A string containing the rating for the video in this result. For example, this field may contain a value such as 'G', 'PG-13', 'TV-MA', etc..
|
|
<runtime>
|
Parent object: <videos>
An integer which represents the duration of the video clip in seconds.
|
|
<category>
|
Parent object: <videos>
A string that contains the category of the video in this result. For example, this field might contain a value such as 'News', 'Sports', 'Movies', etc..
|
|
<tags>
|
Parent object: <videos>
A string that contains a comma-delimited list of tags that are used to describe the video in this results. For example, this string might be something like 'funny, jerry seinfeld, TV'.
|
|
<showName>
|
Parent object: <videos>
A string that contains the name of the show associated with the video in this result. For example, this field could contain a value such as 'Welcome Back Kotter', 'Star Trek', 'Scrubs', etc.. This field is typically used for television shows and clips.
|
|
<showUrl>
|
Parent object: <videos>
A string that contains the URL which will provide additional information about the show identified in the showName field.
|
|
<episodeName>
|
Parent object: <videos>
A string that contains the episode name associated with the video in this result. For example, for the television show 'Star Trek', an episode name might be 'The Trouble With Tribbles', 'The Enemy Within', etc.. This field is typically used for television shows and clips.
|
|
<episodeNumber>
|
Parent object: <videos>
A string that contains a numerical value representing the episode number associated with the video in this result. This field is typically used for television shows and clips.
|
|
<seasonNumber>
|
Parent object: <videos>
A string that contains a numerical value representing the season number associated with the video in this result. This field is typically used for television shows and clips.
|
|
<country>
|
Parent object: <videos>
A string that contains the name of the country of origin specified for the video in this result. For example, this field might contain a value such as 'United States', 'France', 'Canada', etc.. Generally, country names will correspond with the ISO 3166-1 specification.
|
|
<language>
|
Parent object: <videos>
A string that contains the language associated with the video in this result. For example, this field might contain a value such as 'English', 'French', etc.. Generally, language names will correspond with the ISO 639 specification.
|
|
<dateProduced>
|
Parent object: <videos>
A string that describes the date or time period when the video in this result was originally produced.
|
|
<registerUrl>
|
Parent object: <videos>
A string containing the URL which provides more information about how to register to access the video in this result. This field is only populated for video that can be viewed for free but requires each user to register with the host site before the video can be viewed.
|
|
<subscribeUrl>
|
Parent object: <videos>
A string containing the URL which provides more information about how to subscribe to access the video in this result. This field is only populated for video which requires users to purchase a subscription before the video can be viewed.
|
|
<subscribePrice>
|
Parent object: <videos>
A string containing the subscription price, as described by the subscribeUrl. For example, this field could contain the value '$10.99', '€5.99', etc..
|
|
<rentUrl>
|
Parent object: <videos>
A string containing the URL which provides more information about how to rent the video in this result. This field is only populated for video that can be rented for a fee.
|
|
<rentPrice>
|
Parent object: <videos>
A string containing the rent price, as described by the rentUrl. For example, this field could contain the value '$0.99', '€1.99', etc..
|
|
<buyUrl>
|
Parent object: <videos>
A string containing the URL which provides more information about how to buy the video in this result. This field is only populated for video that can be purchased to own.
|
|
<buyPrice>
|
Parent object: <videos>
A string containing the purchase price, as described by the buyUrl. For example, this field could contain the value '$14.99', '€10.99', etc..
|
|
<live>
|
Parent object: <videos>
An integer indicating if the video in this result is a live stream. If the value of this field is '1', the video is a live stream. Otherwise, the video is not live.
|
|
<editorsPick>
|
Parent object: <videos>
An integer indicating if the video in this result has been featured by a human editor. If the value of this field is '1', the video has been promoted in the search results by a human editor.
|
|
<viewCount>
|
Parent object: <videos>
An integer representing the number of times the video in this result has been viewed.
|
|
<favoriteCount>
|
Parent object: <videos>
An integer representing the number of times the video in this result has been selected as a user favorite.
|
|
<userRating>
|
Parent object: <videos>
A decimal value between 0 and 5 representing the average user rating for the video in this result.
|
|
<userRatingCount>
|
Parent object: <videos>
An integer representing the number of times this video has been rated.
|
|
<thumbnailUrl>
|
Parent object: <videos>
A string containing the URL for the thumbnail image associated with the video in this result. While all thumbnails will not necessarily have a consistent height and width, this thumbnail image will typically have a width of 75 pixels.
|
|
<thumbnailUrlLarge>
|
Parent object: <videos>
A string containing the URL for a large-format thumbnail image associated with the video in this result. This thumbnail image will typically have a width of 400 pixels.
|
|
<previewVideoUrl>
|
Parent object: <videos>
A string containing the URL that will play a free preview of the video in this record. This field is typically used for premium video, where the video specified by the videoUrl field can only be viewed after a purchase has been made.
|
|
<hiDefVideoUrl>
|
Parent object: <videos>
A string containing the URL that will play a high-definition version of the video in this record. For example, for videos that are available in AOL Hi-Q format, this field will provide the URL that, when loaded in a browser, will begin playing a high-definition version of this video.
|
|
<videoPlayerEmbedTag>
|
Parent object: <videos>
A string containing the HTML tag which, when embedded in an existing web page, will launch an inline media player to play the video in this result.
|
|
<videoResultEmbedTag>
|
Parent object: <videos>
A string containing the HTML tag which, when embedded in an existing web page, will display a thumbnail and related information about the video in this result. When this thumbnail is clicked, it will launch the appropriate media player to play the video.
|
|
<quality>
|
Parent object: <videos>
A string that describes the quality of the video in this result. For example, the value of this field could be 'excellent', 'good', 'fair' or 'poor'.
|
|
<formats>
|
Parent object: <videos>
A string containing a comma-separated list of the formats supported by the video in this result. For example, for a video that can be played using Windows Media Player, RealPlayer, or QuickTime, the value in this field would be 'win, real, qt'.
|
|
<bitrate>
|
Parent object: <videos>
A string such as '300 kbps' that describes the bitrate of the video in this result.
|
|
<width>
|
Parent object: <videos>
An integer representing the value in pixels for the width of the video in this result.
|
|
<height>
|
Parent object: <videos>
An integer representing the value in pixels for the height of the video in this result.
|
|
<fileSize>
|
Parent object: <videos>
A string such as '5204 kb' that specifies the size of the file associated with the video in this result.
|
|
<frameRate>
|
Parent object: <videos>
A string such as '24 fps' that specifies the frame rate of this video in this result.
|
|
<codec>
|
Parent object: <videos>
A string that identifies the codec used to encode the video in this result.
|
|
<sponsored>
|
Parent object: <videos>
An integer representing the type of sponsored result this video is. 0 indicates unsponsored result, 1 indicates contextually relevant sponsored result, and 2 indicates a non-contextual sponsored result. For testing purposes, these queries always return a sponsored result: 'vsl', 'sim:3276274608'.
|
|
<canonicalId>
|
Parent object: <videos>
A video record can have multiple unique identifiers. The canonical id is designed to be used for the canonical link element so that one video record only has one identifier for SEO purposes.
|
|
<redirectFor>
|
Parent object: <Video>
For certain browsers, a video cannot be displayed in an iframe. This field lists these browsers for the video, if any.
|
|
<tagSet>
|
Parent object: <results>
An object containing all of the tags associated with the entire set of matching videos and ome information about the set. The tagSet is returned only if the parameter 'showRelatedItems' is set to 1 or 2.
|
|
<totalResultsReturned>
|
Parent object: <tagSet>
An integer representing the total number of tags returned in this tagSet.
|
|
<firstResultPosition>
|
Parent object: <tagSet>
An integer representing the position of the first Tag in the set of returned tags.
|
|
<tags>
|
Parent object: <tagSet>
An array of objects containing all of the tags. Each element in the array is a tag object that holds the name and count values of a single tag.
|
|
<name>
|
Parent object: <tags>
A string containing the name of the tag.
|
|
<count>
|
Parent object: <tags>
An integer representing the total number of times this tag has been assigned to any of the videos in the result set.
|
|
<channelSet>
|
Parent object: <results>
An object containing all of the channels associated with the entire set of matching videos and some information about the set. The channelSet is returned only if the parameter 'showRelatedItems' is set to 1 or 2.
|
|
<totalResultsReturned>
|
Parent object: <channelSet>
An integer representing the total number of channels returned in this channelSet.
|
|
<firstResultPosition>
|
Parent object: <channelSet>
An integer representing the position of the first Channel in the set of returned channels.
|
|
<channels>
|
Parent object: <channelSet>
An array of objects containing all of channels. Each element in the array is a channel object that hols the name and count values of a single channel.
|
|
<name>
|
Parent object: <channels>
A string containing the name of the channel.
|
|
<count>
|
Parent object: <channels>
An integer representing the total number of times this channel has been assigned to any of the videos in the result set.
|
|
<categorySet>
|
Parent object: <results>
An object containing all of the categories associated with the entire set of matching videos and some information about the set. The categorySet is returned only if the parameter 'showRelatedItems' is set to 1 or.
|
|
<totalResultsReturned>
|
Parent object: <categorySet>
An integer representing the total number of categories returned in this categorySet.
|
|
<firstResultPosition>
|
Parent object: <categorySet>
An integer representing the position of the first Category in the set of returned categories.
|
|
<categories>
|
Parent object: <categorySet>
An array of objects containing all of the categories. Each element in the array is a category object that holds the name and count values of a single category.
|
|
<name>
|
Parent object: <categories>
A string containing the name of the category.
|
|
<count>
|
Parent object: <categories>
An integer representing the total number of times this category has been assigned to any of the videos in the result set.
|
|
<userSet>
|
Parent object: <results>
An object containing all of the users associated with the entire set of matching videosand some information about the set. The userSet is returned only if the parameter 'showRelatedItems' is set to 1 or 2.
|
|
<totalResultsReturned>
|
Parent object: <userSet>
An integer representing the total number of users returned in this userSet.
|
|
<firstResultPosition>
|
Parent object: <userSet>
An integer representing the position of the first User in the set of returned users.
|
|
<users>
|
Parent object: <userSet>
An array of objects containing all of the users. Each element in the array is a user object that holds the name and count values of a single user.
|
|
<name>
|
Parent object: <users>
A string containing the name of the user.
|
|
<count>
|
Parent object: <users>
An integer representing the total number of times this user has been assigned to any of the videos in the result set.
|
Example JSON Request URL
A sample REST-style request for this method can be constructed as follows:
http://xml.truveo.com/apiv3 ?appid=[myAppId] &method=truveo.videos.getVideos &query=Jennifer+Lopez &results=5 &start=0 &showRelatedItems=1 &tagResults=10 &channelResults=10 &categoryResults=10 &userResults=10 &showAdult=0 &format=json &callback=parseJSON
Example JSON Response
A sample JSON response for this method is listed in the text field below. Click here for a sample JSON reply
Errors
If execution of this method is not successful, the following error codes can be returned:
|
1
|
Invalid request: 'appid'
An application ID was not submitted with the request.
|
|
2
|
Invalid request: 'method'
A method was not submitted with the request.
|
|
5
|
Invalid request: 'query'
The query parameter was not submitted with the request.
|
|
3
|
Invalid request: 'start'
The start parameter must be a non-negative integer.
|
|
4
|
Invalid request: 'results'
The results parameter must be an integer between 1 and 50.
|
|
7
|
Invalid request: 'showAdult'
The showAdult parameter must be 0 or 1.
|
|
21
|
Invalid request: 'showRelatedItems'
The showRelatedItems parameter must be 0 or 1.
|
|
8
|
Invalid request: 'tagresults'
The tagresults parameter must be an integer between 1 and 50.
|
|
9
|
Invalid request: 'channelresults'
The channelresults parameter must be an integer between 1 and 50.
|
|
10
|
Invalid request: 'categoryresults'
The categoryresults parameter must be an integer between 1 and 50.
|
|
11
|
Invalid request: 'userresults'
The userresults parameter must be an integer between 1 and 50.
|
|
12
|
Service Unavailable
Truveo Video Search API service unavailable.
|
|
13
|
Method not found.
The method you submitted with the request was not valid.
|
|
14
|
Access Denied: invalid appid.
The application ID submitted with the request is invalid.
|
|
15
|
Access Denied: appid over limit.
The application ID submitted with the request is over the daily request limit.
|
|