# Detect Plagiarism in Images

> Learn how to use the Copyleaks Image Plagiarism Detection API to find unauthorized copies of your images across the web.

The Copyleaks Image Plagiarism Detection API detects unauthorized copies of your images across the web. Submit an image and receive a categorized list of matches - all in a single synchronous API call.

This guide walks you through submitting an image and interpreting the results.

## Get started

<Steps>
1.  ### Before you begin
    Before you start, ensure you have the following:
    - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**.
    - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**.

2.  ### Installation
    <GuideInstallation />

3.  ### Login
    <GuideLogin />

4.  ### Submit image for plagiarism check

    Use the [Image Plagiarism Detection Endpoint](/reference/actions/image-plagiarism-detector/check) to submit an image using `multipart/form-data`.

    <Tip>
    For testing, set `sandbox: true`. Sandbox mode is free and returns mock results without consuming credits.
    </Tip>

    #### Image Requirements
    - **File size:** Less than 20MB
    - **Max resolution:** 75 megapixels (width × height ≤ 75,000,000)
    - **Formats:** JPG, JPEG, PNG, GIF, BMP, WebP, RAW, ICO

    <Tabs>
      <Tab title="HTTP">
      ```http
      POST https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check

      Headers
      Authorization: Bearer <YOUR_AUTH_TOKEN>
      Content-Type: multipart/form-data; boundary=----WebKitFormBoundary

      Body
      ------WebKitFormBoundary
      Content-Disposition: form-data; name="image"; filename="my-photo.jpg"
      Content-Type: image/jpeg

      [binary image data]
      ------WebKitFormBoundary
      Content-Disposition: form-data; name="filename"

      my-photo.jpg
      ------WebKitFormBoundary
      Content-Disposition: form-data; name="sandbox"

      false
      ------WebKitFormBoundary--
      ```
      </Tab>
      <Tab title="cURL">
      ```bash
      curl -X POST "https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check" \
           -H "Authorization: Bearer <YOUR_AUTH_TOKEN>" \
           -F "image=@/path/to/my-photo.jpg" \
           -F "filename=my-photo.jpg" \
           -F "sandbox=false"
      ```
      </Tab>
      <Tab title="Python">
      ```python
      import requests

      url = 'https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check'
      headers = {'Authorization': 'Bearer YOUR_LOGIN_TOKEN'}

      with open('my-photo.jpg', 'rb') as image_file:
          files = {'image': ('my-photo.jpg', image_file, 'image/jpeg')}
          data = {'filename': 'my-photo.jpg', 'sandbox': 'false'}
          response = requests.post(url, files=files, data=data, headers=headers)

      result = response.json()
      print(f"Total matches: {result['matches']['score']['totalMatches']}")
      print(f"Full matches: {result['matches']['score']['fullMatches']}")
      print(f"Partial matches: {result['matches']['score']['partialMatches']}")
      print(f"All matches: {result['matches']['internet']}")
      ```
      </Tab>
      <Tab title="JavaScript">
      ```javascript
      const imageFile = document.getElementById('fileInput').files[0];
      const formData = new FormData();

      formData.append('image', imageFile);
      formData.append('filename', imageFile.name);
      formData.append('sandbox', 'false');

      const response = await fetch(
        'https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check',
        {
          method: 'POST',
          headers: { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN' },
          body: formData
        }
      );

      const result = await response.json();
      console.log('Total matches:', result.matches.score.totalMatches);
      console.log('Full matches:', result.matches.score.fullMatches);
      console.log('Partial matches:', result.matches.score.partialMatches);
      console.log('All matches:', result.matches.internet);
      ```
      </Tab>
      <Tab title="Java">
      ```java
      import java.io.*;
      import java.net.*;
      import java.net.http.*;
      import java.nio.file.*;
      import java.util.*;

      String authToken = "YOUR_LOGIN_TOKEN";
      String imagePath = "path/to/my-photo.jpg";
      String scanId = "my-scan-1";
      String boundary = "----WebKitFormBoundary" + System.currentTimeMillis();

      byte[] imageBytes = Files.readAllBytes(Paths.get(imagePath));
      String filename = "my-photo.jpg";

      List<byte[]> parts = new ArrayList<>();
      String imagePart = "--" + boundary + "\r\n" +
          "Content-Disposition: form-data; name=\"image\"; filename=\"" + filename + "\"\r\n" +
          "Content-Type: image/jpeg\r\n\r\n";
      parts.add(imagePart.getBytes());
      parts.add(imageBytes);
      parts.add("\r\n".getBytes());
      String rest = "--" + boundary + "\r\n" +
          "Content-Disposition: form-data; name=\"filename\"\r\n\r\n" + filename + "\r\n" +
          "--" + boundary + "\r\n" +
          "Content-Disposition: form-data; name=\"sandbox\"\r\n\r\nfalse\r\n" +
          "--" + boundary + "--\r\n";
      parts.add(rest.getBytes());

      int total = parts.stream().mapToInt(a -> a.length).sum();
      byte[] body = new byte[total];
      int offset = 0;
      for (byte[] part : parts) {
          System.arraycopy(part, 0, body, offset, part.length);
          offset += part.length;
      }

      HttpRequest request = HttpRequest.newBuilder()
          .uri(URI.create("https://api.copyleaks.com/v1/image-plagiarism-detector/" + scanId + "/check"))
          .header("Authorization", "Bearer " + authToken)
          .header("Content-Type", "multipart/form-data; boundary=" + boundary)
          .POST(HttpRequest.BodyPublishers.ofByteArray(body))
          .build();

      HttpResponse<String> response = HttpClient.newHttpClient()
          .send(request, HttpResponse.BodyHandlers.ofString());
      System.out.println("Response: " + response.body());
      ```
      </Tab>
    </Tabs>

