Features
Excluding and Preventing Indexing of Content
You have granular control over what content is scanned and what data is stored when you submit a document to Copyleaks. This guide covers two distinct types of exclusion:
- Excluding Parts of a Document from Scan Analysis: This allows you to refine the plagiarism scan by ignoring specific elements like quotes or code blocks.
- Preventing a Document from Being Indexed: This allows you to control whether the entire document is added to the Copyleaks Internal Database for future comparisons.
Exclude Options
Section titled “Exclude Options”The exclude
object can contain the following boolean properties:
quotes
: If set totrue
, all text within quotation marks will be ignored.citations
: If set totrue
, citations and references will be ignored.references
: If set totrue
, the bibliography or reference list will be ignored.tableOfContents
: If set totrue
, the table of contents will be ignored.titles
: If set totrue
, titles and headings will be ignored.code
: If set totrue
, code blocks will be ignored.
Request Example
Section titled “Request Example”PUT https://api.copyleaks.com/v3/scans/submit/file/my-scan-exclude-exampleContent-Type: application/jsonAuthorization: Bearer YOUR_LOGIN_TOKEN
{ "base64": "VGhpcyBpcyBhIHRlc3QgZmlsZS4gIkhlbGxvLCB3b3JsZCEiIGlzIGEgcXVvdGUuIChTbWl0aCwgMjAyMyk=", "filename": "document-with-exclusions.txt", "properties": { "webhooks": { "status": "https://my-server.com/webhook/{STATUS}" }, "exclude": { "quotes": true, "citations": true }, "sandbox": true }}
curl --request PUT \ --url https://api.copyleaks.com/v3/scans/submit/file/my-scan-exclude-example \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "base64": "VGhpcyBpcyBhIHRlc3QgZmlsZS4gIkhlbGxvLCB3b3JsZCEiIGlzIGEgcXVvdGUuIChTbWl0aCwgMjAyMyk=", "filename": "document-with-exclusions.txt", "properties": { "webhooks": { "status": "https://my-server.com/webhook/{STATUS}" }, "exclude": { "quotes": true, "citations": true }, "sandbox": true } }'
import requestsimport base64
# Sample document content with quotes and citationsdocument_content = 'This is a test file. "Hello, world!" is a quote. (Smith, 2023)'base64_content = base64.b64encode(document_content.encode()).decode('utf-8')
url = "https://api.copyleaks.com/v3/scans/submit/file/my-scan-exclude-example"payload = { "base64": base64_content, "filename": "document-with-exclusions.txt", "properties": { "webhooks": { "status": "https://my-server.com/webhook/{STATUS}" }, "exclude": { "quotes": True, "citations": True, "references": True, "tableOfContents": False, "titles": False, "code": False }, "sandbox": True }}headers = { "Authorization": "Bearer YOUR_LOGIN_TOKEN", "Content-Type": "application/json", "Accept": "application/json"}
response = requests.put(url, json=payload, headers=headers)result = response.json()
print("Scan submitted with exclusions!")if 'scannedDocument' in result: print(f"Total words: {result['scannedDocument'].get('totalWords', 'N/A')}") print(f"Excluded words: {result['scannedDocument'].get('totalExcluded', 'N/A')}")
print("Full response:", result)
const { Copyleaks } = require('plagiarism-checker');
const API_KEY = "your-api-key-here";
async function submitFileWithExclusions() { const copyleaks = new Copyleaks();
// Login first const authToken = await copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY); console.log('Logged successfully!\nToken:', authToken);
// Sample document content with quotes and citations const documentContent = 'This is a test file. "Hello, world!" is a quote. (Smith, 2023)'; const base64Content = Buffer.from(documentContent).toString('base64');
// Submit file with exclusions const scanId = "my-scan-exclude-example"; const fileSubmission = { base64: base64Content, filename: "document-with-exclusions.txt", properties: { webhooks: { status: "https://my-server.com/webhook/{STATUS}" }, exclude: { quotes: true, citations: true, references: true, tableOfContents: false, titles: false, code: false }, sandbox: true } };
try { const result = await copyleaks.submitFileAsync(authToken, scanId, fileSubmission);
console.log('File submitted with exclusions successfully!'); if (result.scannedDocument) { console.log('Total words:', result.scannedDocument.totalWords || 'N/A'); console.log('Excluded words:', result.scannedDocument.totalExcluded || 'N/A'); } console.log('Full result:', result);
return result; } catch (error) { console.error('Failed to submit file with exclusions:', error); }}
submitFileWithExclusions();
import classes.Copyleaks;import models.submissions.CopyleaksFileSubmissionModel;import models.submissions.properties.*;import java.util.Base64;import java.nio.charset.StandardCharsets;
public class FileExclusionExample { private static final String API_KEY = "00000000-0000-0000-0000-000000000000";
public static void main(String[] args) { try { // Login to Copyleaks String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged successfully!\nToken: " + authToken);
// Sample document content with quotes and citations String documentContent = "This is a test file. \"Hello, world!\" is a quote. (Smith, 2023)"; String base64Content = Base64.getEncoder().encodeToString( documentContent.getBytes(StandardCharsets.UTF_8) );
// Configure webhooks SubmissionWebhooks webhooks = new SubmissionWebhooks("https://my-server.com/webhook/{STATUS}");
// Create submission properties with exclusions SubmissionProperties properties = new SubmissionProperties(webhooks); properties.setSandbox(true);
// Configure exclusions SubmissionExclude exclude = new SubmissionExclude(); exclude.setQuotes(true); exclude.setCitations(true); exclude.setReferences(true); exclude.setTableOfContents(false); exclude.setTitles(false); exclude.setCode(false); properties.setExclude(exclude);
// Create file submission with exclusions String scanId = "my-scan-exclude-example"; CopyleaksFileSubmissionModel fileSubmission = new CopyleaksFileSubmissionModel( base64Content, "document-with-exclusions.txt", properties );
// Submit file for scanning var result = Copyleaks.submitFile(authToken, scanId, fileSubmission);
System.out.println("File submitted with exclusions successfully!"); System.out.println("Scan ID: " + scanId); System.out.println("Document will exclude quotes and citations from analysis.");
} catch (Exception e) { System.out.println("Failed: " + e.getMessage()); e.printStackTrace(); } }}
Response Example
Section titled “Response Example”When the scan is processed, the scannedDocument
object in the response will reflect the number of words that were excluded.
201 Created
The scan was successfully created and is now processing. The excluded word count is reflected in the response.
Example Response
A typical response from this endpoint:
{ "scannedDocument": { "scanId": "my-scan-exclude-example", "totalWords": 8, "totalExcluded": 4, "credits": 0, "expectedCredits": 1, "creationTime": "2025-08-10T10:00:00.000000Z", "metadata": { "filename": "document-with-exclusions.txt" }, "enabled": { "plagiarismDetection": true, "aiDetection": false, "explainableAi": false,// ... truncated
🗺️ Next Steps
Section titled “🗺️ Next Steps” Webhooks Overview Learn how to securely receive and process notifications from Copyleaks.
Viewing Scan Results Understand the scan result format and how to display it to your users.