JSON Implementation for Video SourceType (Bing, Version 2.1)

Bing

This topic contains the following details of an Video SourceType query sent to the JSON interface:

  • Request Example

  • Response Example

For an example of JavaScript code that would send the request in this topic, see JSON Code Sample (Video SourceType).

This section contains an example of an HTTP query string that the aforementioned code might generate.

http://api.bing.net/json.aspx?appid= Insert your AppId here &sources=video&market=en-us&query=xbox site:microsoft.com&adult=moderate&video.count=2 &JsonType=callback&JsonCallback=SearchCompleted

This section contains an example of a response that Bing might return when sent the query string in the previous section:


if(typeofSearchCompleted=='function')SearchCompleted({
   "SearchResponse":{
      "Version":"2.1",
      "Query":{
         "SearchTerms":"xbox site:microsoft.com"
      },
      "Video":{
         "Total":200,
         "Offset":0,
         "Results":[
            {
               "Title":"Xbox, Xbox.com, and Xbox LIVE Advertising - Microsoft Advertising",
               "PlayUrl":"http:\/\/advertising.microsoft.com\/gaming\/xbox-advertising",
               "RunTime":78156,
               "ClickThroughPageUrl":"http:\/\/bing.com\/video\/results.aspx?q=xbox&scope=video&docid=663626973563&FORM=SOAPGN",
               "StaticThumbnail":{
                  "Url":"http:\/\/ts4.images.live.com\/video\/thumbnail.aspx?q=663626973563&id=30fc59179deb3182887b21563a2dea4c",
                  "ContentType":"image\/jpeg",
                  "Width":160,
                  "Height":90,
                  "FileSize":2870
               }
            },
            {
               "Title":"Whiteboard Videos ",
               "PlayUrl":"http:\/\/msdn.microsoft.com\/en-us\/testing\/bb734786.aspx",
               "RunTime":550954,
               "ClickThroughPageUrl":"http:\/\/bing.com\/video\/results.aspx?q=xbox&scope=video&docid=562234982542&FORM=SOAPGN",
               "StaticThumbnail":{
                  "Url":"http:\/\/ts3.images.live.com\/video\/thumbnail.aspx?q=562234982542&id=df47eb1200d69d0a60ca7e3dfe63116a",
                  "ContentType":"image\/jpeg",
                  "Width":160,
                  "Height":120,
                  "FileSize":3540
               }
            }
         ]
      }
   }
   }/*pageview_candidate*/
});
Show: