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!
CHECK STATUS API

Get Check Status

Monitor the real-time progress of a plagiarism check. Use this endpoint to poll for completion status and track analysis progress.

API Endpoint

POST https://codequiry.com/api/v1/check/status

Authentication

Include your API key in the request header:

apikey: YOUR_API_KEY_HERE

Request Parameters

Parameter Type Required Description
check_id Integer Required The unique identifier of the check to monitor

Success Response

HTTP Status: 200 OK

{
    "check_id": 2810,
    "status_id": 6,
    "status": "Checking",
    "status_message": "Analyzing submissions for plagiarism...",
    "progress": 65,
    "submissions_total": 25,
    "submissions_completed": 16,
    "estimated_completion": "2024-01-15 15:05:00"
}
        
JSON Response
Response Fields
  • check_id — The check being monitored
  • status_id — Numeric status code (see status table below)
  • status — Human-readable status label
  • status_message — Detailed description of current activity
  • progress — Completion percentage (0-100)
  • submissions_total — Total number of submissions in this check
  • submissions_completed — Number of submissions fully analyzed
  • estimated_completion — Estimated completion time (UTC) when available
Status Codes Reference
Status ID Status Description
1 Created Check has been created, awaiting file uploads
2 Uploading Files are being uploaded to the check
4 Completed Analysis is complete, results are available
5 Error Analysis encountered an error
6 Checking Analysis is actively running
7 Queued Check is queued and waiting to be processed

Polling Best Practices

Poll Every 30 Seconds

Check status every 30 seconds. Polling more frequently wastes API calls without benefit.

Set a Timeout

Set a maximum wait time (10-15 minutes) to handle edge cases where processing takes longer than expected.

Check for status_id 4

Status ID 4 means "completed" - this is when you should fetch the results.

Handle Errors

Status ID 5 means an error occurred. Log the error and notify the user rather than continuing to poll.

Polling Example
async function waitForCompletion(checkId, maxWaitMs = 600000) {
    const startTime = Date.now();

    while (Date.now() - startTime < maxWaitMs) {
        const response = await fetch('https://codequiry.com/api/v1/check/status', {
            method: 'POST',
            headers: {
                'apikey': 'YOUR_API_KEY_HERE',
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({ check_id: checkId })
        });

        const status = await response.json();

        if (status.status_id === 4) {
            console.log('Analysis complete!');
            return status;
        }

        if (status.status_id === 5) {
            throw new Error(`Analysis failed: ${status.status_message}`);
        }

        console.log(`Progress: ${status.progress}% - ${status.status_message}`);
        await new Promise(resolve => setTimeout(resolve, 30000)); // Wait 30s
    }

    throw new Error('Analysis timed out');
}

const status = await waitForCompletion(2810);
        
Polling Example

Error Responses

401 Unauthorized

Invalid or missing API key.

404 Not Found

The specified check does not exist or does not belong to your account.

Code Examples

cURL
curl -X POST "https://codequiry.com/api/v1/check/status" \
  -H "apikey: YOUR_API_KEY_HERE" \
  -d "check_id=2810"
        
cURL
Python
import requests
import time

def wait_for_completion(check_id, api_key, timeout=600):
    """Poll check status until complete or timeout."""
    start = time.time()

    while time.time() - start < timeout:
        response = requests.post(
            'https://codequiry.com/api/v1/check/status',
            headers={'apikey': api_key},
            data={'check_id': check_id}
        )
        status = response.json()

        if status['status_id'] == 4:
            print('Analysis complete!')
            return status

        if status['status_id'] == 5:
            raise Exception(f"Analysis failed: {status['status_message']}")

        print(f"Progress: {status['progress']}% - {status['status_message']}")
        time.sleep(30)

    raise TimeoutError('Analysis timed out')

status = wait_for_completion(2810, 'YOUR_API_KEY_HERE')
        
Python