You can classify a video either from a file or a URL.
This section explains how to make a request using a file. For a URL, the process is similar, with the main difference being the endpoint to call in step 1.

1. Send a POST request

To classify a video, you need to make a POST request to /api/classification_video with the required parameters (for details on the parameters, refer to the API Reference section).

curl --request POST \
  --url https://backend.identifai.net/api/classification_video \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-Api-Key: <api-key>' \
  --form "video=@/path/to/sample.mp4" \
  --form frames=5 \
  --form with_llm=false \
  --form with_morphing=true

In the response you will receive the hash of the classified video.

2. Retrieve the results

Use the provided hash to retrieve the classification results by making a GET request to /api/classification_video/{hash} (for details on how to structure this request, see the API Reference section).

curl --request GET \
  --url https://backend.identifai.net/api/classification_video/{hash} \
  --header 'X-Api-Key: <api-key>'

The response will provide the classification results for the video in JSON format. For video classification, the video is divided into frames. In the response, you will find a results array that includes the classification outcomes for each model applied to each analyzed frame, and a verdicts array containing the results for each heuristic used.

The classification may not be finished yet! If the classification is not yet complete, continue sending the GET request until the result is available.

See also