CodeToad
CodeToad

Reputation: 4724

google custom search: get thumbnails in image search results

I am using Rest4Net.GoogleCustomSearch to search images on google custom search. I see no thumbnails in the results, and no search parameter that seems to enable thumbnails in the response.

Upvotes: 3

Views: 1157

Answers (2)

CodeToad
CodeToad

Reputation: 4724

I got it work by not using the Rest4Net.GoogleCustomSearch API

I make a request to https://www.googleapis.com/customsearch/v1, building the url parameters 'manually' and return the json string directly to the client

as a side note, some features, notably the imgType param, are not working as expected. I have resorted to adding the value to the search term instead.

Upvotes: 0

some ideas
some ideas

Reputation: 74

I use Google CSE with XML responses. You must be initiating a search with &searchtype=image and some optional image parameters (https://developers.google.com/custom-search/docs/xml_results#request-parameters). Are you sure the nuget Google custom search API accessor supports this?

Processing the XML is pretty trivial, have you looking into postprocessing the XML yourself?

Upvotes: 4

Related Questions