GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — redfin-scraper/examples/java/PropertyExample.java at main · piloterr/redfin-scraper

Expand file tree

/

PropertyExample.java

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
35 lines (30 loc) · 1.31 KB
/

PropertyExample.java

Copy path

File metadata and controls

35 lines (30 loc) · 1.31 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Redfin Property API – Java example (Java 11+)
// Usage: PILOTERR_API_KEY=your-key java PropertyExample.java
import java.net.URI;
import java.net.URLEncoder;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
public class PropertyExample {
static String enc(String v) {
return URLEncoder.encode(v, StandardCharsets.UTF_8);
}
public static void main(String[] args) throws Exception {
String query = "query=" + enc("https://www.redfin.com/WA/Seattle/1120-8th-Ave-98101/unit-1603/home/14602?region_id=16163&region_type=6");
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.piloterr.com/v2/redfin/property?" + query))
.header("x-api-key", System.getenv("PILOTERR_API_KEY"))
.timeout(Duration.ofSeconds(120))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() != 200) {
System.err.println("Piloterr error " + response.statusCode() + ": " + response.body());
System.exit(1);
}
System.out.println(response.body());
}
}
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.