My study is to get as MANY of the urls that google returns claiming to have info of my search. I look at the source code of the search result page, the urls were hidden by Google. Can anyone help me? Just get me on the right direction. Using Java
You can invoke a REST interface to get the Google search results as XML or JSON using the Google Custom Search API (limited to 100 queries / day).
To make the actual request programmatically check out the HttpURLConnection class.
Related
I'm currently in the process of migrating from an obsolete youtube gdata API to V3. One of the things I'm looking for is :
Search videos using a filter
I used to run something like this
https://gdata.youtube.com/feeds/api/users/lyndapodcast/uploads?v=2&max-results=50&start-index=1&query=sample_keyword
Will this V3 request will be equivalent using "q" parameter ?
https://www.googleapis.com/youtube/v3/search?part=snippet&q=sample_keyword&channelId=UCUtTNe0bVxvk8exLBKkvCNg&maxResults=50&key={my_key}&maxResults=2
Is there a way to retrieve "keywords" as part of the result ? gdata API didn't allow it earlier, only way was to scrape the html page and look for keywords metadata.
Any pointers will be appreciated.
-Thanks,
Shamik
Yes, except for the different maxResults value you're using.
You can get tags only if you own the videos. Otherwise scrape the keywords metadata.
I'm using https://github.com/fent/node-ytdl-core to get keywords for youtube videos.
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.
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
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
I'm trying to write a simple Java desktop app to query Google and get the results. I've read so many articles in the past few days. I know that I have to do it through the GWT (Google Web Toolkit), the API that Google offers to programmatically query its search engine. My problem is that the GWT seems to be useful only to construct AJAX applications. I just want to write a simple desktop app. I am not interested in Javascript, XML or any server side application. Isn't there a way to do it?
Sure, take a look at this approach.
The general idea is that you make an HTTP fetch (using vanilla java.net.HttpUrlConnection or Apache HTTP Client). The magic is in the forming of the URL with the search term, and in the processing of what you get back from Google.
For the exact details on how to do this, see Google's REST search API documentation, including this section.
You can always get a license for the webservice and get the results returned through SOAP, however you did say that you were uninterested in XML. Shame, thats the quickest way. There is always doing a direct request to google through the query URL, since it uses HTTP get.