How to get actual image of article when get query by categorys using news api.

Ambi Tamber 41 Reputation points
2020-12-17T01:00:47.047+00:00

Hello,
I am adding originalImg=true parameter to the url. When doing a query search, it will return actual image.
value > image > contentUrl

For category query, it will not return full image.
Is there a way to get actual image size rather than getting thumbnail when querying with category?
category query: https://api.bing.microsoft.com/v7.0/news?mkt=en-us&category=sports

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

Accepted answer
  1. romungi-MSFT 43,656 Reputation points Microsoft Employee
    2020-12-17T10:19:50.16+00:00

    @AmbiTamber-2172 The category parameter along with the originalImg parameter will return the actual image and the thumbnail image URLs. Here is a sample output from my query.

    Query:

    https://api.bing.microsoft.com/v7.0/news/search?mkt=en-IN&q=Cricket&originalImg=true&category=Sports
    

    Sample Output:

                "url": "https://www.indiatvnews.com/sports/cricket/india-vs-australia-2020-live-cricket-streaming-1st-test-match-when-where-how-to-watch-online-telecast-on-tv-sony-liv-sony-six-sony-ten-jio-tv-671971",
                "image": {
                    "contentUrl": "https://resize.indiatvnews.com/en/resize/newbucket/715_-/2020/12/test-1-1608173319.jpg",
                    "thumbnail": {
                        "contentUrl": "https://www.bing.com/th?id=OVFT.k2Nr5pfU31wUZU9airW8CC&pid=News",
                        "width": 700,
                        "height": 393
                    }
    

    The complete output:

      {
                "name": "Live Streaming Cricket India vs Australia 1st Test: How to Watch IND vs AUS Pink Ball Test Online on SonyLIV",
                "url": "https://www.indiatvnews.com/sports/cricket/india-vs-australia-2020-live-cricket-streaming-1st-test-match-when-where-how-to-watch-online-telecast-on-tv-sony-liv-sony-six-sony-ten-jio-tv-671971",
                "image": {
                    "contentUrl": "https://resize.indiatvnews.com/en/resize/newbucket/715_-/2020/12/test-1-1608173319.jpg",
                    "thumbnail": {
                        "contentUrl": "https://www.bing.com/th?id=OVFT.k2Nr5pfU31wUZU9airW8CC&pid=News",
                        "width": 700,
                        "height": 393
                    }
                },
                "description": "Find full details on when and where to watch IND vs AUS Pink Ball Test Live Online on SonyLIV and TV Telecast on Sony SIX and Sony TEN.",
                "about": [
                    {
                        "readLink": "https://api.bing.microsoft.com/api/v7/entities/48c4eac3-7489-a395-c60c-93b5d0e31495",
                        "name": "Pink"
                    },
                    {
                        "readLink": "https://api.bing.microsoft.com/api/v7/entities/6000e8f6-5c3a-c23a-dfc3-f5158401136a",
                        "name": "Sony SIX"
                    },
                    {
                        "readLink": "https://api.bing.microsoft.com/api/v7/entities/9ed5b2b6-aca0-2080-bb10-6c39fefaf7cf",
                        "name": "Streaming media"
                    }
                ],
                "provider": [
                    {
                        "_type": "Organization",
                        "name": "India TV",
                        "image": {
                            "thumbnail": {
                                "contentUrl": "https://www.bing.com/th?id=AR_9326d06252d3cc5b7a41eff093164287&pid=news"
                            }
                        }
                    }
                ],
                "datePublished": "2020-12-17T06:09:00.0000000Z",
                "category": "Sports"
            },
    

    The issue in your query is the originalImg parameter is missing. Please try to use a similar query as mentioned above and you should see both the actual image and the thumbnail.

    If the above response helped, please accept the same as answer.


0 additional answers

Sort by: Most helpful