DocxDetect API Documentation
Overview
DocxDetect API allows users to detect AI-generated content and similarity in documents via API. The API uses API Key for authentication, no JWT Token required.
Base URL: https://api.docxturnitin.com
Authentication
All API requests require an API Key in the HTTP Header:
X-API-Key: your_api_key_here
Getting Your API Key
Please contact [email protected]
API Endpoints
1. Upload Document
Upload the document to be detected.
Request:
POST /docxdetect/uploadDucument
Header
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-API-Key | string | Yes | User's API Key |
Body (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| uploadFile | file | Yes | Document file to detect |
File Limitations
- File size: 300 bytes ~ 30 MB
- Supported formats: PDF, DOC, DOCX, etc.
Response
Success Response:
{
"code": 0,
"data": {
"sessionId": "docx-12345-2024-01-08"
},
"msg": "success"
}
Error Response:
{
"code": -1,
"msg": "The file you submit cannot be larger than 30MB."
}
Error Codes
| code | Description |
|---|---|
| 0 | Success |
| -1 | Request error (file too large/small/missing, upload failed, etc.) |
| -2 | Insufficient credits, subscription required |
2. Start Detection
Start the detection process for the uploaded document. Starting detection deducts 5 detection credits (3 for AI detection + 2 for similarity detection).
Request:
POST /docxdetect/checkDucument
Header
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-API-Key | string | Yes | User's API Key |
Body (application/json)
{
"sessionid": "docx-12345-2024-01-08"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| sessionid | string | Yes | sessionId returned when uploading document |
Response
Success Response:
{
"code": 0,
"msg": "success"
}
Error Response:
{
"code": -1,
"msg": "This document is already being checked"
}
Error Codes
| code | Description |
|---|---|
| 0 | Success |
| -1 | Document not found / already being checked / already checked / failed to start detection |
| -2 | Insufficient credits, subscription required |
3. Get Detection Result
Get document detection results by sessionId. This endpoint supports long polling, waiting up to 1 hour until detection completes or fails.
Request:
GET /docxdetect/getResult?sessionid={sessionid}Header
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-API-Key | string | Yes | User's API Key |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| sessionid | string | Yes | sessionId returned when uploading document |
Response
Success Response (Detection Complete):
{
"code": 0,
"data": {
"cstatus": 2,
"aifile": "https://docxturnitin.com/td-document/1776469920579239031_ai.pdf",
"rifile": "https://docxturnitin.com/td-document/1776469920743481204_ri.pdf",
"checkerr": "",
"filename": "MCV4U_Unit_2_Assignment_Linear_Dependence_and_Coplanarity.pdf"
},
"msg": "success"
}
In Progress Response (Timeout):
{
"code": 0,
"data": {
"cstatus": 1,
"aifile": "",
"rifile": "",
"checkerr": "",
"filename": "MCV4U_Unit_2_Assignment_Linear_Dependence_and_Coplanarity.pdf"
},
"msg": "success"
}
Detection Failed Response:
{
"code": 0,
"data": {
"cstatus": 9,
"aifile": "",
"rifile": "",
"checkerr": "check timeout",
"filename": "MCV4U_Unit_2_Assignment_Linear_Dependence_and_Coplanarity.pdf"
},
"msg": "success"
}
cstatus Status Description
| Value | Description |
|---|---|
| 1 | Detecting |
| 2 | Detection Successful |
| 9 | Detection Failed |
Field Description
| Field | Type | Description |
|---|---|---|
| cstatus | int | Detection status: 1-detecting 2-success 9-failed |
| aifile | string | Full URL of AI detection report, returned when detection is successful |
| rifile | string | Full URL of similarity detection report, returned when detection is successful |
| checkerr | string | Error message, contains error description when detection fails |
| filename | string | Original filename |
Error Codes
| code | Description |
|---|---|
| 0 | Success |
| -1 | Document not found / sessionid missing |
Complete Workflow
1. Upload Document
POST /docxdetect/uploadDucument
→ Get sessionId
2. Start Detection
POST /docxdetect/checkDucument
Body: {"sessionid": "xxx"}
3. Get Result (Long polling, max 1 hour)
GET /docxdetect/getResult?sessionid=xxx
→ Wait for cstatus to become 2 (success) or 9 (failed)
Code Examples
cURL
# 1. Upload Document
curl -X POST https://docxturnitin.com/docxdetect/uploadDucument \
-H "X-API-Key: your_api_key_here" \
-F "uploadFile=@/path/to/document.pdf"
# 2. Start Detection
curl -X POST https://docxturnitin.com/docxdetect/checkDucument \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"sessionid": "docx-12345-2024-01-08"}'
# 3. Get Result
curl -X GET "https://docxturnitin.com/docxdetect/getResult?sessionid=docx-12345-2024-01-08" \
-H "X-API-Key: your_api_key_here"
Python
import requests
import time
API_KEY = "your_api_key_here"
BASE_URL = "https://docxturnitin.com"
HEADERS = {"X-API-Key": API_KEY}
# 1. Upload Document
with open("document.pdf", "rb") as f:
resp = requests.post(
f"{BASE_URL}/docxdetect/uploadDucument",
headers=HEADERS,
files={"uploadFile": f}
)
data = resp.json()
if data["code"] != 0:
print(f"Upload failed: {data['msg']}")
exit(1)
session_id = data["data"]["sessionId"]
print(f"Upload success, sessionId: {session_id}")
# 2. Start Detection
resp = requests.post(
f"{BASE_URL}/docxdetect/checkDucument",
headers={**HEADERS, "Content-Type": "application/json"},
json={"sessionid": session_id}
)
data = resp.json()
if data["code"] != 0:
print(f"Check failed: {data['msg']}")
exit(1)
print("Check started")
# 3. Get Result (Long polling)
resp = requests.get(
f"{BASE_URL}/docxdetect/getResult",
headers=HEADERS,
params={"sessionid": session_id},
timeout=3600
)
result = resp.json()
print(f"Status: {result['data']['cstatus']}")
print(f"AI Report: {result['data']['aifile']}")
print(f"Similarity Report: {result['data']['rifile']}")
Differences from Web TuiCheck API
| Feature | Web TuiCheck | API DocxDetect |
|---|---|---|
| Authentication | JWT Token (x-token header) | API Key (X-API-Key header) |
| Subscription Credit Check | Yes | Yes |
| 24h Upload Limit | 10/30 times | No |
| MD5 Duplicate Check | Yes | No |
| Credit Deduction | Yes | Yes (5 credits per detection) |
| Get Result Method | Polling getDucumentInfo | Long polling getResult (max 1 hour) |
| Return File URL | Relative path | Full URL (https://docxturnitin.com/...) |
| Route Prefix | /tuicheck | /docxdetect |