Java SDK for the JustSerpAPI HTTP interface. The SDK is generated from the upstream OpenAPI document and republished through GitHub and Maven Central.
- Checked-in raw and normalized OpenAPI specs under
openapi/ - Checked-in generated Java sources under
src/main/generated/ - A stable entry point,
JustSerpApiClient, undersrc/main/java/ - GitHub Actions for CI, scheduled spec sync PRs, and tag-based releases
- Java 11+
- Python 3.9+
- Maven 3.9+
<dependency>
<groupId>com.justserpapi</groupId>
<artifactId>justserpapi-java</artifactId>
<version>0.1.0</version>
</dependency>Replace the version with the latest published release.
import com.justserpapi.JustSerpApiClient;
import com.justserpapi.model.JustSerpApiResponse;
import java.time.Duration;
public class Example {
public static void main(String[] args) throws Exception {
JustSerpApiClient client = JustSerpApiClient.builder()
.apiKey(System.getenv("JUSTSERPAPI_API_KEY"))
.timeout(Duration.ofSeconds(30))
.build();
JustSerpApiResponse response = client.google().autocomplete("coffee", null, null);
System.out.println(response.getCode());
System.out.println(response.getData());
}
}JustSerpApiClient configures base URL, timeout, user agent, and API key injection. Operation methods are generated from the normalized OpenAPI document and exposed through client.google().
Fetch the live OpenAPI document, normalize it, regenerate the SDK, and sync checked-in generated sources:
python3 scripts/sync_sdk.pyRebuild from the checked-in normalized spec without hitting the network:
python3 scripts/sync_sdk.py --skip-fetchVerify that the generated sources are already up to date:
python3 scripts/sync_sdk.py --skip-fetch --checkRun the local build:
mvn verify- Daily scheduled workflow fetches the upstream OpenAPI document and opens a PR when the normalized spec or generated sources change.
- Pushing a Git tag that matches
v*runs the publish workflow. - Maven Central publishing and signing setup is documented in docs/publishing.md.