Developer API

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.

99.7%
Accuracy
51+
Languages
20B+
Sources
5
SDKs

API Playground

Not Connected
CSV EXPORT API

Export Plagiarism Results as CSV

Download detailed plagiarism analysis results in CSV format for external processing, reporting, or integration with other academic tools and systems.

API Endpoint

POST https://codequiry.com/api/v1/check/overviewCSV
Response Format: This endpoint returns a CSV file download, not JSON. The response will have appropriate headers for file download.

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 ID of the completed check to export results from

Response Format

HTTP Status: 200 OK

Content-Type: text/csv

Content-Disposition: attachment; filename=file.csv

CSV Structure:
Submission,Score
student1.py,45.67
student2.py,23.89
student3.py,78.34
student4.py,12.45
Column Descriptions
  • Submission: The filename of the submitted code file
  • Score: Plagiarism percentage (0.00 to 100.00)

Error Responses

401 Unauthorized

Invalid or missing API key.

422 Validation Error

Invalid check_id parameter or check does not belong to your account.

409 Conflict

Check is not completed yet. Results can only be exported after analysis is finished.

Code Examples

Python
import requests

API_KEY = "your_api_key_here"
API_URL = "https://codequiry.com/api/v1/check/overviewCSV"

headers = {
    "apikey": API_KEY
}

data = {
    "check_id": 12345
}

try:
    response = requests.post(API_URL, headers=headers, data=data)

    if response.status_code == 200:
        # Save the CSV file
        with open('plagiarism_results.csv', 'wb') as f:
            f.write(response.content)

        print("✅ CSV results downloaded successfully!")
        print("File saved as: plagiarism_results.csv")

        # Optional: Print first few lines
        content = response.content.decode('utf-8')
        lines = content.split('\n')[:6]  # First 5 lines + header
        print("\nPreview:")
        for line in lines:
            if line.strip():
                print(line)

    else:
        error_data = response.json()
        print(f"❌ Error: {error_data.get('error', 'Unknown error')}")

except requests.exceptions.RequestException as e:
    print(f"❌ Request failed: {e}")
Node.js
const axios = require('axios');
const fs = require('fs');

const API_KEY = 'your_api_key_here';
const API_URL = 'https://codequiry.com/api/v1/check/overviewCSV';

async function downloadCSVResults() {
    try {
        const response = await axios.post(API_URL, {
            check_id: 12345
        }, {
            headers: {
                'apikey': API_KEY
            },
            responseType: 'stream'
        });

        // Save to file
        const writer = fs.createWriteStream('plagiarism_results.csv');
        response.data.pipe(writer);

        return new Promise((resolve, reject) => {
            writer.on('finish', () => {
                console.log('✅ CSV results downloaded successfully!');
                console.log('File saved as: plagiarism_results.csv');
                resolve();
            });
            writer.on('error', reject);
        });

    } catch (error) {
        if (error.response) {
            console.error(`❌ API Error: ${error.response.data.error || error.response.statusText}`);
        } else {
            console.error(`❌ Request failed: ${error.message}`);
        }
    }
}

downloadCSVResults();
PHP
<?php

$apiKey = 'your_api_key_here';
$apiUrl = 'https://codequiry.com/api/v1/check/overviewCSV';

$data = [
    'check_id' => 12345
];

// Initialize cURL
$ch = curl_init($apiUrl);

curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => http_build_query($data),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "apikey: $apiKey"
    ]
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);

// Handle response
if ($error) {
    echo "❌ Request failed: $error\n";
    exit(1);
}

if ($httpCode === 200) {
    // Save the CSV file
    file_put_contents('plagiarism_results.csv', $response);
    echo "✅ CSV results downloaded successfully!\n";
    echo "File saved as: plagiarism_results.csv\n";

    // Optional: Show preview
    $lines = explode("\n", $response);
    echo "\nPreview (first 5 lines):\n";
    for ($i = 0; $i < min(5, count($lines)); $i++) {
        if (!empty(trim($lines[$i]))) {
            echo $lines[$i] . "\n";
        }
    }
} else {
    $result = json_decode($response, true);
    echo "❌ Error: " . ($result['error'] ?? 'Unknown error') . "\n";
}
?>
cURL
curl -X POST "https://codequiry.com/api/v1/check/overviewCSV" \
  -H "apikey: your_api_key_here" \
  -d "check_id=12345" \
  -o plagiarism_results.csv

Common Use Cases

LMS Integration

Import results into Learning Management Systems like Canvas, Moodle, or Blackboard

Data Analysis

Process results with Python pandas, R, or Excel for statistical analysis

Database Import

Bulk import results into academic databases or research systems

Report Generation

Create automated reports and share with academic committees

Important Notes

Check Completion Required

CSV export is only available for completed checks (status 4). Attempting to export incomplete checks will return a 409 Conflict error.

Data Format

Scores are provided as decimal percentages (e.g., 45.67 for 45.67%). The CSV uses standard comma separation and includes a header row.

File Naming

The downloaded file will be named "file.csv" by default. You can rename it after download or specify a custom filename in your code.

Next Steps: Learn how to get detailed match information for specific submissions, or retrieve JSON results for programmatic processing.