Codequiry API Documentation
Integrate powerful plagiarism detection into your applications. Detect code similarity across 50+ languages with our comprehensive REST API.
Quick Start
1Get Your API Key
Navigate to your dashboard and generate an API key from the settings page.
2Make Your First Request
Test your API key by fetching your account information:
curl -X GET https://codequiry.com/api/v1/account \ -H "apikey: YOUR_API_KEY_HERE"
3Create a Check
Start by creating a new plagiarism check:
curl -X POST https://codequiry.com/api/v1/check/create \
-H "apikey: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"name": "Assignment 1",
"language": 13
}'
Authentication
All API requests require authentication using your API key in the request header:
apikey: YOUR_API_KEY_HERE
Base URL
All API endpoints are relative to:
https://codequiry.com/api/v1/
API Endpoints
Get the current API version information.
Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | string | Optional | Your API authentication key (not required for this endpoint) |
Response
{
"version": 1.0,
"releaseDate": "June 20, 2019"
}
Example Request
curl -X POST https://codequiry.com/api/v1/version
Retrieve information about your account including remaining checks and subscription status.
Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | string | Required | Your API authentication key |
Response
{
"user": "John Doe",
"email": "[email protected]",
"pro_checks_remaining": 150,
"submissions": 45,
"is_pro": true,
"plan_id": 2
}
Example Request
curl -X GET https://codequiry.com/api/v1/account \ -H "apikey: YOUR_API_KEY_HERE"
Retrieve a list of all your plagiarism checks.
Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | string | Required | Your API authentication key |
Response
[
{
"id": 123,
"name": "Assignment 1",
"status_id": 4,
"language_id": 1,
"test_type": 9,
"created_at": "2025-11-16T10:30:00.000000Z",
"updated_at": "2025-11-16T10:35:00.000000Z"
}
]
Create a new plagiarism check.
Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | string | Required | Your API authentication key |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Name of the check (3-255 characters) |
| language | integer | Optional | Programming language ID (defaults to Java/ID 13 if not provided, see supported languages) |
Response
{
"id": 456,
"user_id": 789,
"course_id": 12,
"name": "Assignment 1",
"status_id": 1,
"language_id": 1,
"test_type": 1,
"is_api": true,
"wb_check": 1,
"gh_check": 1,
"so_check": 1,
"gist_check": 1,
"created_at": "2025-11-16T10:30:00.000000Z",
"updated_at": "2025-11-16T10:30:00.000000Z"
}
Example Request
curl -X POST https://codequiry.com/api/v1/check/create \
-H "apikey: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"name": "Assignment 1",
"language": 13
}'
Retrieve details about a specific check including its submissions.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| check_id | integer | Required | The ID of the check to retrieve |
Response
{
"check": {
"id": 456,
"name": "Assignment 1",
"status_id": 2,
"language_id": 1,
"test_type": 9
},
"status": "Uploaded",
"submission_count": 3,
"submissions": [
{
"id": 789,
"filename": "student1",
"status_id": 2,
"result1": 0
}
]
}
Upload a ZIP file containing code submissions to an existing check.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| check_id | integer | Required | The ID of the check to upload to |
| file | file | Required | ZIP file (max 10MB) |
Response
{
"data": [
{
"id": 789,
"filename": "student1",
"status_id": 2,
"file_url": "456/1637065800_student1.zip"
}
],
"file": "student1.zip",
"submission_count": 1,
"check": {
"id": 456,
"status_id": 2
}
}
Example Request
curl -X POST https://codequiry.com/api/v1/check/upload \ -H "apikey: YOUR_API_KEY_HERE" \ -F "check_id=456" \ -F "[email protected]"
Delete a specific submission from a check.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| check_id | integer | Required | The ID of the check |
| submission_id | integer | Required | The ID of the submission to delete |
Response
{
"success": true,
"message": "The submission has been deleted successfully."
}
Start the plagiarism detection analysis for a check.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| check_id | integer | Required | The ID of the check to start |
| test_type | integer | Optional | Detection engine type (1-14, see engine types) |
| webcheck | boolean | Optional | Enable web plagiarism detection (deprecated, use test_type) |
| dbcheck | boolean | Optional | Enable database checking (deprecated, use test_type) |
Response
{
"success": true,
"check": {
"id": 456,
"status_id": 7,
"test_type": 9
},
"status": "Queued",
"submission_count": 3,
"checkURL": "https://codequiry.com/content/course/12/assignment/456"
}
Example Request
curl -X POST https://codequiry.com/api/v1/check/start \
-H "apikey: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"check_id": 456,
"test_type": 9
}'
All-in-one endpoint: creates a check, uploads files, and starts analysis in a single request.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Name of the check (3-255 characters) |
| language | integer | Optional | Programming language ID (defaults to Java/ID 13) |
| files[] | file[] | Required | Array of ZIP files (max 10MB each) |
| test_type | integer | Optional | Detection engine type (1-14, default: 1) |
| webcheck | boolean | Optional | Enable web checking (deprecated) |
| dbcheck | boolean | Optional | Enable database checking (deprecated) |
Response
{
"success": true,
"message": "Check created, files uploaded, and analysis started successfully.",
"data": {
"check_id": 456,
"check_name": "Assignment 1",
"language": "Java",
"language_id": 1,
"status": "Processing",
"status_id": 7,
"test_type": 9,
"submissions": {
"uploaded": 3,
"failed": 0,
"total": 3,
"details": [...]
},
"detection_settings": {
"web_check": true,
"github_check": true,
"stackoverflow_check": true,
"gist_check": true
},
"check_url": "https://codequiry.com/content/course/12/assignment/456",
"execution_time_ms": 1234.56
},
"next_steps": {
"poll_status": "Use GET /check/get with check_id=456 to monitor progress",
"get_results": "Once status is 'Completed', use POST /check/overview with check_id=456"
}
}
Example Request
curl -X POST https://codequiry.com/api/v1/check/quick \ -H "apikey: YOUR_API_KEY_HERE" \ -F "name=Assignment 1" \ -F "language=13" \ -F "test_type=9" \ -F "files[][email protected]" \ -F "files[][email protected]" \ -F "files[][email protected]"
Get the overview and results of a completed check.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| check_id | integer | Required | The ID of the completed check |
Response
{
"overviewURL": "https://codequiry.com/content/course/12/assignment/456/overview",
"submissions": [
{
"id": 789,
"filename": "student1",
"result1": 85.5,
"total_result": 85.5,
"status_id": 4
}
],
"bardata": [
{
"submission": "student1",
"score": 85.5
}
]
}
Download the check results as a CSV file.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| check_id | integer | Required | The ID of the completed check |
Response
Returns a CSV file with headers: Submission, Score
Example Request
curl -X POST https://codequiry.com/api/v1/check/overviewCSV \
-H "apikey: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"check_id": 456}' \
-o results.csv
Get detailed results for a specific submission including matches and file content.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| check_id | integer | Required | The ID of the check |
| submission_id | integer | Required | The ID of the submission |
Response
{
"submission": {
"id": 789,
"filename": "student1",
"result1": 85.5,
"total_result": 85.5,
"submissionfiles": [...]
},
"avg": 72.3,
"max": 95.2,
"min": 45.1,
"other_matches": [
{
"id": 1,
"submission_id": 789,
"matched_submission_id": 790,
"tokens": 1250,
"percentage": 85.5
}
],
"related_submissions": [...],
"related_files": [...]
}
Retrieve content of a matched file from web sources.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| location | string | Required | The location identifier of the file |
| source | string | Required | The source identifier |
Response
{
"file": {
"id": 123,
"location": "https://github.com/...",
"source": "GitHub",
"content": "...",
"submission_id": 789
}
}
Get your API checks folder ID.
Response
{
"folder_id": 12
}
Detection Engine Types
Choose the appropriate detection engine based on your use case. Use the test_type parameter when starting a check.
| ID | Engine Name | Description |
|---|---|---|
| 1 | Web + Group Similarity | Combines group similarity with extensive web scanning across GitHub, cheating sites, and billions of pages. Deep code-to-code analysis catches plagiarism in modified or obfuscated code. |
| 3 | Small Code Optimized | Optimized for small to medium code (0-3,000 lines) with enhanced sensitivity for shorter segments. Ideal for assignments and individual files. |
| 4 | Batch Processing | Analyzes multiple submissions with emphasis on cross-comparison within your group. Cost-effective for batch processing and classroom assignments. |
| 6 | Enterprise Volume | Enterprise-grade engine for massive volume processing. Handles thousands of files with intelligent filtering to highlight significant matches. |
| 7 | Cost-Optimized | Cost-optimized engine focusing on high-confidence matches. Perfect for budget-conscious users needing reliable detection. |
| 8 | Deep Scan | Advanced experimental engine with maximum sensitivity and comprehensive search. Requires higher resources; recommended for small submissions only. |
| 9 | Group Similarity Only | Recommended for students. Advanced HexaGram Tokenization supporting 50+ languages. Compares submissions within your group only - no web searches. Includes free AI Detection. Consumes just one quota per run. |
| 10 | Group + Auto Base Code | Automatically filters out template code and starter files, focusing detection on each student's unique work. Ignores shared scaffolds and boilerplate. |
| 11 | Web + Auto Base Code | Combines web scanning with automatic filtering of common libraries and boilerplate code for cleaner, more relevant results. |
| 12 | High-Sensitivity Group | High-sensitivity group comparison with stricter matching criteria (30% tolerance). Catches subtle similarities and near-matches. |
| 13 | Large Batch Optimized | Handles 200+ submissions with increased tolerance and background multithreading. Ideal for large batches and scalable processing. |
| 14 | Web + Large Batch | Combines web scanning with optimization for large batches. Uses multithreading for improved performance on many submissions. |
| 15 | Flagship Detection Not Available via API | Flagship engine searching 4+ billion sources including web, GitHub, StackOverflow, and academic databases. Results in approximately 20 minutes. (Available only through web interface) |
Supported Programming Languages
Use these language IDs when creating checks. Codequiry supports 50+ programming languages.
GET https://codequiry.com/api/v1/languages
| Language | ID | File Extensions |
|---|---|---|
| Python | 14 |
.py |
| Java | 13 |
.java |
| JavaScript | 39 |
.js, .jsx |
| TypeScript | 55 |
.ts, .tsx |
| C++ | 17 |
.cpp, .hpp, .cc |
| C# | 18 |
.cs |
| C | 16 |
.c, .h |
| PHP | 20 |
.php |
| Ruby | 21 |
.rb |
| Go | 22 |
.go |
| Swift | 23 |
.swift |
| Kotlin | 24 |
.kt, .kts |
| Rust | 25 |
.rs |
| R | 26 |
.r, .R |
| MATLAB | 27 |
.m |
GET /languages endpoint or visit your dashboard to see all 50+ supported languages with their IDs.
HTTP Status Codes
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Insufficient permissions or verification required |
| 422 | Unprocessable Entity | Validation errors in request data |
| 500 | Internal Server Error | Server error occurred |
Check Status IDs
When polling for check status, you'll receive one of these status_id values:
| ID | Status | Description |
|---|---|---|
| 1 | Created | Check created, awaiting file uploads |
| 2 | Uploaded | Files uploaded, ready to start |
| 4 | Completed | Analysis complete, results available |
| 6 | Checking | Currently being analyzed |
| 7 | Queued | Waiting in queue for processing |
Error Handling
Error Response Format
All errors return a JSON object with an error field:
{
"error": "Invalid API key",
"validation_errors": {
"name": ["The name field is required."]
}
}
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| Invalid API key | API key is incorrect or missing | Check your API key in the dashboard |
| No API Checks folder exists | API folder not initialized | Enable and disable your API key from the dashboard |
| Invalid check_id provided | Check doesn't exist or doesn't belong to you | Verify the check_id is correct |
| The check is not completed | Trying to get results before completion | Wait for status_id = 4 before fetching results |
| Verification Required | Free tier limits exceeded | Verify .edu email or upgrade to Pro |
Best Practices
- Always check the HTTP status code before parsing the response
- Implement exponential backoff for rate limiting
- Poll check status every 30-60 seconds, not more frequently
- Handle network errors gracefully with retries
- Log all API errors for debugging
Code Examples
Python Example - Quick Check
import requests
API_KEY = "your_api_key_here"
BASE_URL = "https://codequiry.com/api/v1"
headers = {
"apikey": API_KEY
}
# Quick check - all in one
files = {
'files[]': [
('files[]', open('student1.zip', 'rb')),
('files[]', open('student2.zip', 'rb')),
('files[]', open('student3.zip', 'rb'))
]
}
data = {
"name": "Assignment 1",
"language": 133, # Java
"test_type": 9 # Group Similarity Only
}
response = requests.post(
f"{BASE_URL}/check/quick",
headers=headers,
data=data,
files=files
)
result = response.json()
if result.get('success'):
check_id = result['data']['check_id']
print(f"Check created: {check_id}")
print(f"Status: {result['data']['status']}")
# Poll for completion
import time
while True:
status_response = requests.post(
f"{BASE_URL}/check/get",
headers=headers,
json={"check_id": check_id}
)
status_data = status_response.json()
if status_data['check']['status_id'] == 4:
print("Check completed!")
# Get results
results_response = requests.post(
f"{BASE_URL}/check/overview",
headers=headers,
json={"check_id": check_id}
)
results = results_response.json()
for submission in results['submissions']:
print(f"{submission['filename']}: {submission['result1']}%")
break
print("Still processing...")
time.sleep(30)
else:
print(f"Error: {result.get('error')}")
Node.js Example - Quick Check
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://codequiry.com/api/v1';
async function quickCheck() {
const form = new FormData();
form.append('name', 'Assignment 1');
form.append('language', '13'); // Java
form.append('test_type', '9'); // Group Similarity
form.append('files[]', fs.createReadStream('student1.zip'));
form.append('files[]', fs.createReadStream('student2.zip'));
form.append('files[]', fs.createReadStream('student3.zip'));
try {
const response = await axios.post(
`${BASE_URL}/check/quick`,
form,
{
headers: {
...form.getHeaders(),
'apikey': API_KEY
}
}
);
const checkId = response.data.data.check_id;
console.log(`Check created: ${checkId}`);
// Poll for completion
await pollCheckStatus(checkId);
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
async function pollCheckStatus(checkId) {
while (true) {
const response = await axios.post(
`${BASE_URL}/check/get`,
{ check_id: checkId },
{ headers: { 'apikey': API_KEY } }
);
if (response.data.check.status_id === 4) {
console.log('Check completed!');
// Get results
const results = await axios.post(
`${BASE_URL}/check/overview`,
{ check_id: checkId },
{ headers: { 'apikey': API_KEY } }
);
results.data.submissions.forEach(sub => {
console.log(`${sub.filename}: ${sub.result1}%`);
});
break;
}
console.log('Still processing...');
await new Promise(resolve => setTimeout(resolve, 30000));
}
}
quickCheck();
PHP Example - Quick Check
<?php
$apiKey = 'your_api_key_here';
$baseUrl = 'https://codequiry.com/api/v1';
// Quick check
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$baseUrl/check/quick");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"apikey: $apiKey"
]);
$postData = [
'name' => 'Assignment 1',
'language' => 13, // Java
'test_type' => 9
];
// Add multiple files
$postData['files[0]'] = new CURLFile('student1.zip');
$postData['files[1]'] = new CURLFile('student2.zip');
$postData['files[2]'] = new CURLFile('student3.zip');
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
if ($result['success']) {
$checkId = $result['data']['check_id'];
echo "Check created: $checkId\n";
// Poll for completion
while (true) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$baseUrl/check/get");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"apikey: $apiKey",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'check_id' => $checkId
]));
$statusResponse = curl_exec($ch);
curl_close($ch);
$statusData = json_decode($statusResponse, true);
if ($statusData['check']['status_id'] == 4) {
echo "Check completed!\n";
// Get results
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$baseUrl/check/overview");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"apikey: $apiKey",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'check_id' => $checkId
]));
$resultsResponse = curl_exec($ch);
curl_close($ch);
$results = json_decode($resultsResponse, true);
foreach ($results['submissions'] as $submission) {
echo "{$submission['filename']}: {$submission['result1']}%\n";
}
break;
}
echo "Still processing...\n";
sleep(30);
}
} else {
echo "Error: {$result['error']}\n";
}
?>
Java Example - Quick Check
import java.net.http.*;
import java.net.URI;
import java.nio.file.*;
import org.json.*;
public class CodequiryAPI {
private static final String API_KEY = "your_api_key_here";
private static final String BASE_URL = "https://codequiry.com/api/v1";
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
// Create multipart form data
String boundary = "----Boundary" + System.currentTimeMillis();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(BASE_URL + "/check/quick"))
.header("apikey", API_KEY)
.header("Content-Type", "multipart/form-data; boundary=" + boundary)
.POST(ofMimeMultipartData(Map.of(
"name", "Assignment 1",
"language", "1",
"test_type", "9"
), Map.of(
"files[]", List.of(
Path.of("student1.zip"),
Path.of("student2.zip"),
Path.of("student3.zip")
)
), boundary))
.build();
HttpResponse response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JSONObject result = new JSONObject(response.body());
if (result.getBoolean("success")) {
int checkId = result.getJSONObject("data").getInt("check_id");
System.out.println("Check created: " + checkId);
// Poll for completion
pollCheckStatus(client, checkId);
} else {
System.out.println("Error: " + result.getString("error"));
}
}
private static void pollCheckStatus(HttpClient client, int checkId)
throws Exception {
while (true) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(BASE_URL + "/check/get"))
.header("apikey", API_KEY)
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(
"{\"check_id\":" + checkId + "}"
))
.build();
HttpResponse response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JSONObject data = new JSONObject(response.body());
if (data.getJSONObject("check").getInt("status_id") == 4) {
System.out.println("Check completed!");
getResults(client, checkId);
break;
}
System.out.println("Still processing...");
Thread.sleep(30000);
}
}
private static void getResults(HttpClient client, int checkId)
throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(BASE_URL + "/check/overview"))
.header("apikey", API_KEY)
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(
"{\"check_id\":" + checkId + "}"
))
.build();
HttpResponse response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JSONObject results = new JSONObject(response.body());
JSONArray submissions = results.getJSONArray("submissions");
for (int i = 0; i < submissions.length(); i++) {
JSONObject sub = submissions.getJSONObject(i);
System.out.println(sub.getString("filename") + ": " +
sub.getDouble("result1") + "%");
}
}
}
cURL Example - Complete Workflow
# 1. Get account info curl -X GET https://codequiry.com/api/v1/account \ -H "apikey: YOUR_API_KEY" # 2. Quick check (all-in-one) curl -X POST https://codequiry.com/api/v1/check/quick \ -H "apikey: YOUR_API_KEY" \ -F "name=Assignment 1" \ -F "language=13" \ -F "test_type=9" \ -F "files[][email protected]" \ -F "files[][email protected]" \ -F "files[][email protected]" # 3. Check status (poll every 30 seconds) curl -X POST https://codequiry.com/api/v1/check/get \ -H "apikey: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"check_id": 456}' # 4. Get results (when status_id = 4) curl -X POST https://codequiry.com/api/v1/check/overview \ -H "apikey: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"check_id": 456}' # 5. Get detailed results for a submission curl -X POST https://codequiry.com/api/v1/check/results \ -H "apikey: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"check_id": 456, "submission_id": 789}' # 6. Download CSV results curl -X POST https://codequiry.com/api/v1/check/overviewCSV \ -H "apikey: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"check_id": 456}' \ -o results.csv
Rate Limits & Quotas
API Rate Limits
API requests are subject to rate limiting based on your subscription tier:
| Plan | Rate Limit | Quota |
|---|---|---|
| Free | 60 requests/hour | 2 free Group Similarity checks |
| .EDU Verified | 120 requests/hour | 200 free checks |
| Pro | 300 requests/hour | Based on subscription |
| Enterprise | Custom | Unlimited |
Check Quotas
- Group Similarity Only (test_type 9): Consumes 1 quota per check
- Web + Group (test_type 1): Quota based on submissions and lines of code
- Other engines: Variable quota consumption
X-RateLimit-Remaining header in responses to monitor your usage.
Webhooks (Coming Soon)
Webhook support for check completion notifications is currently in development. This will allow you to receive real-time notifications when checks are completed instead of polling.