Git Product home page Git Product logo

google-web-search's Introduction

A Java wrapper for retrieving Google search results in Java. By default "https://www.google.com/search?" interface is used, so no API keys are needed.

Usage:

	SearchQuery query = new SearchQuery.Builder("bunnies")
    				    .site("stackoverflow.com")
        				.numResults(10).build();
    SearchResult result = new GoogleWebSearch().search(query);
    System.out.println(result.getUrls());

Default search parameters can be overriden by using an alternative constructor:

	import com.afedulov.search.GoogleWebSearch.SearchConfig;
	...
	SearchQuery query = new SearchQuery.Builder("bunnies aus Deutschland")
    				    .site("stackoverflow.com")
        				.numResults(10).build();
    SearchConfig config = new SearchConfig();
    config.setGOOGLE_SEARCH_URL_PREFIX("https://www.google.de/search?");
    SearchResult result = new GoogleWebSearch(config).search(query);
    System.out.println(result.getUrls());

Warning from Google Terms of Service: "Don’t misuse our Services. For example, don’t interfere with our Services or try to access them using a method other than the interface and the instructions that we provide.". Is "https://www.google.com/search?" an interface that Google provides? I'll leave it up to you to interpret and decide. Use only if you think it is appropriate and at your own risk.

This library is not intended for quering in highly concurrent and/or frequent manner. Doing so will most probably lead to blocking by Google with the "Unusual traffic from your computer network" message.

google-web-search's People

Contributors

afedulov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.