Query google to get first image result - google-api

I am trying to setup a process where I can query a google API with a text string to get the first image result.
I have setup a Google Custom Search Engine but I can't seem to replicate a standard google search. My settings:
Image Search: ON
Domains to include: google.com. Include all sites this page links to
My hope with above settings was that it would imitate a standard google search. But when I try the term "poker", I get no results. I'm assuming this has something to do with my CSE settings but not sure how to adjust.

You need to choose the option to search the entire web:
In the left-hand menu, under Control Panel, click Basics.
In the Search Preferences section, select Search the entire web but emphasize included sites.
screenshot example

Related

Site title not appearing in google search results (Laravel)

My site title not appearing in google search results.
How can i fix this?
Google search: https://i.stack.imgur.com/Fv8Oc.png
Site title: https://i.stack.imgur.com/FfJqo.png
Code: https://i.stack.imgur.com/oQqLM.png
When did you make this change? It takes time for Google to change a page title (a few days).
You may take a look at Google documentation.
You can also add your website to Google Search Console and Ask Google to recrawl your URLs.

image search with google

Google had a beautiful API which you can use to search for large images, but unfortunately they decided to disable it. Now you can use their "custom search engine", but it doesn't get even close to what that old API could do. For a start, the results you get are not the same as if you search in the common search page with your browser, and you can't specify the size of the images you are searching for.
Is it there any programatically way I can get a list of the URLs of the images I would find in the common search google page, size included?
You can use scrapping the google image search results and parse the links to the images. urllib2 library in python can help you here.

Google Custom Search Engine API Image Search not returning results

Just setup my CSE with Image Search enabled in the Basics tab, but still ain't getting results.
If I don't use searchType=image in the query it works, if I put it back it stops working with no errors, just no results.
Any inputs?
It seems there are two elements required to consume the Google search API, the configuration of the API key and credentials.
Setup the API key here https://console.developers.google.com/project
and create your own CSE here https://www.google.co.uk/cse/all
I made the mistake like a lot of people of ignoring the CSE side of the setup (it didn't seem logical to search only my own site).
You need to create a CSE though, point it to search any url (I don't think it matters greatly), and then where it says "Sites to search" chose "Search the entire web but emphasise included sites". Also then set image search to "On".
Once you've done this browse to your new CSE, the url should contain your CX code e.g. cx=014341056213260336986:v4fl8n8sabc, you then need to use this in your request query string.
Your API query should now start returning results.
Image search needs to be switched to ON at the Custom Search Setup->Basics

Google API returning different results than website

When I do a site-specific search on google.com:
site:http://one-month-of-chat-logs.github.io security
I get 12 results. I signed up for a custom search engine (cx: 015271449006306103053:mz6wkimeenc) and API key, and I get only 3 results when I run the same search:
$ curl 'https://www.googleapis.com/customsearch/v1?key=$MY_API_KEY&cx=015271449006306103053%3Amz6wkimeenc&q=security'
Why do the results differ? Is my API request actually querying something different than the search I performed on google.com?
This google page has what you are looking for https://support.google.com/customsearch/answer/70392?hl=en
your results are unlikely to match those returned by Google Web Search, for several reasons:
Even if a custom search engine is configured to search the entire web,
it’s designed to emphasize results from your own sites.
Your custom search engine doesn’t include Google Web Search features such as
Oneboxes, real-time results, universal search, social feaures, or
personalized results.
If your custom search engine includes more than
ten sites, the results may be from a subset of our index and may
differ from the results of a 'site:' search on Google.com.
I found that it is impossible to get the right results using Google APIs. Even if the search is only for one website, their search results are different if you use their UI vs use the API and pay for it. This is I guess, because google makes more money if they can show ads, while APIs are definitely only a face saving measure.
Since some of you are ok with a paid solution(#ihsan) you can try using a third party service like https://www.expertrec.com where you can control your crawl (so crawl depth is not a problem), ranking (adjust it the way you like), use the API or the full solution, with out any ads.

Google: Disabling the appliance-hosted search page?

Is there a way to disable or password-protect the search page hosted on a Google Mini appliance? I'm referring to the page descriped in option 1 here.
I basically want to prevent someone from stumbling onto this URL and searching here rather than through one of the actual sites using the appliance.
Try some of these:
delete the default front end
delete the default collection
set the Follow and Crawl URLs for the default collection to blank
edit the XSLT stylesheet under Serving > Front Ends > Output format.
My experience is with the Google Search Applicance, so I hope this works on the Mini too.

Resources