codequiry
v2.1.0
Published
Official Node.js SDK for Codequiry, the code plagiarism checker: source code plagiarism detection, peer code similarity, and AI-generated code detection API
Maintainers
Readme
Codequiry Node.js SDK — Code Plagiarism Checker API
Official Node.js SDK for Codequiry, the code plagiarism checker. Run source code plagiarism detection, peer-to-peer code similarity analysis, and AI-generated code detection from Node.js, with TypeScript definitions included.
Codequiry checks submissions against billions of web sources, public repositories, and each other, across 65+ programming languages. It is used by universities, coding bootcamps, hiring teams, and competition organizers to verify code originality.
- Web plagiarism check: match code against online sources and repositories
- Peer similarity check: compare submissions against each other (group similarity)
- AI code detection: flag AI-generated code (ChatGPT, Copilot, and other LLMs)
- Base code detection: exclude shared starter/boilerplate code from scoring
More integrations: Codequiry CLI · Codequiry MCP server for AI agents · REST API docs
Installation
npm install codequiryRequires Node.js 14+. Get an API key from your Codequiry dashboard.
Quick start
The fastest way to check code for plagiarism is checkFiles, which creates a check, uploads your ZIPs, starts the analysis, waits for completion, and returns the results:
const Codequiry = require('codequiry');
const cq = new Codequiry(process.env.CODEQUIRY_API_KEY);
const { overview, aiResults } = await cq.checkFiles('Assignment 1', ['./submissions.zip'], {
language: 999, // Auto Detect (or an id from getLanguages())
webcheck: true, // check against web sources
dbcheck: true, // check against Codequiry's database
aiRun: true, // also run AI-generated code detection
onProgress: (s) => console.log('status:', s.status),
});
console.log(overview);
console.log(aiResults);TypeScript works out of the box:
import Codequiry = require('codequiry');
const cq = new Codequiry(process.env.CODEQUIRY_API_KEY!);Step-by-step workflow
If you want control over each stage:
// 1. Create a check (999 = Auto Detect language)
const created = await cq.createCheck('Assignment 1', 999, { aiRun: true });
const checkId = created.check.id;
// 2. Upload one or more ZIP archives (max 10 MB each)
await cq.uploadFile(checkId, './submissions.zip');
// 3. Start the analysis
await cq.startCheck(checkId, { webcheck: true, dbcheck: true });
// 4. Wait for completion
await cq.pollUntilComplete(checkId, { onProgress: (s) => console.log(s.status) });
// 5. Read results
const overview = await cq.getOverview(checkId); // per-submission scores
const details = await cq.getResults(checkId, overview.submissions[0].id);
const ai = await cq.getAIResults(checkId); // AI detection results
const csv = await cq.getOverviewCSV(checkId); // overview as CSVAPI reference
Account
| Method | Description |
|--------|-------------|
| cq.validateKey() | Validate the API key |
| cq.account() | Account info and usage quota |
| cq.serviceStatus() | Codequiry service status |
Checks
| Method | Description |
|--------|-------------|
| cq.checks() | List all checks |
| cq.createCheck(name, language?, options?) | Create a check. Options: { testType, aiRun, baseCodeDetection, callbackUrl } |
| cq.getCheck(checkId) | Check info and status |
| cq.updateCheck(checkId, { name?, language? }) | Rename or change language |
| cq.deleteCheck(checkId) | Delete a check |
| cq.deleteSubmission(checkId, submissionId) | Delete one submission |
Upload & start
| Method | Description |
|--------|-------------|
| cq.uploadFile(checkId, filePath) | Upload a ZIP (max 10 MB) |
| cq.uploadBatch(checkId, filePaths) | Upload multiple ZIPs |
| cq.quickCheck(name, filePaths, options?) | Create + upload + start in one call |
| cq.startCheck(checkId, options?) | Start. Options: { webcheck, dbcheck, testType, aiRun, baseCodeDetection } |
| cq.getStatus(checkId) | Current status (for polling) |
Results
| Method | Description |
|--------|-------------|
| cq.getOverview(checkId) | Results overview (per-submission similarity scores) |
| cq.getOverviewCSV(checkId) | Overview as CSV text |
| cq.getResults(checkId, submissionId) | Detailed matches for one submission |
| cq.getSummary(checkId) | Summary stats |
| cq.getAIResults(checkId) | AI-generated code detection results |
| cq.exportResults(checkId, format?) | Export results |
| cq.getRemoteFile(location, source) | Content of a matched web file |
| cq.getViewer(checkId, submissionId?) | Results-viewer payload |
| cq.getViewerFile(checkId, submissionId, filePath) | One submission file for the viewer |
| cq.getViewerCounterpart(checkId, submissionId, matchId, legacy?) | The other side of a match |
Reference data & helpers
| Method | Description |
|--------|-------------|
| cq.getLanguages() | Supported languages (999 = Auto Detect) |
| cq.getTestTypes() | Available engines (test types) |
| cq.pollUntilComplete(checkId, options?) | Poll until done. Options: { interval, timeout, onProgress } |
| cq.checkFiles(name, filePaths, options?) | Full workflow in one call |
Webhooks
Pass callbackUrl when creating a check and Codequiry POSTs a signed JSON payload to your URL when the analysis completes, so you can skip polling:
await cq.createCheck('Assignment 1', 999, {
callbackUrl: 'https://your-app.example/codequiry-webhook',
});Errors and rate limits
All methods reject with an axios error on non-2xx responses; err.response.data carries the API's message. The API rate limits at 60 requests per minute per IP. Uploads must be ZIP archives of at most 10 MB; strip build output and dependencies before zipping.
Links
- Codequiry: code plagiarism checker
- API documentation
- Codequiry CLI — run checks from the terminal
- MCP server — plagiarism checks from Claude, Cursor, and other AI agents
- AI code detection
License
MIT © Codequiry
