Code Plagiarism Detection API
Build plagiarism detection into your applications with our powerful REST API. Detect copied code across 20+ billion sources with industry-leading accuracy.
API Playground
Not ConnectedConnect your API key to test endpoints in real-time
Upload Source Code Files
Add source code files to your plagiarism check for analysis. After creating a check, upload the code submissions you want to analyze—each file represents one student's or developer's work that will be compared against others.
API Endpoint
How File Upload Works
This endpoint allows you to upload source code files to an existing check. Each submission should be packaged as a separate ZIP archive containing all the code you want to analyze. Think of each ZIP file as one person's complete submission—you'll upload multiple ZIP files to compare them against each other.
File Structure Requirements
ZIP Format Only
All files must be compressed as .zip archives—no other formats accepted
2MB Limit
Each ZIP file must be under 2MB in size for optimal processing
One Per Submission
Each ZIP represents one student/developer's complete work
Any Structure
Code inside ZIP can have any folder structure or organization
Request Parameters
This endpoint uses multipart/form-data for file uploads. You'll need to provide both the ZIP file and the check ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
file |
File | Required | ZIP archive containing source code (max 2MB). Must have .zip extension. |
check_id |
Integer | Required | ID of the check to upload to (obtained from create check response) |
Example Request
curl -X POST \
https://codequiry.com/api/v1/check/upload \
-H 'apikey: YOUR_API_KEY_HERE ' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@/path/to/student1_code.zip' \
-F 'check_id=2810'
student_john_doe_assignment3.zip to easily identify submissions in your results. The filename (without .zip extension) will be displayed in all reports.
Success Response
{
"data": [
{
"id": 12,
"filename": "student1_assignment",
"status_id": 2,
"created_at": "2024-01-15 14:35:22",
"updated_at": "2024-01-15 14:35:22",
"result1": "0.00",
"result2": "0.00",
"result3": "0.00",
"total_result": "0.00",
"modify_updated_at": "Jan 15, 2024 2:35 PM UTC",
"assignmentstatuses": {
"id": 2,
"status": "Ready for checking",
"icon": null,
"color": "secondary",
"created_at": null,
"updated_at": null
}
}
],
"file": "student1_assignment.zip",
"submission_count": 1,
"check": {
"id": 2810,
"name": "Python Assignment Check",
"created_at": "2024-01-15 14:30:22",
"updated_at": "2024-01-15 14:35:22",
"status_id": 2,
"job_id": 0
}
}
Understanding the Response
- data — Array of uploaded submissions with their metadata and status information
- file — Name of the uploaded ZIP file as it was received
- submission_count — Total number of submissions now in this check (useful for tracking progress)
- check — Updated check information showing current status
- result fields (0.00) — Placeholder scores that will be calculated when you start analysis
- status_id: 2 — "Ready for checking" status indicating the file is uploaded and awaiting analysis
Multiple File Uploads
You can upload multiple ZIP files to the same check to compare them against each other. Here are two approaches:
Method: Upload files one by one to the same check_id
1. Upload student1_code.zip → check_id: 2810 2. Upload student2_code.zip → check_id: 2810 3. Upload student3_code.zip → check_id: 2810 4. Start analysis when all uploads complete
Method: Upload multiple files simultaneously
✅ Parallel requests with same check_id ✅ Fully supported by the API ✅ Significantly faster for bulk uploads ⚡ Perfect for drag-and-drop interfaces
Error Responses & Troubleshooting
Invalid File Type (422 Unprocessable Entity)
{
"error": "The file must be a file of type: zip."
}
Common Upload Errors
Cause: ZIP file exceeds 2MB limit
Solution: Compress files more aggressively, remove unnecessary files (like images, PDFs, binaries), or split into smaller archives if possible.
Cause: Check ID doesn't exist or not accessible
Solution: Verify the check_id from your create check response. Ensure you're using the correct API key that created the check.
Cause: File is not a valid ZIP archive
Solution: Only .zip files are accepted. Convert RAR, TAR, 7Z, or other formats to ZIP first. Ensure the file isn't corrupted.
Cause: ZIP file contains no source code files
Solution: Ensure the ZIP contains actual source code files matching the language specified when creating the check.
Best Practices & Tips
File Organization
- One ZIP per student/submission
- Use descriptive filenames
- Remove non-code files before zipping
- Keep consistent folder structures
Performance
- Use concurrent uploads for speed
- Don't upload hundreds at once
- Consider batch processing for large sets
- Monitor submission_count in responses
Error Handling
- Validate file types before upload
- Check file sizes client-side
- Implement retry logic for failures
- Log check_id for troubleshooting
File Preparation
- Compress with standard ZIP tools
- Test archives open correctly
- Remove compiled binaries (.exe, .o)
- Exclude build folders (node_modules, etc.)
What's Next?
After uploading all your source code files, you're ready to start the plagiarism analysis: