3

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.

CodeToad
  • 4,656
  • 6
  • 41
  • 53

2 Answers2

4

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?

some ideas
  • 64
  • 3
  • 14
  • +1 and thanks for taking the time to answer. I am using the json api so its even simpler, I just pass the json response string directly to the client and its parsed by the browser. For some reason the rest4net api does not expose all the data returned by google. – CodeToad Mar 30 '16 at 06:56
0

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.

CodeToad
  • 4,656
  • 6
  • 41
  • 53