طلب فحص جديد
ملف واحد في الطلب الواحدملفاتي
ملفاتي
0 طلبسجل المدفوعات
كل عمليات الشحن اللي عملتها وحالتها
Developer API
PKCHECKER_API_KEY). Never put it in website JavaScript, a mobile app, or a public code repository: anyone who sees the key can send files and use up your credits. If it leaks, press Regenerate above at once; the old key stops working immediately.Submit Document
POST file (.docx/.pdf) to /v1/scan/submit to queue report.
Check Status
GET /v1/scan/status or receive instant Webhook callback.
Download PDF Reports
GET /v1/scan/download for the Similarity or AI PDF report.
Submit a file or raw text to start Turnitin plagiarism and AI scanning.
| Field | Type | Required | Description |
|---|---|---|---|
| server | String | No | Accepted for compatibility ("s1"); every file is checked on the standard server. |
| file | File | Yes* | Document file (.docx, .pdf, .doc, .txt, .odt). Limit: Max 50 MB • Similarity up to 50,000 words • AI up to 30,000 words. *Or supply text |
| text | String | No | Raw document text content (Min 40 words) if not uploading a binary file. |
| service_type | String | No | "Both" (Default: similarity + AI), "Turnitin AI" (same as Both), or "Turnitin Plagiarism" (similarity only) |
| exclude_quotes | 0 / 1 | No | Exclude direct quotes & quotation marks from plagiarism (Default: 0) |
| exclude_biblio | 0 / 1 | No | Exclude references and bibliography section (Default: 0). Also accepts exclude_bibliography |
| exclude_citations | 0 / 1 | No | Exclude in-text citations from similarity calculation (Default: 0) |
| exclude_small_matches | 0 / 1 | No | Exclude small sources / word filter under the word threshold (Default: 0) |
| small_match_threshold | Integer (8-250) | No | Word filter threshold (e.g. 8, 10, 14 words. Default: 8). Also accepts exclude_words |
| custom_id | String | No | Your internal order/user ID (e.g. order_9812) returned in all callbacks |
| webhook_url | URL | No | Optional per-request webhook endpoint (https). Overrides the account webhook for this file. |
ai_score and ai_download_url are null (split longer documents by chapter to get an AI report). ai_score is also null when Turnitin prints *% (an AI score of 20% or less). The AI Highlights report is under development and not active yet, so ai_highlights_url is always null for now.{
"success": true,
"file_id": "PK1-261124-21",
"filename": "Research_Thesis.docx",
"custom_id": "order_9812",
"status": "Pending",
"message": "File submitted successfully and queued for Turnitin scanning",
"slots_remaining": 14
}
Retrieve processing state, similarity percentage, AI score, and direct download links for the Similarity Report, the AI Report and the AI Highlights Report. Status values: Pending, Processing, Completed, Failed (with an error field). A file that still has no result 1 hour after it was sent to the check service is marked Failed automatically, its credit is returned, and a scan.failed webhook is sent.
{
"success": true,
"file_id": "PK1-261124-21",
"filename": "Research_Thesis.docx",
"custom_id": "order_9812",
"status": "Completed",
"similarity_score": 14,
"ai_score": 2,
"word_count": 4850,
"download_url": "https://www.pkchecker.com/v1/scan/download?file_id=PK1-261124-21",
"ai_download_url": "https://www.pkchecker.com/v1/scan/download?file_id=PK1-261124-21&report_type=ai",
"ai_highlights_url": null,
"completed_at": 1727443320
}
Streams official Turnitin generated PDF reports directly. You can download the Similarity Report or the AI Score Report using the report_type query parameter.
ai_highlights_url is always null, report_type=highlights answers 404, and the ai_highlights option on submit is ignored. Nothing is charged for it. We will announce it here when it goes live.| Parameter | Status | Options & Description |
|---|---|---|
| file_id | Required | The unique scan file identifier (e.g. PK1-261124-21). |
| report_type | Optional |
plagiarism (Default) — Turnitin Similarity & Source Matching PDF report.ai — Turnitin AI Writing percentage PDF report.highlights or ai_highlights — Turnitin AI Highlights Report (full document with the sentences flagged by Turnitin AI highlighted). Under development |
Check available scan credits and account status.
{
"success": true,
"status": "Active",
"available_credits": 14,
"total_credits": 20,
"used_credits": 6
}
Permanently deletes the submitted document and all generated PDF similarity/AI reports from server storage. Call this as soon as your system finishes downloading the report to free up storage. Send file_id as a form field, JSON, or in the query string.
{
"success": true,
"file_id": "PK1-261124-21",
"filename": "thesis.docx",
"status": "Deleted",
"message": "File and generated reports permanently deleted from server storage.",
"deleted_at": 1727443900
}
Automated 48-Hour Storage Purge ACTIVE
To safeguard student research privacy and prevent disk accumulation, PK Checker automatically deletes all completed API files and their PDF reports 48 hours after delivery. If your portal allows end-users to delete files earlier, your backend can call POST /v1/scan/delete to trigger an instant deletion from our storage immediately.
Webhook Realtime Delivery
When Turnitin completes scanning your document, PK Checker delivers an HTTP POST payload with header X-PKChecker-Event: scan.completed (or scan.failed) to your configured Webhook URL:
{
"event": "scan.completed",
"file_id": "PK1-261124-21",
"custom_id": "order_9812",
"status": "Completed",
"similarity_score": 14,
"ai_score": 2,
"word_count": 4850,
"download_url": "https://www.pkchecker.com/v1/scan/download?file_id=PK1-261124-21",
"ai_download_url": "https://www.pkchecker.com/v1/scan/download?file_id=PK1-261124-21&report_type=ai",
"ai_highlights_url": null,
"sent_at": 1727443320
}
Every delivery is signed with your account's signing secret (shown under the Webhook URL above). The header X-PKChecker-Signature: t=1727443320,v1=5f2b… holds the time and an HMAC-SHA256 (hex) of t + "." + raw request body. Compute it with your secret, compare, and reject deliveries older than 5 minutes.
// Node.js (Express): keep the raw body for the signature
import crypto from "node:crypto";
app.post("/api/pkchecker-webhook", express.raw({ type: "application/json" }), (req, res) => {
const [t, v1] = String(req.get("X-PKChecker-Signature") || "").split(",").map((p) => p.split("=")[1]);
const expected = crypto.createHmac("sha256", process.env.PKCHECKER_WEBHOOK_SECRET)
.update(`${t}.${req.body}`).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
if (!v1 || !fresh || !crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected))) return res.sendStatus(400);
const event = JSON.parse(req.body); // event.event, event.file_id, event.custom_id ...
res.sendStatus(200);
});
<?php // PHP
$raw = file_get_contents('php://input');
parse_str(str_replace(',', '&', $_SERVER['HTTP_X_PKCHECKER_SIGNATURE'] ?? ''), $sig);
$expected = hash_hmac('sha256', ($sig['t'] ?? '') . '.' . $raw, getenv('PKCHECKER_WEBHOOK_SECRET'));
if (!hash_equals($expected, $sig['v1'] ?? '') || abs(time() - (int)($sig['t'] ?? 0)) > 300) { http_response_code(400); exit; }
$event = json_decode($raw, true);
http_response_code(200);
Retries: answer with any 2xx status within 10 seconds. Otherwise the same delivery is sent again every 15 minutes, up to 4 tries in total (header X-PKChecker-Delivery holds the file id and the try number). Use file_id to ignore a delivery you already handled.
Integration Snippets
# 1. Submit document for scanning curl -X POST "https://www.pkchecker.com/v1/scan/submit" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@/path/to/thesis.docx" \ -F "service_type=Both" \ -F "exclude_quotes=1" \ -F "exclude_biblio=1" \ -F "exclude_citations=1" \ -F "exclude_small_matches=1" \ -F "small_match_threshold=10" \ -F "custom_id=order_9812" # 2. Check scan status curl -X GET "https://www.pkchecker.com/v1/scan/status?file_id=PK1-261124-21" \ -H "Authorization: Bearer YOUR_API_KEY" # 3. Download the official PDF reports # 3a. Similarity / Plagiarism PDF report curl -X GET "https://www.pkchecker.com/v1/scan/download?file_id=PK1-261124-21" \ -H "Authorization: Bearer YOUR_API_KEY" \ -o "similarity_report.pdf" # 3b. AI Writing PDF report curl -X GET "https://www.pkchecker.com/v1/scan/download?file_id=PK1-261124-21&report_type=ai" \ -H "Authorization: Bearer YOUR_API_KEY" \ -o "ai_report.pdf" # 3c. AI Highlights PDF report (under development: not active yet, answers 404 for now) curl -X GET "https://www.pkchecker.com/v1/scan/download?file_id=PK1-261124-21&report_type=highlights" \ -H "Authorization: Bearer YOUR_API_KEY" \ -o "ai_highlights_report.pdf" # 4. Delete document and reports from storage (Optional: auto-purges after 48h) curl -X POST "https://www.pkchecker.com/v1/scan/delete" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d "file_id=PK1-261124-21"
import time
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://www.pkchecker.com/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1. Submit document
with open("thesis.docx", "rb") as f:
res = requests.post(
f"{BASE_URL}/scan/submit",
headers=HEADERS,
files={"file": f},
data={
"service_type": "Both",
"exclude_quotes": "1",
"exclude_biblio": "1",
"exclude_citations": "1",
"exclude_small_matches": "1",
"small_match_threshold": "10",
"custom_id": "order_9812",
},
).json()
file_id = res["file_id"]
print(f"Submitted successfully! File ID: {file_id}")
# 2. Poll status until completed
while True:
st = requests.get(f"{BASE_URL}/scan/status", headers=HEADERS, params={"file_id": file_id}).json()
if st.get("status") == "Completed":
print(f"Done! Similarity: {st['similarity_score']}%, AI: {st['ai_score']}%")
break
if st.get("status") == "Failed":
print("Scan failed:", st.get("error"))
raise SystemExit(1)
time.sleep(15)
# 3. Download PDF reports
pdf = requests.get(f"{BASE_URL}/scan/download", headers=HEADERS, params={"file_id": file_id})
open("Similarity_Report.pdf", "wb").write(pdf.content)
if st.get("ai_download_url"):
ai = requests.get(f"{BASE_URL}/scan/download", headers=HEADERS, params={"file_id": file_id, "report_type": "ai"})
open("AI_Report.pdf", "wb").write(ai.content)
if st.get("ai_highlights_url"):
hl = requests.get(f"{BASE_URL}/scan/download", headers=HEADERS, params={"file_id": file_id, "report_type": "highlights"})
open("AI_Highlights.pdf", "wb").write(hl.content)
# 4. Delete file from storage (Optional: auto-purged after 48h)
requests.post(f"{BASE_URL}/scan/delete", headers=HEADERS, data={"file_id": file_id})
print("File and reports purged from storage.")
<?php
$apiKey = 'YOUR_API_KEY';
$baseUrl = 'https://www.pkchecker.com/v1';
// 1. Submit document
$ch = curl_init("$baseUrl/scan/submit");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"],
CURLOPT_POSTFIELDS => [
'file' => new CURLFile('/path/to/thesis.docx'),
'service_type' => 'Both',
'exclude_quotes' => '1',
'exclude_biblio' => '1',
'exclude_citations' => '1',
'exclude_small_matches' => '1',
'small_match_threshold' => '10',
'custom_id' => 'order_9812',
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
$fileId = $response['file_id'];
echo "File ID: $fileId" . PHP_EOL;
// 2. Check status (repeat every 15 seconds until "Completed")
$ch = curl_init("$baseUrl/scan/status?file_id=" . urlencode($fileId));
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"]]);
$status = json_decode(curl_exec($ch), true);
curl_close($ch);
// 3. Download the similarity report once finished
if ($status['status'] === 'Completed') {
$fp = fopen('Similarity_Report.pdf', 'w+');
$ch = curl_init("$baseUrl/scan/download?file_id=" . urlencode($fileId));
curl_setopt_array($ch, [CURLOPT_FILE => $fp, CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"]]);
curl_exec($ch);
curl_close($ch);
fclose($fp);
}
// 4. Delete file from storage (Optional: auto-purged after 48h)
$ch = curl_init("$baseUrl/scan/delete");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"],
CURLOPT_POSTFIELDS => ['file_id' => $fileId],
]);
curl_exec($ch);
curl_close($ch);
echo "File purged from storage." . PHP_EOL;
?>
// Node.js 18+ (built-in fetch, FormData and Blob)
import { readFile, writeFile } from "node:fs/promises";
const API_KEY = "YOUR_API_KEY";
const BASE_URL = "https://www.pkchecker.com/v1";
const HEADERS = { Authorization: `Bearer ${API_KEY}` };
async function scanDocument() {
// 1. Submit document
const form = new FormData();
form.append("file", new Blob([await readFile("./thesis.docx")]), "thesis.docx");
form.append("service_type", "Both");
form.append("exclude_quotes", "1");
form.append("exclude_biblio", "1");
form.append("custom_id", "order_9812");
const sub = await (await fetch(`${BASE_URL}/scan/submit`, { method: "POST", headers: HEADERS, body: form })).json();
console.log("Submitted:", sub.file_id);
// 2. Wait for the result
let st;
do {
await new Promise((r) => setTimeout(r, 15000));
st = await (await fetch(`${BASE_URL}/scan/status?file_id=${encodeURIComponent(sub.file_id)}`, { headers: HEADERS })).json();
} while (!["Completed", "Failed"].includes(st.status));
if (st.status === "Failed") throw new Error(st.error);
// 3. Download the similarity PDF (and the AI PDF when there is one)
const pdf = await fetch(`${BASE_URL}/scan/download?file_id=${encodeURIComponent(sub.file_id)}`, { headers: HEADERS });
await writeFile("./similarity_report.pdf", Buffer.from(await pdf.arrayBuffer()));
if (st.ai_download_url) {
const ai = await fetch(st.ai_download_url, { headers: HEADERS });
await writeFile("./ai_report.pdf", Buffer.from(await ai.arrayBuffer()));
}
// 4. Delete file from storage (Optional: auto-purged after 48h)
await fetch(`${BASE_URL}/scan/delete`, {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({ file_id: sub.file_id }),
});
console.log("File purged from storage.");
}
scanDocument();
Interactive Handshake Tester
Test your connection and API key credentials in real-time directly from this console.
// Click "Send Test Request" above to test API handshake.
HTTP Response Status Codes
| Code | Status | Meaning |
|---|---|---|
| 200 | OK | Request processed successfully. |
| 400 | Bad Request | Missing required parameters (e.g., no file or text provided). |
| 401 | Unauthorized | Missing or invalid Bearer API key. |
| 402 | Payment Required | Insufficient scan credits or account expired. |
| 404 | Not Found | Unknown file_id, or the report does not exist. |
| 409 | Conflict | The report is not ready yet, or the file is still being checked. |
| 410 | Gone | The report was deleted (48 hours after delivery, or by /v1/scan/delete). |
| 422 | Unprocessable | The check service did not accept the file. No credit was used. |
| 429 | Rate Limit Exceeded | Too many requests. Standard limit is 60 req/min. |
| 503 | Unavailable | The check service is temporarily unavailable. No credit was used. |
If you face any issue, contact us and we will help!
Whether you are setting up webhooks, need custom rate limits, debugging API responses, or want technical guidance on your integration, we are available to assist you personally.
الدعم الفني
افتح تذكرة وسيردّ عليك فريق الدعم في أقرب وقت