Searching with Java using Google - java

I am trying to use Java to search for a String on Google. I heard about a Google API but I wasn't able to find anything useful. It should look something like this:
I have a text file. Every Line is a String which should be googled. If the first search result is from a spezific site (for example: stackoverflow.com/**), The full link will be written in a new textfile. Any ideas how to realize that?
Thanks.

You can search on Google with its Custom Search API. There's a Java Client Library for CustomSearch API available to simplify the work. Warning : "Usage is free for all users, up to 100 queries per day."

Goolge offers a RESTful service to do custom queries programmatically called the Google Custom Search API.
It is not free though: you can submit up to 100 queries per day.

Related

How to build a full text search similar (as quick & as accurate) to Google Drive?

Google Drive searching is really amazing.
It built up a full text search index instantly right after I had uploaded the document(pdf/M$ office document).
Since I want to use this technology in my own GAE project,I was wondering
1.is there any existing api from(Google/others) provide this function
2.how to implement by myself.
On App Engine you can use Search API, to do full-test indexing & querying.
You can use following options.
Google desktop and not sure about api.
IIS index server thenyou can do query it index files too.
Dtseach is tool with api but paid.
Apache api i forgot name but will post it shortly.

How to google programmatically?

I want to query google programmatically in Java, to get texts for relation extraction purposes.
For example, I want to write in Java:
result_list=googleAgent.search("Berlin Germany");
In result_list, I can get a list of sentences which contain "Berlin" and "Germany". Then I can do NLP analysis and extract the relation.
Can I do it at all? And how if so?
Google prohibits programmatic searches directly through their website (that's why they have a search API). If you insist on trying to do this, Google will eventually pop up a captcha that your client will have to solve. So now you'll be trying to do NLP while you're doing OCR ;)
However, their search API isn't that great. You're limited to a certain number of queries per day (100) and information per result.
You can use Google's Custom Search API

Google page index - java

does any one has idea how to get google page index in Java?
I was googleing since last 2-3 days but helpless, can any one refer me API for that or give some suggestion for how to do that
Lots of thanks in advance
For example if we search for facebook in google, we get around 22,980,000,000 results. So I want to fetch this number using JAVA
make a corresponding HTTP request from Java to Google, then parse the replied HTML code. There is a div with the ID resultStats. This div contains the number of results.
Not sure what your real requirement is, what kind of index do you want? Google export fairly a bit amount of APIs via RESTful service, some of them are packaged with JavaScript lib like Google MAP API. There are also Java client library for OAUTH authentication
The custom search API information could be found at http://code.google.com/apis/customsearch/v1/overview.html. A comprehensive list of google APIs could be accessed at https://code.google.com/apis/console

do Google Search provide an API for application?

I am trying to build PC application in java, and i want to search for something on the internet.
my question is can i use Google search engine and grap the results from it ? do google provide an API for this ?
for example:
assume i want to search for "Apple" on the internet
1- i want to connect to Google search service (in some way)
2- put "Apple" as input
3- collect the search results
i hope that the results i get is the same like the results if i searched
"Apple" manually in google website
Yes Google do provide you SEARCH API. You can use a RESTFUL Service to extract the search information.
Please note it comes with a restriction, only 100 free search results per day. You can also try out Bing Search API

google java api for google search

Does google provide a Java server side api **(NOT java script).**I dont want the ajax api which works at clint side.
What i want is that the result returned for a keyword should return me search result in some specific data structure.Like List or set data structure.Then i want to manipulate the result according to my need in java code.
I had used such a java server site api for youtube.
They used to but is discontinued. Most likely because you can remove their ads ;-)
From Google's terms of service
You may not send automated queries of any sort to Google's system
without express permission in advance from Google.
So, no - use their AJAX API. The SAOP API is discoutinued, but I think you should be able to use it, unless it requires a key, in which case you are tied to the AJAX API
Technically, the statement quoted above doesn't mean you can't use some sort of server-side API - there are examples of that if you google around. It means you shouldn't do it, because sooner or later you will be blacklisted (banned), as violating the terms.
What you would be looking for now is the CustomSearch API:
They used to have a different API developers could use but it has been depreciated (Nov. 2009 I think) so this is a for cost service now. I am not aware how long it might have been a free service. The new API allows 100 free searches a day, but you have to be signed up for billing else anything above 100 searches will fail, here are the details:
http://code.google.com/apis/customsearch/v1/overview.html
And sorry yes, this would still be using Java Script but you could use this:
http://www.json.org/java/
There is at least a SOAP API that I'm aware of: Google SOAP Search API
I don't think Google wants 3rd parties to use their search engine for their own services/applications. You would get "we think you are a robot" error page as a result if Google thinks you are not a real person.
You can however try Google Custom Search

Categories

Resources