This guide will walk you through installing the official Java SDK and running your first scan. In just a few minutes, you’ll be able to check content for plagiarism, AI-generated text, moderation and more directly from your Java application. Before you start, ensure you have the following:

Get Started

1

Installation

The SDK requires Java 11 or higher. Add the official copyleaks-java-sdk dependency to your project’s pom.xml file.
pom.xml
2

Quick Example: Scan Text

Remember to replace the placeholder credentials and webhook URL with your actual values.
ScanExample.java
3

Understanding the Code

The example code performs four main actions to submit a scan:
  1. Login: It authenticates with your email and API key to get a secure CopyleaksAuthToken object, which is required for all subsequent requests.
  2. Prepare Content: It takes a simple string of text and encodes it into Base64 format.
  3. Configure Scan: It creates a SubmissionProperties object containing SubmissionWebhooks to define the scan’s behavior. We enable sandbox mode for safe testing and provide the webhook URL.
  4. Submit for Scanning: It creates a CopyleaksFileSubmissionModel with the content and properties, then sends it to the Copyleaks API. The process is asynchronous; Copyleaks will notify your webhook URL once the scan is complete.

Next Steps

GitHub Repository

Check the official SDK repository on GitHub for more examples and details.

Maven Central

View the official package on the Maven Central Repository to see all available versions.

Check for Plagiarism

Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content.

Detect AI-Generated Content

Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async.

Assess Grammar and Writing Quality

Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs.

Moderate Text

Scan and moderate text content for unsafe or policy-relevant material across 10+ categories.