> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fingerprint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Java Server SDK

> The [Fingerprint Server Java SDK](https://github.com/fingerprintjs/fingerprint-pro-server-api-java-sdk) is an easy way to interact with our Server API from your Java application. You can retrieve visitor history or individual identification events. View our [Java Server SDK quickstart](/docs/v3/java-server-quickstart) for a step-by-step guide to get started.

export const DeprecatedVersion = ({currentPath}) => <Warning>
    This version is deprecated. See the{" "}
    <a href="/reference/api-deprecation-policy">deprecation policy</a> and use
    the <a href={currentPath}>current version</a> instead.
  </Warning>;

<DeprecatedVersion currentPath="/reference/java-server-sdk" />

### How to install

#### Using Maven

Add this dependency to your project's POM:

```xml XML theme={"theme":"github-dark-dimmed"}
<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>
```

```xml XML theme={"theme":"github-dark-dimmed"}
<dependency>
  <groupId>com.github.fingerprintjs</groupId>
  <artifactId>fingerprint-pro-server-api-java-sdk</artifactId>
  <version>v7.8.0</version>
</dependency>
```

#### Using Gradle

Add this dependency to your project's build file:

```groovy Groovy theme={"theme":"github-dark-dimmed"}
repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation "com.github.fingerprintjs:fingerprint-pro-server-api-java-sdk:v7.0.0"
}
```

#### Others

Generate the JAR file:

```bash Bash theme={"theme":"github-dark-dimmed"}
./gradlew jar
```

Then manually install `target/fingerprint-pro-server-api-sdk-7.0.0.jar`.

### Usage

Initialize the client instance and use it to make API requests. You need to specify your secret API key and region (if it is not US/Global).

```java Java theme={"theme":"github-dark-dimmed"}
import com.fingerprint.api.FingerprintApi;
import com.fingerprint.model.EventsGetResponse;
import com.fingerprint.model.VisitorsGetResponse;
import com.fingerprint.sdk.ApiClient;
import com.fingerprint.sdk.ApiException;
import com.fingerprint.sdk.Configuration;
import com.fingerprint.sdk.Region;

public class FingerprintApiExample {
  public static void main(String... args) {
    ApiClient client = Configuration.getDefaultApiClient(
      "SECRET_API_KEY",
      Region.EUROPE
    );
    FingerprintApi api = new FingerprintApi(client);

    // Get visit history of a specific visitor
    try {
      VisitorsGetResponse response = api.getVisits("VISITOR_ID");
      System.out.println(response.getVisits().toString());
    } catch (ApiException e) {
      System.err.println(e.getMessage());
    }

    // Get a specific identification event
    try {
      EventsGetResponse response = api.getEvent("REQUEST_ID");
      System.out.println(response.getProducts().toString());
    } catch (ApiException e) {
      System.err.println(e.getMessage());
    }
  }
}
```

### Documentation

You can find the full documentation in the official [GitHub repository](https://github.com/fingerprintjs/fingerprint-pro-server-api-java-sdk/).
