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!
AI DETECTION RESULTS API

Get AI Detection Results

Retrieve detailed AI-generated code detection results for an assignment. Identifies code that may have been generated by AI tools like ChatGPT, GitHub Copilot, or Claude, with per-file analysis and risk levels.

API Endpoint

GET/POST https://codequiry.com/api/v1/ai-results

Authentication

Include your API key in the request header:

apikey: YOUR_API_KEY_HERE

Request Parameters

Parameter Type Required Description
assignment_id Integer Required The check/assignment ID to retrieve AI detection results for

Success Response

HTTP Status: 200 OK

{
    "success": true,
    "assignment_id": 2810,
    "assignment_name": "Python Assignment - Week 5",
    "assignment_status": "Completed",
    "statistics": {
        "total_submissions": 25,
        "submissions_with_ai_detection": 25,
        "avg_ai_detection": 22.3,
        "high_ai_risk_count": 3,
        "medium_ai_risk_count": 5,
        "low_ai_risk_count": 17
    },
    "submissions": [
        {
            "submission_id": 45001,
            "filename": "student1_solution.zip",
            "plagiarism_score": 52.3,
            "ai_detection": {
                "total_files": 4,
                "avg_ai_probability": 72.5,
                "risk_level": "high",
                "files": [
                    {
                        "filename": "main.py",
                        "ai_probability": 85.2,
                        "risk_level": "high",
                        "confidence": 0.92,
                        "indicators": [
                            "Consistent formatting patterns",
                            "Templated code structure",
                            "Unusual comment style"
                        ]
                    },
                    {
                        "filename": "utils.py",
                        "ai_probability": 45.8,
                        "risk_level": "medium",
                        "confidence": 0.78,
                        "indicators": [
                            "Mixed coding styles",
                            "Some templated patterns"
                        ]
                    }
                ]
            },
            "ai_code_quality": {
                "overall_score": 82.5,
                "metrics": {
                    "consistency": 95.0,
                    "documentation": 88.0,
                    "complexity": 72.0,
                    "naming_conventions": 90.0
                }
            }
        }
    ]
}
        
JSON Response
Response Fields
  • statistics — Aggregate AI detection statistics for the entire assignment
  • statistics.avg_ai_detection — Average AI probability across all submissions (%)
  • statistics.high_ai_risk_count — Submissions with AI probability >= 70%
  • statistics.medium_ai_risk_count — Submissions with AI probability 45-69%
  • statistics.low_ai_risk_count — Submissions with AI probability < 45%
  • submissions[].ai_detection — Per-submission AI detection breakdown
  • submissions[].ai_detection.avg_ai_probability — Average AI probability across all files in the submission (%)
  • submissions[].ai_detection.risk_level — Overall risk classification: high, medium, or low
  • submissions[].ai_detection.files[] — Per-file AI detection analysis
  • files[].ai_probability — Probability that the file was AI-generated (0-100%)
  • files[].confidence — Confidence score of the AI detection model (0-1)
  • files[].indicators — Human-readable reasons for the AI detection score
  • ai_code_quality — Code quality metrics that may correlate with AI generation

Understanding AI Risk Levels

High Risk (>= 70%)

Strong indicators of AI-generated code. The submission shows patterns highly consistent with AI output such as uniform formatting, templated structures, and characteristic comment styles.

Medium Risk (45-69%)

Some indicators of AI assistance. The code may have been partially generated or heavily influenced by AI tools. Manual review recommended.

Low Risk (< 45%)

Minimal AI indicators detected. The code appears to be primarily human-written with natural coding patterns and style variations.

Important: AI detection scores should be used as guidance, not as definitive proof. Always combine AI detection with human review and consider the context of the assignment before making academic integrity decisions.

Error Responses

401 Unauthorized

Invalid or missing API key.

404 Not Found

Assignment not found or does not belong to your account.

409 Conflict

Analysis is still in progress. Wait for completion before retrieving AI results.

Code Examples

cURL
curl -X POST "https://codequiry.com/api/v1/ai-results" \
  -H "apikey: YOUR_API_KEY_HERE" \
  -d "assignment_id=2810"
        
cURL
JavaScript
const response = await fetch('https://codequiry.com/api/v1/ai-results', {
    method: 'POST',
    headers: {
        'apikey': 'YOUR_API_KEY_HERE',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({ assignment_id: 2810 })
});

const data = await response.json();

if (data.success) {
    console.log(`AI Detection Stats:`);
    console.log(`  High risk: ${data.statistics.high_ai_risk_count}`);
    console.log(`  Medium risk: ${data.statistics.medium_ai_risk_count}`);
    console.log(`  Low risk: ${data.statistics.low_ai_risk_count}`);

    // Flag high-risk submissions
    const highRisk = data.submissions.filter(
        s => s.ai_detection.risk_level === 'high'
    );

    highRisk.forEach(s => {
        console.log(`\nFlagged: ${s.filename}`);
        console.log(`  AI Probability: ${s.ai_detection.avg_ai_probability}%`);
        s.ai_detection.files.forEach(f => {
            console.log(`  ${f.filename}: ${f.ai_probability}% - ${f.indicators.join(', ')}`);
        });
    });
}
        
JavaScript
Python
import requests

response = requests.post(
    'https://codequiry.com/api/v1/ai-results',
    headers={'apikey': 'YOUR_API_KEY_HERE'},
    data={'assignment_id': 2810}
)

data = response.json()

if data['success']:
    stats = data['statistics']
    print(f"Total submissions: {stats['total_submissions']}")
    print(f"High AI risk: {stats['high_ai_risk_count']}")
    print(f"Medium AI risk: {stats['medium_ai_risk_count']}")
    print(f"Average AI detection: {stats['avg_ai_detection']}%")

    # Process each submission
    for sub in data['submissions']:
        ai = sub['ai_detection']
        if ai['risk_level'] in ('high', 'medium'):
            print(f"\nFlagged: {sub['filename']} ({ai['risk_level']} risk)")
            for f in ai['files']:
                print(f"  {f['filename']}: {f['ai_probability']}%")
        
Python