Skip to main content
POST
/
v2
/
image
/
sync
Python
import os, requests


# Set API key ENV variable or replace with your own API key
API_KEY=os.getenv("AIORNOT_API_KEY")
IMAGE_ENDPOINT = "https://api.aiornot.com/v2/image/sync"

# By default, ai_generated, deepfake, nsfw, and quality reports run.
# Use 'only' and 'excluding' parameters to select subsets.
# Note: ai_generated and deepfake have their own costs.

with open("image.jpeg", "rb") as f:
    resp = requests.post(
        IMAGE_ENDPOINT,
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"image": f},
        params={
            "external_id": "my-tracking-id"  # Optional
            # Example: only run reverse_search:
            # "only": ["reverse_search"]
            # Example: run all defaults except deepfake:
            # "excluding": ["deepfake"]
        }
    )
    resp.raise_for_status()
    print(resp.json())
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "report": {
    "meta": {
      "width": 640,
      "height": 480,
      "format": "jpeg",
      "size_bytes": 102400,
      "md5": "a1b2c3d4e5f6789012345678901234567",
      "processing_status": {
        "ai_generated": "processed",
        "deepfake": "processed",
        "nsfw": "processed",
        "quality": "processed"
      }
    },
    "ai_generated": {
      "verdict": "ai",
      "ai": {
        "is_detected": true,
        "confidence": 0.95
      },
      "human": {
        "is_detected": false,
        "confidence": 0.05
      },
      "generator": {
        "midjourney": 0.95,
        "dall_e": 0.95,
        "stable_diffusion": 0.95,
        "this_person_does_not_exist": 0.95,
        "adobe_firefly": 0.95,
        "flux": 0.95,
        "four_o": 0.95
      }
    },
    "deepfake": {
      "is_detected": true,
      "confidence": 0.95,
      "rois": [
        {
          "is_detected": true,
          "confidence": 0.95,
          "bbox": {
            "x1": 120,
            "y1": 85,
            "x2": 380,
            "y2": 295
          }
        }
      ]
    },
    "nsfw": {
      "is_detected": true,
      "version": "1.0.0"
    },
    "quality": {
      "is_detected": true
    },
    "reverse_search": {
      "was_found": true,
      "matches": [
        {
          "domain": "cnet.com",
          "image_url": "https://img.tineye.com/result/59752e592ddca832cb36bf200135b4f30f6fadca2ea4acc7c63f8dd231463c72-43",
          "width": 196,
          "height": 147,
          "earliest_crawl_date": "2021-03-26",
          "earliest_backlink": "https://www.cnet.com/topics/internet-culture/2/"
        }
      ]
    }
  },
  "created_at": "2023-11-07T05:31:56Z",
  "external_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.aiornot.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Your API key as the Bearer token in the Authorization header.

Query Parameters

only
enum<string>[]

Array of analysis types to include. Valid values are ai_generated, deepfake, nsfw, quality, reverse_search.

Available options:
ai_generated,
deepfake,
nsfw,
quality,
reverse_search
excluding
enum<string>[]

Array of analysis types to exclude. Valid values are ai_generated, deepfake, nsfw, quality, reverse_search.

Available options:
ai_generated,
deepfake,
nsfw,
quality,
reverse_search
external_id
string | null

An optional external identifier for tracking this image analysis.

Body

multipart/form-data
image
file
required

The image file to analyze.

  • Supported formats: jpg, jpeg, png, webp, heic, heif, tiff.
  • Max file size: 10MB

Response

Successful Response

id
string<uuid>
required

Unique identifier associated with the request.

report
object
required
created_at
string<date-time>

Date and time of request processing.

external_id
string | null

The external identifier provided in the request, if any.