Get first image only on google image search

We use the following for the client to click to see images for the subject they have chosen. Works okay. I'd rather the display be in an iframe.

But the main problem is that we do not want to display all images, just 1 (or less than 5. ) Any based on the search criteria.  This should be done on the client side and be shown near the top of the resultant page.

Without getting into the Google Apps/API, and too technical, is there a simple way to ask Google to display only one or a few images, not the entire page? An entire page would simply be too much for the interface we prefer.
Here's what we're currently using.

 <a href="<cfoutput>#UCASE(NewName)#</cfoutput>&as_oq=&as_eq=&cr=&as_sitesearch=&safe=active&tbs=isz:lt,islt:qsvga,itp:photo,ift:jpg&gws_rd=ssl" target="_blank"><cfoutput>#UCASE(NewName)#</cfoutput> IMAGES</a>
<hr />

Any suggestions?
Grover McBroomAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is there any reason why you have to use Google Search for this?  Why not Flickr?
There is no way to limit the number of results displayed on a standard Google Image search results page, however you could use the Google Image Search API and have full control.

In the example below, change the search query by adding the query to the end of the URL, for example:

<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>South Area Network</title>
<link href="css/new_style.css" rel="stylesheet" type="text/css" />

<script src="" type="text/javascript"></script>
<script type="text/javascript">

 var q = 'vervet monkey';
 if( q=unescape(;

function processResults(data){
$.each(data.responseData.results, function (i, data) {
 $('#gImages').append('<a href="'+data.originalContextUrl+'" target="_blank"><img src="'+data.imageId+'" alt="'+data.titleNoFormatting+'" title="'+data.titleNoFormatting+'" /><a>');




<h1>Image Results</h1>

<div id="gImages"></div>


Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Grover McBroomAuthor Commented:
If this is server side, then Google may limit these sort of requests as there may be several hundred or more per day.

My knowledge and skill are both limited.  I assume this function is client side and that Google will see it as a client request???

I prefer Google because the search is for current news and current events, not general photos.

If this works as client side, this was an excellent solution, works great with ColdFusion.  In any event, it's great. Thank you! Helps lots.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

The code provided is client-side, not server-side code. Google will see the request as coming from your visitors, not your server.   The quota is 10,000 queries per day per unique IP address, and because it is client-side code, the quota applies to your visitors, not your website.  Even if one of your visitors ran 10,000 queries in a day, your other visitors would not be affected.
Grover McBroomAuthor Commented:
That's  fantastic. Thanks again, great service, great knowledge.
Alkin VeysalCommented:
Use simple_html_dom.php from 
$search_keyword= $_GET['name'];
$search_keyword=str_replace(' ','+',$search_keyword);
$newhtml =file_get_html("".$search_keyword."&tbm=isch&gws_rd=cr&ei=16E0WMGSKYmisAHmp6b4Ag");
$result_image_source = $newhtml->find('img', 0)->src;
echo '<img src="'.$result_image_source.'"><br>';
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Images and Photos

From novice to tech pro — start learning today.