Get task details
Last updated: 2026-10-22
Returns a task in its current state. After creating a task, query it with its ID until status is "succeeded" or "failed".
Request
GET https://api.nsfwcheckapi.com/v1/predictions/{id}
Path Params
idstringrequiredThe task ID returned when the task was created.
- Example:
- 0f8e3c52-6d1a-4b7e-9c2f-5a1b3d4e6f70
Header Params
AuthorizationstringrequiredBearer followed by any active API key of the account that created the task.
- Example:
- Bearer sk_…
Responses
| Status | Meaning |
|---|---|
200 | The task in its current state — the same object as when it was created (fields). Queries are free. |
401 | invalid_api_key: missing, malformed or revoked key. |
404 | prediction_not_found: no such task in this account. |
429 | rate_limited: wait for the Retry-After seconds, then query again. |
503 | temporarily_unavailable: query again shortly. |
Task statuses
status | Final | Meaning | output | error |
|---|---|---|---|---|
waiting | No | Accepted, not started yet | null | null |
processing | No | Detection is running | null | null |
succeeded | Yes | The result is ready | object | null |
failed | Yes | The task could not finish; its credit is returned | null | object |
A task that has not started within 10 minutes, or not finished within 20 minutes of submission, fails with processing_timeout. Final statuses never change: querying a finished task again returns the same result.
Polling
- Query every 1–2 seconds while
statusis"waiting"or"processing", and stop at"succeeded"or"failed". - Each task allows 3 queries per second and each account 150 per second. On
429, wait for the seconds inRetry-After. - Keep the task ID: it is the only way to read the result, and every task also appears in your task history.
Code examples
Request
curl 'https://api.nsfwcheckapi.com/v1/predictions/0f8e3c52-6d1a-4b7e-9c2f-5a1b3d4e6f70' \
-H 'Authorization: Bearer YOUR_API_KEY'
import requests
response = requests.get(
"https://api.nsfwcheckapi.com/v1/predictions/0f8e3c52-6d1a-4b7e-9c2f-5a1b3d4e6f70",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
task = response.json()
print(task["status"], task["output"])
const response = await fetch(
'https://api.nsfwcheckapi.com/v1/predictions/0f8e3c52-6d1a-4b7e-9c2f-5a1b3d4e6f70',
{ headers: { Authorization: 'Bearer YOUR_API_KEY' } }
);
const task = await response.json();
console.log(task.status, task.output);
Response
200 OK, task succeeded:
{
"id": "0f8e3c52-6d1a-4b7e-9c2f-5a1b3d4e6f70",
"model": "general",
"status": "succeeded",
"policy": { "sensitivity": "standard" },
"model_version": "general-2026-08",
"output": {
"level": "L1",
"probabilities": { "L1": 0.94, "L2": 0.04, "L3": 0.01, "L4": 0.01 },
"is_nsfw": false
},
"error": null,
"created_at": "2026-10-22T08:30:00.000Z",
"started_at": "2026-10-22T08:30:00.412Z",
"completed_at": "2026-10-22T08:30:01.268Z",
"urls": {
"get": "https://api.nsfwcheckapi.com/v1/predictions/0f8e3c52-6d1a-4b7e-9c2f-5a1b3d4e6f70"
}
}
200 OK, task failed:
{
"id": "0f8e3c52-6d1a-4b7e-9c2f-5a1b3d4e6f70",
"model": "general",
"status": "failed",
"policy": { "sensitivity": "standard" },
"model_version": null,
"output": null,
"error": {
"code": "invalid_image",
"message": "The image or its URL could not be processed."
},
"created_at": "2026-10-22T08:30:00.000Z",
"started_at": "2026-10-22T08:30:00.412Z",
"completed_at": "2026-10-22T08:30:00.903Z",
"urls": {
"get": "https://api.nsfwcheckapi.com/v1/predictions/0f8e3c52-6d1a-4b7e-9c2f-5a1b3d4e6f70"
}
}