codequiry
v2.0.1
Published
Node.js SDK for Codequiry's Code Plagiarism & Similarity Detection API
Downloads
33
Maintainers
Readme
Codequiry - Node.js SDK
Official Node.js SDK for Codequiry's Code Plagiarism & Similarity Detection API.
Check source code files against billions of web sources, public repositories, and peer submissions. Supports 65+ programming languages.
Installation
npm install codequiryQuick Start
const Codequiry = require('codequiry');
const cq = new Codequiry('YOUR_API_KEY');
// Create a check, upload files, start, and get results
async function run() {
// Create a check (language 14 = Python)
const check = await cq.createCheck('Assignment 1', 14);
console.log('Created:', check);
// Upload a zip file
await cq.uploadFile(check.check.id, './submissions.zip');
// Start the check
await cq.startCheck(check.check.id, { dbcheck: true });
// Poll until complete
const status = await cq.pollUntilComplete(check.check.id, {
onProgress: (s) => console.log('Progress:', s),
});
// Get results
const overview = await cq.getOverview(check.check.id);
console.log('Results:', overview);
}
run().catch(console.error);API Reference
Constructor
const cq = new Codequiry('YOUR_API_KEY');Account
| Method | Description |
|--------|-------------|
| cq.account() | Get account info and usage quota |
Checks
| Method | Description |
|--------|-------------|
| cq.checks() | List all checks |
| cq.createCheck(name, languageId, testType?) | Create a new check |
| cq.getCheck(checkId) | Get check info and status |
| cq.deleteCheck(checkId) | Delete a check |
Upload
| Method | Description |
|--------|-------------|
| cq.uploadFile(checkId, filePath) | Upload a ZIP file |
| cq.uploadBatch(checkId, filePaths) | Upload multiple ZIP files |
Start & Status
| Method | Description |
|--------|-------------|
| cq.startCheck(checkId, options?) | Start a check. Options: { dbcheck, webcheck, testType } |
| cq.getStatus(checkId) | Get current check status |
| cq.pollUntilComplete(checkId, options?) | Poll until done. Options: { interval, timeout, onProgress } |
Results
| Method | Description |
|--------|-------------|
| cq.getOverview(checkId) | Results overview with similarity scores |
| cq.getResults(checkId, submissionId) | Detailed results for a submission |
| cq.getSummary(checkId) | Summary statistics |
Reference Data
| Method | Description |
|--------|-------------|
| cq.getLanguages() | List supported programming languages |
| cq.getTestTypes() | List available check engine types |
Supported Languages
Java, Python, C, C++, C#, Perl, PHP, SQL, VB, XML, Haskell, Pascal, Go, Matlab, Lisp, Ruby, Assembly, HTML, JavaScript/TypeScript, Swift, Kotlin, Dart, Elixir, Jupyter Notebooks, and many more.
Migration from v1
v2 uses modern async/await instead of callbacks:
// v1 (old)
Codequiry.setAPIKey('key');
Codequiry.checks(function(data, err) {
console.log(data);
});
// v2 (new)
const cq = new Codequiry('key');
const checks = await cq.checks();
console.log(checks);