Java SDK
cheap.serp:serpcheap is de officiële Java-client — Java 11+ (Jackson voor JSON).
Installatie
Section titled “Installatie”<dependency> <groupId>cheap.serp</groupId> <artifactId>serpcheap</artifactId> <version>0.1.0</version></dependency>Snelstart
Section titled “Snelstart”import cheap.serp.serpcheap.*;
SerpCheap client = new SerpCheap("YOUR_API_KEY");SearchResponse res = client.search(SearchParams.of("best running shoes"));
for (OrganicResult r : res.organic) { System.out.println(r.position + ". " + r.title + " — " + r.link);}Parameters & opties
Section titled “Parameters & opties”SearchParams params = SearchParams.builder() .q("best running shoes") .gl("us") // country (default "us") .hl("en") // UI language (optional) .tbs("qdr:w") // time filter (optional) .page(1) // 1-indexed (default 1) .build();
SerpCheap client = new SerpCheap("YOUR_API_KEY", ClientOptions.builder() .baseUrl("https://api.serp.cheap") .timeout(java.time.Duration.ofSeconds(15)) .maxRetries(2) .build());Foutafhandeling
Section titled “Foutafhandeling”try { SearchResponse res = client.search(SearchParams.of("coffee"));} catch (SerpCheapException e) { System.err.println(e.getCode() + ": " + e.getMessage()); if (e.isRetryable()) { // transient — safe to try again later }}