Our AI detection models just got upgraded. They now catch ChatGPT and Claude in student code more accurately than ever. See what's new
Developer API

Code Plagiarism
Detection API

Build plagiarism detection into your apps. Check code against 20+ billion sources.

const response = await fetch('https://codequiry.com/api/v1/check', { method: 'POST', headers: { 'apikey': 'YOUR_API_KEY' }, body: formData }); // Check created!
EXPORT RESULTS API

Export Check Results

Export plagiarism check results in CSV or JSON format. Ideal for integrating results into external systems, generating reports, or performing additional analysis.

API Endpoint

GET https://codequiry.com/api/v1/checks/{checkId}/export
POST https://codequiry.com/api/v1/check/export
Two equivalent forms: Use the RESTful path form (GET /checks/{checkId}/export) with the check ID in the URL, or the POST form (POST /check/export) with check_id in the request body. The format option may be supplied as a query-string parameter or in the body. Both return the same output.

Authentication

Include your API key in the request header:

apikey: YOUR_API_KEY_HERE

Request Parameters

Parameter Type Required Description
checkId (path) / check_id (body) Integer Required The unique identifier of the check to export. Provide it as the {checkId} URL segment (REST form) or as check_id in the body (POST form).
format String Optional Export format: csv or json. Defaults to csv. Accepted as a query-string parameter or in the body.

JSON Export Response

HTTP Status: 200 OK (when format=json)

{
    "check_id": 2810,
    "check_name": "Python Assignment - Week 5",
    "export_date": "2024-01-15T15:30:00Z",
    "submissions": [
        {
            "submission_id": 45001,
            "filename": "student1_solution.zip",
            "status": "analyzed",
            "plagiarism_local": 45.2,
            "plagiarism_web": 12.8,
            "plagiarism_total": 52.3,
            "matches_local": 3,
            "matches_web": 2,
            "ai_detection_avg": 15.4,
            "ai_detection_max": 32.1,
            "code_quality_avg": 72.5,
            "file_size": 24576,
            "created_at": "2024-01-15 14:31:00",
            "updated_at": "2024-01-15 14:32:47"
        },
        {
            "submission_id": 45002,
            "filename": "student2_solution.zip",
            "status": "analyzed",
            "plagiarism_local": 78.9,
            "plagiarism_web": 5.2,
            "plagiarism_total": 82.1,
            "matches_local": 5,
            "matches_web": 1,
            "ai_detection_avg": 68.7,
            "ai_detection_max": 85.3,
            "code_quality_avg": 45.2,
            "file_size": 18432,
            "created_at": "2024-01-15 14:31:05",
            "updated_at": "2024-01-15 14:32:47"
        }
    ]
}
        
JSON Export
Submission Fields
  • submission_id — Unique identifier for the submission
  • filename — Original uploaded filename (without the .zip extension)
  • status — Submission status label from the database (e.g. Completed), or Unknown if unavailable
  • plagiarism_local — Similarity percentage against other submissions in the check (%)
  • plagiarism_web — Similarity percentage against web sources (%)
  • plagiarism_total — Combined overall plagiarism score (%)
  • matches_local — Number of matching peer submissions
  • matches_web — Number of matching web sources
  • ai_detection_avg — Average AI-generated code probability (%)
  • ai_detection_max — Maximum AI-generated code probability across files (%)
  • code_quality_avg — Average code quality score (%)
  • file_size — Size of the uploaded file in bytes
  • created_at / updated_at — Submission timestamps

CSV Export Response

When format=csv (default), the API returns a direct file download with Content-Type: text/csv.

Submission ID,Filename,Status,Plagiarism Local %,Plagiarism Web %,Plagiarism Total %,Matches Local,Matches Web,AI Detection Avg %,AI Detection Max %,Code Quality Avg,File Size (bytes),Created At,Updated At
45001,student1_solution.zip,Completed,45.2,12.8,52.3,3,2,15.4,32.1,72.5,24576,2024-01-15 14:31:00,2024-01-15 14:32:47
45002,student2_solution.zip,Completed,78.9,5.2,82.1,5,1,68.7,85.3,45.2,18432,2024-01-15 14:31:05,2024-01-15 14:32:47
        
CSV Export

Error Responses

401 Unauthorized

Invalid or missing API key.

404 Not Found

Check not found or does not belong to your account ("Invalid check_id provided.").

422 Unprocessable Entity

No check ID supplied ("check_id is required"), an unsupported format (only csv and json are allowed), or no API Checks folder exists on your account.

409 Conflict

Check is not yet completed. Export is only available once analysis finishes (status_id 4): "Check must be completed before exporting results."

Code Examples

cURL - REST path form (JSON)
curl "https://codequiry.com/api/v1/checks/2810/export?format=json" \
  -H "apikey: YOUR_API_KEY_HERE"
        
cURL - REST
cURL - POST body form (JSON)
curl -X POST "https://codequiry.com/api/v1/check/export" \
  -H "apikey: YOUR_API_KEY_HERE" \
  -d "check_id=2810" \
  -d "format=json"
        
cURL - POST
cURL - CSV Download
curl -X POST "https://codequiry.com/api/v1/check/export" \
  -H "apikey: YOUR_API_KEY_HERE" \
  -d "check_id=2810" \
  -d "format=csv" \
  -o results.csv
        
cURL - CSV
JavaScript
// JSON export
const response = await fetch('https://codequiry.com/api/v1/check/export', {
    method: 'POST',
    headers: {
        'apikey': 'YOUR_API_KEY_HERE',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({ check_id: 2810, format: 'json' })
});

const data = await response.json();
console.log(`Exported ${data.submissions.length} submissions`);

// Sort by plagiarism score (highest first)
const flagged = data.submissions
    .filter(s => s.plagiarism_total > 50)
    .sort((a, b) => b.plagiarism_total - a.plagiarism_total);

flagged.forEach(s => {
    console.log(`${s.filename}: ${s.plagiarism_total}% plagiarism`);
});
        
JavaScript