POST
/
reports
/
video
import os, requests


# Set API key ENV variable or replace with your own API key
API_KEY = os.getenv("AIORNOT_API_KEY")
VIDEO_ENDPOINT = "https://api.aiornot.com/v1/reports/video"

with open("video.mp4", "rb") as video_file:
    files = {"video": video_file}
    resp = requests.post(
        VIDEO_ENDPOINT, 
        headers={"Authorization": f"Bearer {API_KEY}"},
        files=files,
        # Uncomment below to use only or excluding params.
        # params={
        #   only=['ai_video', 'ai_voice'],
        #   excluding=['ai_music'],
        #}
        timeout=120
    )
    if resp.status_code != 200:
        raise Exception(f"Failed to analyze video: {resp.status_code} {resp.text}")

print(resp.json())
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "report": {
    "ai_video": {
      "is_detected": true,
      "confidence": 0.95
    },
    "ai_voice": {
      "is_detected": true,
      "confidence": 0.95
    },
    "ai_music": {
      "is_detected": true,
      "confidence": 0.95
    },
    "meta": {
      "duration": 120,
      "total_bytes": 362594,
      "md5": "db36d923800f6ca6b7f87cff8a19d1d1",
      "audio": "processed",
      "video": "processed"
    }
  }
}

Authorizations

Authorization
string
header
required

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

Query Parameters

excluding
enum<string>[]

Array of analysis types to exclude. Valid values are ai_video, ai_music, ai_voice.

only
enum<string>[]

Array of analysis types to include. Valid values are ai_video, ai_music, ai_voice.

Body

multipart/form-data

Response

200 - application/json

Successful Response

The response is of type object.