5.  ### Interpreting the response

    A successful response contains scan metadata and a `matches` object with:

    - **`matches.internet`** - All matching images found on the web. Each entry has a `url`, a `matchType`, and an optional `webPages` list:
      - `0` - **Full match**: Exact or near-exact copy of the submitted image.
      - `1` - **Partial match**: Cropped, resized, recolored, or otherwise modified version.
      - **`webPages`** - The web pages where the image was found (each with a `url`). Omitted when the image was not located on any page. The same image URL never appears more than once.
    - **`matches.score`** - A summary with `totalMatches`, `fullMatches`, and `partialMatches` counts.
    - **`scannedImage`** - Metadata about the submitted image: scan ID, credits charged, dimensions, filename, and creation time.

    ```json
    {
      "developerPayload": null,
      "scannedImage": {
        "scanId": "my-scan-1",
        "expectedCredits": 1,
        "actualCredits": 1,
        "creationTime": "2026-05-24T10:00:00Z",
        "width": 1920,
        "height": 1080,
        "filename": "my-photo.jpg"
      },
      "matches": {
        "internet": [
          {
            "url": "https://example.com/images/photo.jpg",
            "matchType": 0,
            "webPages": [
              { "url": "https://example.com/blog/my-post" },
              { "url": "https://example.org/news/article" }
            ]
          },
          {
            "url": "https://example.com/thumbs/photo-thumb.jpg",
            "matchType": 1,
            "webPages": [
              { "url": "https://example.org/gallery" }
            ]
          },
          {
            "url": "https://example.org/gallery/photo-sm.jpg",
            "matchType": 1
          }
        ],
        "score": {
          "totalMatches": 3,
          "fullMatches": 1,
          "partialMatches": 2
        }
      }
    }
    ```

    An empty `matches.internet` array with all-zero scores means no matching content was found on the web.

6.  ### Summary

    You have successfully checked your image for plagiarism. You can now use the match URLs in your application to alert users, file takedown requests, or record provenance data.
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="API Reference" href="/reference/actions/image-plagiarism-detector/check">Full API reference for the Image Plagiarism Detection endpoint.</Card>
  <Card title="Image Plagiarism Response" href="/reference/data-types/authenticity/results/image-plagiarism-response">Detailed breakdown of every field in the Image Plagiarism Detection response.</Card>
</CardGroup>
