Manoj Fegde
Manoj Fegde

Reputation: 4761

Android: Bing image search result customization

I am implementing the Bing search for image searching.

I refered this link, and change my response to JSON.

It works and the result is like:

{
"d": {
    "results": [{
        "__metadata": {
            "uri": "https://api.datamarket.azure.com/Data.ashx/Bing/Search/Image?Query=\u0027Pepsi\u0027&$skip=0&$top=1",
            "type": "ImageResult"
        },
        "ID": "64737694-fc53-4d68-933d-10edc214fd3a",
        "Title": "Pepsi: Like Madonna, its look has been reinvented time and time again ...",
        "MediaUrl": "http://tjthesportsgeek.files.wordpress.com/2012/02/pepsi.png",
        "SourceUrl": "http://tjthesportsgeek.com/2012/02/14/tale-of-the-tape-coke-vs-pepsi/",
        "DisplayUrl": "tjthesportsgeek.com/2012/02/14/tale-of-the-tape-coke-vs-pepsi",
        "Width": "1588",
        "Height": "2064",
        "FileSize": "569827",
        "ContentType": "image/png",
        "Thumbnail": {
            "__metadata": {
                "type": "Bing.Thumbnail"
            },
            "MediaUrl": "http://ts2.mm.bing.net/th?id=OIP.M7f9b9a39639b9ca8bb6f1cba6e35d041H0&pid=15.1",
            "ContentType": "image/jpg",
            "Width": "369",
            "Height": "480",
            "FileSize": "19879"
        }
    },

    // Next array element

    ]
}
}

but what i need is:

  1. The json result with only MediaUrl and MediaUrl of Thumbnail. (As it is possible in Google Custom Search with the help of tag "field" like fields=items(link,image/thumbnailLink))

  2. The image only with medium size. (I searched for this and applied the filter but of no use.)

Please reply with your valuable suggestions.

Upvotes: 2

Views: 455

Answers (1)

Sirio
Sirio

Reputation: 1031

  1. You can't filter output fields.
  2. Use the parameter: ImageFilters = Size.Medium

My ref: https://onedrive.live.com/view.aspx?resid=9C9479871FBFA822!109&app=Word&authkey=!ACvyZ_MNtngQyCU

Upvotes: 1

Related Questions