import json, requests

# http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=cats
# http://www.peachpit.com/articles/article.aspx?p=1574302&seqNum=2

def showsome(count, q):
  search_results = requests.get('http://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=%d&q=%s' % (count, q))
  results = json.loads(search_results.text)
  data = results['responseData']
  print('Total results: %s' % data['cursor']['estimatedResultCount'])
  hits = data['results']
  print('Top %d hits:' % len(hits))
  for h in hits: print (' ', h['url'])
  print('For more results, see %s' % data['cursor']['moreResultsUrl'])

showsome(6, 'SPb+AU')