POST
/
v2
/
text
/
sync
Python
import os, requests


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

data = {
    "text": "Your text content to analyze goes here..."
}

resp = requests.post(
    TEXT_ENDPOINT,
    headers={"Authorization": f"Bearer {API_KEY}"},
    data=data,
    params={
        "include_annotations": True,  # Optional: Include block-level annotations
        "external_id": "my-tracking-id"  # Optional: External tracking ID
    }
)
resp.raise_for_status()
print(resp.json())
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "report": {
    "ai_text": {
      "confidence": 0.95,
      "is_detected": true,
      "annotations": [
        [
          "This is the first block of text.",
          0.9999
        ],
        [
          "This is the second block of text.",
          0.0012
        ]
      ]
    }
  },
  "metadata": {
    "word_count": 150,
    "character_count": 750,
    "token_count": 200,
    "md5": "ebe5836f4d7dddc3f9a957eff565be21"
  },
  "external_id": "<string>"
}

Authorizations

Authorization
string
header
required

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

Query Parameters

external_id
string | null

An optional external identifier for tracking this text analysis

include_annotations
boolean
default:false

Include block-level AI detection annotations in the response

Body

application/x-www-form-urlencoded

Response

200
application/json

Successful Response

The response is of type object.