Detect plagiarized and similar code across trillions of code sources on the web See what's new
Developer API

Check Status

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

GET https://codequiry.com/api/v1/checks/{checkId}/status
POST https://codequiry.com/api/v1/check/status
Two equivalent forms: Use the RESTful path form (GET /checks/{checkId}/status) with the check ID in the URL, or the POST form (POST /check/status) with check_id in the request body. Both return the same payload.

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 monitor. Provide it as the {checkId} URL segment (REST form) or as check_id in the body (POST form).

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-15T15:05:00+00: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 (status_id 4)
  • estimated_completion — Rough ISO-8601 estimate (30s per remaining submission), only populated while the check is queued or running (status_id 6 or 7); otherwise null
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 ("Invalid check_id provided.").

422 Unprocessable Entity

No check ID supplied ("check_id is required"), or no API Checks folder exists on your account ("No API Checks folder exists.").

Code Examples

cURL (REST path form)
curl "https://codequiry.com/api/v1/checks/2810/status" \
  -H "apikey: YOUR_API_KEY_HERE"
        
cURL - REST
cURL (POST body form)
curl -X POST "https://codequiry.com/api/v1/check/status" \
  -H "apikey: YOUR_API_KEY_HERE" \
  -d "check_id=2810"
        
cURL - POST
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