Copyleaks SDK enables you to scan text for plagiarism and detect content distribution online, using the Copyleaks plagiarism checker cloud.
Using Copyleaks SDK you can check for plagiarism in:
- Online content and webpages
- Local and cloud files (see supported files)
- Free text
- OCR (Optical Character Recognition) - scanning pictures with textual content (see supported files)
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.
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.
local_tests.js will show you how to check for plagiarism in the URL: 'https://www.copyleaks.com'. All you have to do is to update the following two lines with your email and API key:
var email = 'YOUR-EMAIL'; var apikey = 'YOUR-API-KEY';
This example shows how to scan a URL using the following code:
clCloud.createByURL(url,_customHeaders,function(resp,err){//check if we have credits if(resp && resp.ProcessId){ console.log('API: create-by-url'); console.log('Process has been created: '+resp.ProcessId); } }); </pre>
You can change 'createByURL' with 'createByFile' to scan local files:
clCloud.createByFile(_file,_customHeaders,function(resp,err){ //check if we have credits if(resp && resp.ProcessId){ console.log('API: create-by-file'); console.log('Process has been created: '+resp.ProcessId); } });or with 'createByOCR to scan local images containing text:
clCloud.createByFileOCR(_ocrFile,_customHeaders,language,function(resp,err){//check if we have credits if(resp && resp.ProcessId){ console.log('API: create-by-file-ocr'); console.log('Process has been created: '+resp.ProcessId); } });</pre>