Documentation menu

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

idstringrequired

The task ID returned when the task was created.

Example:
0f8e3c52-6d1a-4b7e-9c2f-5a1b3d4e6f70

Header Params

Authorizationstringrequired

Bearer followed by any active API key of the account that created the task.

Example:
Bearer sk_…

Responses

StatusMeaning
200The task in its current state — the same object as when it was created (fields). Queries are free.
401invalid_api_key: missing, malformed or revoked key.
404prediction_not_found: no such task in this account.
429rate_limited: wait for the Retry-After seconds, then query again.
503temporarily_unavailable: query again shortly.

Task statuses

statusFinalMeaningoutputerror
waitingNoAccepted, not started yetnullnull
processingNoDetection is runningnullnull
succeededYesThe result is readyobjectnull
failedYesThe task could not finish; its credit is returnednullobject

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 status is "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 in Retry-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'

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"
  }
}