Google Custom Search JSON API webpages only - google-api

I am building a search component that allows users to filter by type of response. You can see all responses, just the PDFs, or just the webpages. I have the first two parts down, all responses is a basic search and you can filter for pdfs using &fileType=pdf in the query, but i'm not sure how to exclude the pdfs and only return web pages.
I can't find a similar "exclude" param such as -fileType which seems to be supported in other similar APIs. Maybe I just need to format the URL the right way... If anyone has insight into how to accomplish something like this I would appreciate it.

You can try with -inurl:pdf in your URL.

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.

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.

Does Google Shows the AJAX based website results in search?

I want to know that i am making a website which shows all the latest information on the front page... the website is completely AJAX working , So all the data is in the Server Databases , If someone searches for a perticular data available in my site through Search engines then will the search engine searches the database?
By default, no, AJAX-only accessible content is not going to be crawled by Google. There is a convention you can use, however, to ensure that it does get crawled - the "Hash Wallop".
When Google (and other search engines), encounter a link that starts with "#!", it will "crawl" the dynamic content returning from an AJAX call. To take advantage of this, rather than having something like:
trigger ajax
...you will want to use something like:
trigger ajax
There is some more info on the technique here (and lots of others sites, just google it): http://www.seomoz.org/blog/how-to-allow-google-to-crawl-ajax-content
Some insight: http://coding.smashingmagazine.com/2011/09/27/searchable-dynamic-content-with-ajax-crawling/
Also, you might want to look into HTML caching, it will boost your SEO performance.

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

Ruby access/submit queries on websites

Say I wanted to create a ruby script that would access google, search for 'dogs', and then return the links of the top 5 results. How would this be implemented in ruby?
Thanks.
To clarify, I'm not looking for a way to search Google specifically. I want this to work on other sites too, such as amazon.com, dictionary.com, etc.
See the answer to this question: Using Google Search REST API in Ruby
You could hack through it with hpricot, if a google api doesn't exist already. Or here is a script
I would use cURL to actually GET the page contents (its a simple GET request to google.com/?q=stuff). Then you'll need to use regular expressions and intuition to parse the DOM, extract the links, and display :)

Resources