How to use AJAX to search Google Images? - ajax

I'm trying to pull pictures from Google Images using AJAX and a color filter.
The Google Search API has been deprecated, and use of the Custom Search API is encouraged instead. However, in reading the Programmer's Guides found there, I see no option for global search instead of site-specific search. It says here to set up a custom search engine, but this requires the searching to be limited to a specific URL!
There is a similar SO post which links to a Google Groups discussion. The only solutions offered there are either to use the deprecated API, something I'm rather loath to do since access has been limited, or to use the Bing API instead, which cannot filter searches by colors.
Are there really no other solutions? Is it impossible to perform a global Google Images search using AJAX?

Related

Google Custom Search Engine - search by image

Right now I'm using Custom Search Engine (CSE) to search through entire web by search term. The request looks like:
GET "https:/www.googleapis.com/customsearch/v1?key=API_KEY&cx=SEARCH_ENGINE_ID&q=SEARCH_TERM"
And this request returns me list of search results.
But, I need to implement search by image or image url. Do Google API provide such a url param? Maybe something like "image_url"? So, the request can look the following:
https://www.googleapis.com/customsearch/v1?key=API_KEY&cx=SEARCH_ENGINE_ID&image_url=http://www.example.com/image.png
Basically, I need to implement the same functionality as images.google.com/ but using my Custom Search Engine. Thanks.
Example of what I need to implement:
As far as I know, what you're looking for is only supported by Vision AI service (partially at least, never used it before). Google CSE API only allows you to search images and not by images as you may noticed.

How does one use Magento's REST API to run keyword queries?

I'm developing a community extension for Magento, when a product search is detected, some JavaScript included with the extension needs to query the Magento API to get a larger number of results than are rendered on page.
I have the API configured, responding, and returning useful data, but I'm struggling to find a way to apply a query to the API call. I've tried adding ?q= or ?keyword= and similar, but it continues to return the same set of data without any filtering applied. Countless passes through Google, Magento StackExchange, and various Magento developer forums haven't made it clear one way or another if this is even possible.
Does the REST API support keyword / phrase searches, or will my extension need to include a block that adds this functionality to the REST API?
Did you take a look at Magento API Filtering .
You could also create you own Custom API or Extending the Core API

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 similar image search API

I'm trying to find out if there is a way to do google similar image searches via an API?
I know the image search api is depreciated but is it still useable?
https://developers.google.com/image-search/
Also... It seems that you can do image searches with the custom search api but I can't seem to work out if a similar image search is possible.
http://thenextweb.com/dd/2012/02/14/googles-custom-search-api-now-supports-image-only-results/
Any leads on advice on working this our would be appreciated.
Thanks!
If you have a URL for a hosted image (using Dropbox, imgur, etc), the answer at https://stackoverflow.com/a/15134958/116891 shows you how to find similar images. Basically,
http://images.google.com/searchbyimage?image_url=YOUR_HOSTED_URL
That is deprecated.
But I need JSON format of similar images result.
So, I try to use google cse but this is not supported searching of similar images.
It's just displayed image search results in a custom domain.
Another method that i try is URL.
http://images.google.com/searchbyimage?image_url=YOUR_HOSTED_URL
But this is not solution what i need.
It is because able to use in the browser. I need JSON.
Conclude, I decide to use Vision API of Google.
This is very simple.
https://cloud.google.com/vision/
You can try on the top.
First, access the URL.
Second, upload your image file on the "Try API".
Third, click "JSON" tab menu on the result.
You can be seen JSON about similar images.

Which Google API to use to search for files?

I have a search bar which should show me only the PDF files from Google when i start searching for something.Which API can i use for searching in google and how can i integrate that in my code.Are there any tutorial available for it.
You'll use the Documents List API
You'll search by MIME type.
It'll look like this (but needs to be properly encoded):
GET https://docs.google.com/feeds/default/private/full/-/{http://schemas.google.com/g/2005#kind}application/pdf

Resources