Images are missing with OriginalImg attribute

Renjith Nayar 21 Reputation points
2020-07-21T16:38:54.703+00:00

Hi Team,
I believe with attribute -> originalImg = true, the response should include the images. But some of the news content is missing the image. Please try the below URL and let me know what im doing wrong.

https://api.cognitive.microsoft.com/bing/v7.0/news/search?q=Corona+site:ndtv.com OR site:indiatvnews.com OR site:thehindu.com&cc=IN&count=50&language:en&originalImg=true&freshness=Day

Thank you

Bing News Search
Bing News Search
A Bing service that supports searching for news and get comprehensive results.
50 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. romungi-MSFT 46,751 Reputation points Microsoft Employee
    2020-07-22T13:05:57.107+00:00

    @RenjithNayar-6960 I have tried this query with the same search criteria and the response does include the URLs for thumbnail and the original image as mentioned in the documentation.

    A Boolean value that determines whether the image's contentUrl contains a URL that points to a thumbnail of the original article's image or the image itself.

    If the article includes an image, and this parameter is set to true, the image's contentUrl property contains a URL that you may use to download the original image from the publisher's website. Otherwise, if this parameter is false, the image's contentUrl and thumbnailUrl URLs both point to the same thumbnail image.

    The default is false.

    Use this parameter only with the News Search API. Do not specify this parameter when calling the Web Search API. Trending Topics ignores this parameter.

    The first response here indicates the following URLs

     GET https://resource.cognitiveservices.azure.com/bing/v7.0/news/search?q=Corona+site:ndtv.com OR site:indiatvnews.com OR site:thehindu.com&count=50&offset=0&mkt=en-us&safeSearch=Moderate&originalImg=true&cc=IN&language=en&freshness=Day HTTP/1.1
        
         
        
        "name": "Can't final yr exams be MCQ, assignment based: HC asks UGC",
         "url": "https:\/\/www.indiatvnews.com\/news\/india\/ugc-final-year-exams-mcq-assignment-based-delhi-high-court-636270",
         "image": {
           "contentUrl": "https:\/\/resize.indiatvnews.com\/en\/resize\/newbucket\/715_-\/2020\/07\/delhi-high-court-1595421749.jpeg",
           "thumbnail": {
             "contentUrl": "https:\/\/www.bing.com\/th?id=ON.B82C2618BF546D6DB7D3B5C3E2ADC3CE&pid=News",
             "width": 700,
             "height": 391
    

    The URLs

    Image URL https://resize.indiatvnews.com/en/resize/newbucket/715\_-/2020/07/delhi-high-court-1595421749.jpeg

    Thumbnail URL https://www.bing.com/th?id=ON.B82C2618BF546D6DB7D3B5C3E2ADC3CE&pid=News

    As mentioned the original image and thumbnail URLs are different. If the OriginalImg is set to false both the URLs are same and default to thumbnail URL.


  2. Sam Singh 1 Reputation point
    2020-07-30T12:31:52.373+00:00

    Facing same issue. Below NEWS API is not returning the original images now, it was working fine earlier.
    Can someone please help here.
    https://api.cognitive.microsoft.com/bing/v7.0/news?mkt=en-us&originalImg=true


  3. romungi-MSFT 46,751 Reputation points Microsoft Employee
    2020-07-31T06:47:12.03+00:00

    @Sam Singh Does your request have any query(q) parameters? I don't see any in the above URI. The original image and thumbnail images are returned only if the news article has an image, if there is no image and if the 'originalimg' parameter is not set the URI for thumbnail and image will be the same. Please try something like this query:

    https://resourcename.cognitiveservices.azure.com/bing/v7.0/news/search?q=corona&count=10&offset=0&mkt=en-us&safeSearch=Moderate&originalImg=true

    The result contains the following:

        "image": {  
          "contentUrl": "https:\/\/images.axios.com\/IQ6azjlzVLDggvrPfwJP1CXVFwo=\/fit-in\/1366x1366\/2020\/07\/28\/1595975863692.png",  
          "thumbnail": {  
            "contentUrl": "https:\/\/www.bing.com\/th?id=ON.EA6C8D548851AA26864C8CCADEB21FB8&pid=News",  
    

    Please check this image/thumbnail.

    Image:

    https://images.axios.com/IQ6azjlzVLDggvrPfwJP1CXVFwo=/fit-in/1366x1366/2020/07/28/1595975863692.png

    Thumbnail:
    https://www.bing.com/th?id=ON.EA6C8D548851AA26864C8CCADEB21FB8&pid=News

    I hope this clarifies.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.