Skip to content

Commit 6a8e131

Browse files
author
vlad-outscraper
committed
first commit
1 parent 0275386 commit 6a8e131

File tree

10 files changed

+525
-2
lines changed

10 files changed

+525
-2
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,12 @@
2121

2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
24+
25+
*.class
26+
build/
27+
.gradle
28+
29+
*.jar
30+
*.aar
31+
*.war
32+
!gradle-wrapper.jar

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "automatic"
3+
}

README.md

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,66 @@
1-
# outscraper-java
2-
The library provides convenient access to the Outscraper API from applications written in the Java language. Allows using Outscraper's services from your code.
1+
# Outscraper Java Library
2+
3+
The library provides convenient access to the [Outscraper API](https://app.outscraper.com/api-docs) from applications written in the Java language. Allows using [Outscraper's services](https://outscraper.com/services/) from your code.
4+
5+
## Installation
6+
7+
Java 11 or later
8+
9+
### Gradle users
10+
11+
Add this dependency to your project's build file:
12+
``` sh
13+
implementation "com.outscraper:outscraper-java:0.0.1"
14+
```
15+
16+
### Others
17+
18+
You'll need to manually install the following JARs:
19+
20+
- [The Outscraper JAR](https://search.maven.org/remote_content?g=com.outscraper&a=outscraper-java&v=LATEST)
21+
- [Json](https://repo1.maven.org/maven2/org/json/json/20090211/json-20090211.jar)
22+
- [Httpcomponents](https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar)
23+
- [Guava](https://repo1.maven.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.jar)
24+
25+
## Initialization
26+
```java
27+
OutscraperClient client = new OutscraperClient("SECRET_API_KEY");
28+
```
29+
[Link to the profile page to create the API key](https://app.outscraper.com/profile)
30+
31+
## Usage
32+
33+
```java
34+
// Search for businesses in specific locations:
35+
JSONArray results = client.googleMapsSearchV2(new HashMap<String, Object>() {{
36+
put("query", "bars ny usa");
37+
put("limit", 10);
38+
}});
39+
System.out.println(results);
40+
41+
// Get data of the specific place by id
42+
JSONArray results = client.googleMapsSearchV2(new HashMap<String, Object>() {{
43+
put("query", "rChIJrc9T9fpYwokRdvjYRHT8nI4");
44+
put("language", "en");
45+
}});
46+
System.out.println(results);
47+
48+
// Get reviews of the specific place by id
49+
JSONArray results = client.googleMapsReviewsV3(new HashMap<String, Object>() {{
50+
put("query", "rChIJrc9T9fpYwokRdvjYRHT8nI4");
51+
put("reviewsLimit", 20);
52+
put("language", "en");
53+
}});
54+
System.out.println(results);
55+
56+
// Search contacts from website
57+
JSONArray results = client.emailsAndContacts(new HashMap<String, Object>() {{
58+
put("query", "outscraper.com");
59+
}});
60+
System.out.println(results);
61+
```
62+
63+
[More examples](https://github.com/outscraper/outscraper-java/tree/master/examples)
64+
65+
## Contributing
66+
Bug reports and pull requests are welcome on GitHub at https://github.com/outscraper/outscraper-java.

build.gradle

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apply plugin: 'java'
2+
apply plugin: 'maven-publish'
3+
4+
group = 'com.github.outscraper'
5+
version = '1.0.4'
6+
7+
repositories {
8+
mavenCentral()
9+
}
10+
11+
dependencies {
12+
implementation 'com.google.guava:guava:29.0-jre'
13+
14+
implementation 'com.google.guava:guava:30.1.1-jre'
15+
implementation group: 'org.apache.httpcomponents' , name: 'httpclient' , version: '4.5.13'
16+
implementation group: 'org.json', name: 'json', version: '20090211'
17+
}
18+
19+
java {
20+
withSourcesJar()
21+
withJavadocJar()
22+
}
23+
24+
publishing {
25+
publications {
26+
maven(MavenPublication) {
27+
from components.java
28+
}
29+
}
30+
}
31+
32+
wrapper {
33+
gradleVersion = "7.3.3"
34+
distributionType = Wrapper.DistributionType.ALL
35+
}

gradle/wrapper/gradle-wrapper.jar

57.3 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

gradlew

Lines changed: 183 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)