From 77482c3424b09b6fcbaf8afeba23c27dde5fc0d3 Mon Sep 17 00:00:00 2001 From: Stepbus Date: Fri, 28 Nov 2025 13:41:58 +0200 Subject: [PATCH] added contacts and leads, examples --- examples/Contacts And Leads.md | 65 +++++++++++++++++++++++++++++ src/main/java/OutscraperClient.java | 8 ++++ 2 files changed, 73 insertions(+) create mode 100644 examples/Contacts And Leads.md diff --git a/examples/Contacts And Leads.md b/examples/Contacts And Leads.md new file mode 100644 index 0000000..3b45283 --- /dev/null +++ b/examples/Contacts And Leads.md @@ -0,0 +1,65 @@ +# Contacts And Leads Scraper With Java + +Allows finding email addresses, social links, phones, and other contacts from domains and URLs via the [Contacts & Leads API](https://app.outscraper.com/api-docs#tag/Email-Related/paths/~1contacts-and-leads/get). + +## Installation + +Java 11 or later + +### Gradle + +Edit your build.gradle file +``` sh +repositories { + maven { url "https://jitpack.io" } +} + +dependencies { + implementation 'com.github.outscraper:outscraper-java:v2.1.0' +} +``` + +### Maven + +Add the JitPack repository to your build file +``` sh + + + jitpack.io + https://jitpack.io + + +``` + +Add the dependency +``` sh + + com.github.outscraper + outscraper-java + v2.1.0 + +``` + +### Others + +You'll need to manually install the following JARs: +- [The Outscraper JAR](https://jitpack.io/com/github/outscraper/outscraper-java/v2.1.0/outscraper-java-v2.1.0.jar) +- [Json](https://repo1.maven.org/maven2/org/json/json/20090211/json-20090211.jar) +- [Httpcomponents](https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar) +- [Guava](https://repo1.maven.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.jar) + +## Initialization +```java +OutscraperClient client = new OutscraperClient("SECRET_API_KEY"); +``` +[Link to the profile page to create the API key](https://app.outscraper.com/profile) + +## Usage + +```java +# Search contacts and leads from a website: +JSONArray results = client.contactsAndLeads(new HashMap() {{ + put("query", "outscraper.com"); +}}); +System.out.println(results); +``` diff --git a/src/main/java/OutscraperClient.java b/src/main/java/OutscraperClient.java index 9ee7f95..03adae1 100644 --- a/src/main/java/OutscraperClient.java +++ b/src/main/java/OutscraperClient.java @@ -137,6 +137,14 @@ public JSONArray googlePlayReviews(HashMap parameters) { return getData(response); } + public JSONArray contactsAndLeads(HashMap parameters) { + parameters.put("async", false); + + JSONObject response = getAPIRequest("/contacts-and-leads", parameters); + + return getData(response); + } + public JSONArray emailsAndContacts(HashMap parameters) { parameters.put("async", false);