Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Video Endpoints

The Verity video analysis endpoints are:

POST /video/classification

Verity API processes HTTP POST requests to initiate a new video analysis.

GET /video/classification/{uuid}

Verity API processes HTTP GET requests to return processed results.

GET /video/classification/{uuid}/status

Verity API processes HTTP GET requests to return the status of the video analysis.

Example Video Request

This example walks through analyzing an english language video at the URL:

https://www.youtube.com/watch?v=lGOofzZOyl8

Step 1 – Submit a POST video classification request  

To start the video analysis, submit a POST request via curl to /video/classification. Optionally, include the language code parameter:

Code Block
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' -X POST -d '{"url":"https://www.youtube.com/watch?v=lGOofzZOyl8", "languageCode": "en"}'  https://verity-api.gumgum.com/video/classification

Note: The url specified in the body must meet the following requirements:

  • Start with http:// or https://.

  • Have a properly URL-encoded address.

  • Any request parameter values must be properly URL-encoded.

Verity API returns a JSON response with  Content-Type: application/json; charset=UTF-8  showing the request has the following status: 

Code Block
languagejson
{
  "dataAvailable": false,
  "status": "INITIATED",
  "url": "https://www.youtube.com/watch?v=lGOofzZOyl8",
  "uuid": "24433077-1733-44f4-930c-4a2ce4f18173"
}

For a list of supported status messages, refer to Application Status Codes.

Step 2 – GET status of request

Submit a GET request to /video/classification/{uuid}/status, specifying the uuid  returned in the response in Step 1. Within a short period, once analysis of the video is complete, a status change occurs. For example:

Code Block
languagejs
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/video/classification/24433077-1733-44f4-930c-4a2ce4f18173/status

Verity API returns a JSON response with Content-Type: application/json; charset=UTF-8 showing the request has the following status: 

Code Block
languagejson
{
  "dataAvailable": false,
  "status": "PROCESSING",
  "url": "https://www.youtube.com/watch?v=lGOofzZOyl8",
  "uuid": "24433077-1733-44f4-930c-4a2ce4f18173"
}

Step 3 – Get response

Submit a GET request to /video/classification/{uuid}, specifying the uuid returned in the response in step 1. Once the status changes to PROCESSED, the JSON video classification results are returned in the data payload. For example:

curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/video/classification/24433077-1733-44f4-930c-4a2ce4f18173

Example Video JSON Response Body

The JSON response details the complete brand safety, keyword, and categorization analysis data for the video.  See JSON Response for details about the fields included in the response.

Code Block
languagejson
{
  "dataAvailable": true,
  "status": "PROCESSED",
  "pageUrl": "https://www.youtube.com/watch?v=lGOofzZOyl8",
  "uuid": "5698b006-a8d4-4e3c-a1cd-bd6ec4ad22b6",
  "verityData": {
    "processedAt": "2021-05-28T00:28:14.047Z",
    "expiresAt": "2021-06-27T00:28:14.047Z",
    "languageCode": "en",
    "iab": {
      "v2": [
        {
          "id": "424",
          "category": "Cats",
          "score": 0.28,
          "parent": {
            "id": "422",
            "category": "Pets"
          }
        },
        {
          "id": "422",
          "category": "Pets",
          "score": 0.28
        },
        {
          "id": "383",
          "category": "Law",
          "score": 0.2,
          "parent": {
            "id": "379",
            "category": "News and Politics"
          }
        },
        {
          "id": "379",
          "category": "News and Politics",
          "score": 0.2
        }
      ]
    },
    "keywords": [
      "zoom kitten filter",
      "court case",
      "lawyer",
      "cat",
      "youtube"
    ],
    "safe": true,
    "threats": [
      {
        "id": "GGT2",
        "category": "Criminal",
        "confidence": "MODERATE",
        "risk": "MEDIUM"
      }
    ],
    "events": [],
    "sentiments": [
      {
        "sentiment": "neutral",
        "score": 1
      },
      {
        "sentiment": "negative",
        "score": 0
      },
      {
        "sentiment": "positive",
        "score": 0
      }
    ]
  }
}

More Information