Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How can I use google's image api to custom search for images and import them all?

share|improve this question
2  
What have you tried so far? –  Searke Mar 1 '13 at 20:38
    
I used to just Import[] a search result page, but this is not possible anymore... Seems like v9 should have integration with google.images api –  M.R. Mar 1 '13 at 21:33
    
This is a good question, why have people downvoted this? Scraping images is very common tool that people need. –  M.R. Mar 1 '13 at 21:34
    
I don't know, this is an operation that most image processing people need. wolfram|alpha query and exampledata will not suffice most times... –  user4364 Mar 1 '13 at 21:42
5  
I think people are downvoting because you didn't try anything or post what you have done before submitting the question. –  s0rce Mar 1 '13 at 22:06
add comment

1 Answer

up vote 20 down vote accepted

Using the (deprecated but easy) API documented here,

result = Import[
  "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=fuzzy%20monkey", "JSON"]

Import["url" /. ("results" /. ("responseData" /. result))[[1]]]

Mathematica graphics

If you hit the service too many times, it'll lock you out for a while.

Here's another example that gives the 24th-32nd results:

result = Import["https://ajax.googleapis.com/ajax/services/search/images?v=1.0&start=24&rsz=8&q=fuzzy+monkey", "JSON"];
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.