Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »

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. Include the required language code parameter:

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: 

{
  "dataAvailable": false,
  "status": "INITIATED",
  "pageUrl": "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:

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: 

{
  "dataAvailable": false,
  "status": "PROCESSING",
  "pageUrl": "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.

{
  "dataAvailable": true,
  "status": "PROCESSED",
  "pageUrl": "https://www.youtube.com/watch?v=lGOofzZOyl8",
  "uuid": "24433077-1733-44f4-930c-4a2ce4f18173",
  "verityData": {
    "languageCode": "en",
    "iab": {
      "v1": [
        {
          "id": "IAB19",
          "category": "Technology & Computing",
          "score": 0.95
        }
      ],
      "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": [
      "kitten",
      "zoom",
      "filter",
      "court case",
      "stuck",
      "cat",
      "lawyer",
      "court",
      "case",
      "youtube",
      "funny"
    ],
    "safe": true,
    "threats": [
      {
        "id": "GGT2",
        "category": "Criminal",
        "confidence": "MODERATE"
      }
    ],
    "events": [],
    "sentiments": [
      {
        "sentiment": "neutral",
        "score": 1
      },
      {
        "sentiment": "negative",
        "score": 0
      },
      {
        "sentiment": "positive",
        "score": 0
      }
    ],
    "processedAt": "2021-02-10T00:17:55.027Z"
  }
}

More Information

  • No labels