Skip to content

Latest commit

 

History

History
67 lines (53 loc) · 1.67 KB

Google SERP.md

File metadata and controls

67 lines (53 loc) · 1.67 KB

Google Search Results Scraper With Java

The library returns search results from Google based on a given search query via Outscraper API.

Installation

Java 11 or later

Gradle

Edit your build.gradle file

repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
    implementation 'com.github.outscraper:outscraper-java:v2.0.0'
}

Maven

Add the JitPack repository to your build file

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add the dependency

	<dependency>
	    <groupId>com.github.outscraper</groupId>
	    <artifactId>outscraper-java</artifactId>
	    <version>v2.0.0</version>
	</dependency>

Others

You'll need to manually install the following JARs:

Initialization

OutscraperClient client = new OutscraperClient("SECRET_API_KEY");

Link to the profile page to create the API key

Usage

// Search for SERP results:
JSONArray results = client.googleSearch(new HashMap<String, Object>() {{
   put("query", "buy iphone 13 TX");
   put("language", "en");
   put("region", "us");
}});
System.out.println(results);