Nunjucks Powers Mozilla
Introducing npm Teams! Private packages + team management tools.Learn more »


1.2.1 • Public • Published

Copyleaks NodeJs SDK

Copyleaks SDK enables you to scan text for plagiarism and detect content distribution online, using the Copyleaks plagiarism checker API.

Using Copyleaks SDK you can check for plagiarism in:


Integrate with the Copyleaks SDK in one of two options:

  • Recommended: Use the Package Manager - NPM.
    When integrating that way you will automatically be able to update the SDK to its latest version:
    npm i plagiarism-checker
    Following that, in order to use the SDK, add this to your code:
    var CopyleaksCloud = require('plagiarism-checker');
    var clCloud = new CopyleaksCloud();
    var config = clCloud.getConfig();
  • Download the code from this repository and add it to your project.

In any case, make sure you have the following dependencies installed:

$ npm install lodash
$ npm install request
$ npm install request-promise
$ npm install mime-types

Register and Get Your API Key

To use the Copyleaks API you need to first be a registered user. The registration to Copyleaks takes a minute and is free of charge. Signup and make sure to confirm your account.

As a signed user you can generate your personal API key. Do so on your dashboard (Businesses dashboard/Academic dashboard/Websites dashboard) under 'Access Keys'.

For more information check out our API guide.


See example_async.js for an example using callbacks.


Set your credentials:

var email = 'YOUR-EMAIL';
var apikey = 'YOUR-API-KEY';

Set custom headers for the process:

var _customHeaders = {};
_customHeaders[config.SANDBOX_MODE_HEADER] = true; // Sandbox mode - Scan without consuming any credits and get back dummy results
_customHeaders[config.HTTP_CALLBACK] = '' // Callback url - For a fast testing of callbacks option we recommend to use

Create a process using createByUrl method:

	if(resp && resp.ProcessId){
		console.log('API: create-by-url');
		console.log('Process has been created: '+resp.ProcessId);

Available create methods are: createByURL, createByFile, createByFiles, createByOCR and createByText.


You can set aditional headers and add them to your process:

var _customHeaders = {};
_customHeaders[config.SANDBOX_MODE_HEADER] = true;
_customHeaders[config.HTTP_CALLBACK] = ''
_customHeaders[config.IN_PROGRESS_RESULT] = ''
_customHeaders[config.EMAIL_CALLBACK] = ''
_customHeaders[config.PARTIAL_SCAN_HEADER] = true;
_customHeaders[config.COMPARE_ONLY] = true; // Compare files in between - available only on createByFiles
_customHeaders[config.IMPORT_FILE_TO_DATABASE] = true; // Import your file to our database only

For more info about the optional headers see API Request Headers

For more info about the optional headers visit

Read More




npm i plagiarism-checker

DownloadsWeekly Downloads






Unpacked Size

24.9 kB

Total Files


Last publish


  • avatar