locked
Receiving Truncated Display URLs in Bing Web Search API Response for long URLs RRS feed

  • Question

  • Hello

    I had recently integrated the Free version of the Web Search API of Bing in one of our applications. I did notice truncated URLs whenever long URLs are in the API response for the key displayUrl.

    The following is taken from the Bing API response, for a keyword,

    example:

    [7] => Array
            (
                [@type] => s:WebPage
                [@id] => #WebPages.7
                [s:name] => Spotify CEO pens blogpost on Taylor Swift and the state of ...
                [s:url] => https://www.bing.com/cr?IG=7A9C5C198949437CAC41ABA3518A6741&CID=11141AD6B6D66AFF052A1343B7E76BD2&rd=1&h=8rUyXFXZD_511eWW13JDkB7GnTpXx4yCBEdSOlXs7ZU&v=1&r=https%3a%2f%2fwww.engadget.com%2f2014%2f11%2f13%2fspotify-ceo-pens-blogpost-on-taylor-swift-and-the-state-of-music%2f&p=DevEx,5192.1
                [s:thumbnailUrl] => https://www.bing.com/th?id=https%3a%2f%2fs.aolcdn.com%2fdims5%2famp%3adb6f87d97529b8b6b2e1b4035393b0626c592167%2ft%3a1200%2c630%2fq%3a80%2f%3furl%3dhttps%253A%252F%252Fs.aolcdn.com%252Fdims-shared%252Fdims3%252FGLOB%252Fcrop%252F4926x3279%252B1%252B0%252Fresize%252F590x393%2521%252Fformat%252Fjpg%252Fquality%252F85%252Fhttp%253A%252F%252Fhss-prod.hss.aol.com%252Fhss%252Fstorage%252Fmidas%252F6d70403e0ae4d26a807b2b2df16b2c88%252F201085509%252F458314418.jpg&w=70&c=1&pid=5.1
                [displayUrl] => https://www.engadget.com/2014/11/13/spotify-ceo-pens-blogpost-on...
                [snippet] => Last week, Taylor Swift abruptly removed all of her music from Spotify, a significant move considering that Swift's latest album 1989 has been perched at the top of ...
                [dateLastCrawled] => 2016-08-31T17:05:00
            )

    Please observe, displayUrl value is truncated here,

    https://www.engadget.com/2014/11/13/spotify-ceo-pens-blogpost-on...

    while, actual url is,

    https://www.engadget.com/2014/11/13/spotify-ceo-pens-blogpost-on-taylor-swift-and-the-state-of-music/

    Note: This actual url can be obtained by triggering the value of s:url i.e,

    https://www.bing.com/cr?IG=7A9C5C198949437CAC41ABA3518A6741&CID=11141AD6B6D66AFF052A1343B7E76BD2&rd=1&h=8rUyXFXZD_511eWW13JDkB7GnTpXx4yCBEdSOlXs7ZU&v=1&r=https%3a%2f%2fwww.engadget.com%2f2014%2f11%2f13%2fspotify-ceo-pens-blogpost-on-taylor-swift-and-the-state-of-music%2f&p=DevEx,5192.1


    ------

    Some References:

    https://social.msdn.microsoft.com/Forums/en-US/c1881609-d39d-4c15-95a1-3b31ab8859ae/display-urls-truncated-in-bing-api-response?forum=DataMarket

    https://social.msdn.microsoft.com/Forums/en-US/4c26b4d6-ffb4-41a8-b1c7-e094868cc89a/bing-api-response-resulting-in-shortened-or-truncated-display-url?forum=mlapi

    I am asking this question after making sure that the Bing API Response for Web Search API is giving truncated URLs for long URL Scenario (value of displayUrl key),

    please help with getting the complete URL for the displayUrl value,

    thank you




    Monday, September 19, 2016 3:50 PM

All replies

  • Hi,

    This is by design where the URL is meant for display purposes only and is not well formed.

    Wednesday, November 9, 2016 11:48 PM