Skip to content
Authenticity

Detect Plagiarism in Text

The Copyleaks API is the most powerful way to analyze your content for plagiarism. This API is asynchronous - you submit a scan, and Copyleaks notifies your server via webhooks when the results are ready to be retrieved.

This guide will walk you through the process of submitting a scan, enabling plagiarism detection, and exporting the results.

  1. Before you start, ensure you have the following:

  2. Choose your preferred method for making API calls.

    You can interact with the API using any standard HTTP client.

    For a quicker setup, we provide a Postman collection. See our Postman guide for instructions.

  3. To perform a scan, we first need to generate an access token. For that, we will use the login endpoint. The API key can be found on the Copyleaks API Dashboard.

    Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the Authorization: Bearer <TOKEN> header. This token remains valid for 48 hours.

    POST https://id.copyleaks.com/v3/account/login/api
    Headers
    Content-Type: application/json
    Body
    {
    "email": "[email protected]",
    "key": "00000000-0000-0000-0000-000000000000"
    }

    Response

    {
    "access_token": "<ACCESS_TOKEN>",
    ".issued": "2025-07-31T10:19:40.0690015Z",
    ".expires": "2025-08-02T10:19:40.0690016Z"
    }
  4. Use the Submit File Endpoint to send content for analysis. You need to provide a unique scanId for each submission.

    PUT https://api.copyleaks.com/v3/scans/submit/file/my-plagiarism-scan
    Headers
    Authorization: Bearer <YOUR_AUTH_TOKEN>
    Content-Type: application/json
    Body
    {
    "base64": "SGVsbG8gd29ybGQh",
    "filename": "file.txt",
    "properties": {
    "webhooks": {
    "status": "https://your-server.com/webhook/{STATUS}"
    },
    "sandbox": true
    }
    }
  5. The scan can take some time. Once it’s complete, Copyleaks will send a completed webhook to the status URL you provided. This webhook contains a summary of the scan results, including any result IDs for found plagiarism matches.

  6. After the completed webhook arrives, use the export endpoint to retrieve the detailed plagiarism results using the result IDs you received in the completion webhook.

    We will also export the Crawled Version. The crawledVersion webhook contains the text and html version of the document. This can later be used in order to display the report.

    In addition, you should also specify a completionWebhook to receive notifications when the export is ready.

    POST https://api.copyleaks.com/v3/downloads/my-plagiarism-scan/export/<export_id>
    Headers
    Authorization: Bearer <your_token>
    Content-Type: application/json
    Body
    {
    "completionWebhook": {
    "url": "https://your.server/webhook/export/completed",
    "headers": {
    "key": "value",
    "key2": "value2"
    },
    "maxRetries": 3
    },
    "developerPayload": "custom_data_identifier",
    "crawledVersion": {
    "endpoint": "https://your.server/webhook/export/crawled",
    "verb": "POST",
    "headers": {
    "key": "value",
    "key2": "value2"
    }
    },
    "results": [
    {
    "id": "result-1",
    "endpoint": "https://your.server/webhook/export/result/result-1",
    "verb": "POST",
    "headers": {
    "key": "value",
    "key2": "value2"
    }
    }
    ]
    }
  7. You have successfully submitted a scan for plagiarism detection and exported the results. You can now handle the results in your application, display them to users, or take further actions based on the findings.