The Verity video analysis endpoints are:
Code Block |
---|
|
POST /video/classification |
Verity API processes HTTP POST requests to initiate a new video analysis.
Code Block |
---|
|
GET /video/classification/{uuid} |
Verity API processes HTTP GET requests to return processed results.
Code Block |
---|
|
GET /video/classification/{uuid}/status |
Verity API processes HTTP GET requests to return the status of the video analysis.
Example Video Request
This example shows a request to analyze an english language video at the URL:
Code Block |
---|
|
http://content.jwplatform.com/videos/00D9qbqJ-320.mp4 |
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:
Code Block |
---|
|
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' -X POST -d '{"url":"http://content.jwplatform.com/videos/00D9qbqJ-320.mp4", "languageCode": "en"}' https://verity-api.gumgum.com/video/classification |
Note: The url specified in the body must meet the following requirements:
...
Verity API returns a JSON response with Content-Type: application/json; charset=UTF-8 showing the request has the following status:
{
Code Block |
---|
|
{
"uuid": "8f72c44b-05c8-4946-8c69-bcc98c655367", |
...
"url": "http://content.jwplatform.com/videos/00D9qbqJ-320.mp4", |
...
"acceptedAt": "2020-04-18T00:43:44.015+0000" |
...
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 |
---|
|
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/video/classification/123e4567-e89b-12d3-a456-426655440000/status |
Verity API returns a JSON response with Content-Type: application/json; charset=UTF-8 showing the request has the following status:
...
"uuid" : "123e4567-e89b-12d3-a456-426655440000", |
...
...
"url": "http://content.jwplatform.com/videos/00D9qbqJ-320.mp4" |
...
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 page classification results are returned in the data payload. For example:
Code Block |
---|
|
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/video/classification/123e4567-e89b-12d3-a456-426655440000 |
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 |
---|
|
"uuid": "ccc71550-88e9-4ff2-9b46-fc204610e613", |
...
"url": "http://content.jwplatform.com/videos/00D9qbqJ-320.mp4", |
...
...
...
...
...
...
...
...
...
...
...
...
"category": "Ice Hockey", |
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
"the toronto maple leafs", |
...
"marta gebre selassie's", |
...
...
"the carolina hurricanes" |
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
"processedAt": "2020-10-01T01:39:10.836Z" |
...
...