Trending video's downloaden met de Bing Video's zoeken-API

Waarschuwing

Op 30 oktober 2020 zijn de Zoeken in Bing API's verplaatst van Azure AI-services naar Zoeken in Bing Services. Deze documentatie is alleen bedoeld ter referentie. Zie de bing-documentatie voor zoeken-API voor bijgewerkte documentatie. Zie Een Zoeken in Bing-resource maken via de Azure Marketplace voor instructies over het maken van nieuwe Azure-resources voor Bing Search.

Met de Bing Video's zoeken-API kunt u de huidige trending video's vinden op internet en in verschillende categorieën.

GET-aanvraag

Als u de trending video's van vandaag wilt ophalen uit de Bing Video's zoeken-API, verzendt u de volgende GET-aanvraag:

GET https://api.cognitive.microsoft.com/bing/v7.0/videos/trending?mkt=en-us HTTP/1.1
Ocp-Apim-Subscription-Key: 123456789ABCDE  
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 822)  
X-MSEdge-ClientIP: 999.999.999.999  
X-Search-Location: lat:47.60357;long:-122.3295;re:100  
X-MSEdge-ClientID: <blobFromPriorResponseGoesHere>  
Host: api.cognitive.microsoft.com  

Marktondersteuning

De volgende markten ondersteunen trending video's.

  • en-AU (Engels, Australië)
  • en-CA (Engels, Canada)
  • en-GB (Engels, Groot-Brittannië)
  • en-ID (Engels, Indonesië)
  • en-IE (Engels, Ierland)
  • en-IN (Engels, India)
  • en-NZ (Engels, Nieuw-Zeeland)
  • en-PH (Engels, Filipijnen)
  • en-SG (Engels, Singapore)
  • en-US (Engels, Verenigde Staten)
  • en-WW (Engelstalig, wereldwijde statistische code)
  • en-ZA (Engels, Zuid-Afrika)
  • zh-CN (Chinees, China)

Voorbeeld van JSON-antwoord

In het volgende voorbeeld ziet u een API-antwoord dat trending video's bevat, die worden weergegeven op categorie en subcategorie. Het antwoord bevat ook bannervideo's, de populairste trending video's, en kunnen afkomstig zijn uit een of meer categorieën.

{  
    "_type" : "TrendingVideos",  
    "bannerTiles" : [
        {  
            "query" : {  
                "text" : "Hello - Smith",  
                "displayText" : "Hello - Smith",  
                "webSearchUrl" : "https:\/\/www.bing.com\/cr?IG=3E8F5..."
            },  
            "image" : {  
                "description" : "Image from: contosowallpapers.com",  
                "thumbnailUrl" : "https:\/\/tse4.mm.bing.net\/th?id=RsA%2fdPlTmx4zS...",  
                "headLine" : "\"Hello\" is a song by...",  
                "contentUrl" : "http:\/\/www.contosowallpapers.com\/wp-content..."  
            }  
        },  
        . . .  
    ],  
    "categories" : [
        {  
            "title" : "Music videos",  
            "subcategories" : [
                {  
                    "tiles" : [
                        {  
                            "query" : {  
                                "text" : "Song Title - Artist Name",  
                                "displayText" : "Song Title - Artist Name",  
                                "webSearchUrl" : "https:\/\/www.bing.com\/cr?IG=3E8F5..."
                            },  
                            "image" : {  
                                "description" : "Image from: contoso.com",  
                                "thumbnailUrl" : "https:\/\/tse2.mm.bing.net\/th?id=...",  
                                "contentUrl" : "http:\/\/images6.contoso.com\/image..."  
                            }  
                        },  
                        . . .  
                    ],
                    "title" : "Top "  
                },
                {
                    "tiles" : [...],
                    "title" : "Trending"
                },
                . . .
            ],  
        },
        {
            "title" : "Viral videos",
            "subcategories" : [
                {
                    "tiles" : [...],
                    "title" : "Trending"
                },
                . . .
            ],  
        },
        . . .  
    ]  
}  
  

Volgende stappen