Image URL Requirements
In the POST image/classification endpoint, you’ll specify the URL of an individual image for analysis. The URL specified in <IMAGE_URL> 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.
Example Image Request
This example shows a request to analyze the following image URL:
https://media3.s-nbcnews.com/j/newscms/2020_18/2724881/190122-handguns-new-york-cs-1005a_ae30ba7e5164f948822ba8d42c3db791.fit-1240w.jpg
Step 1 – Submit a POST request via curl to /image/classification
Submit an analysis request specifying . Specify an individual image URL.
-H ' -X POST "https://verity-api.gumgum.com/image/classification" -H "accept: */*" -H "x-api-key: |
<YOUR_API_KEY_HERE>' ' "Content-Type: application/json |
' -X POST ;charset=UTF-8" -d "{\"url\": \"https:// |
verityapigumgum/classification/upload/t_fit-1240w,f_auto,q_auto:best/newscms/2020_18/2724881/190122-handguns-new-york-cs-1005a.jpg\"}" |
Verity API returns a JSON response with Content-Type: application/json; charset=UTF-8 showing showing a uuid for the request and current request status, for example:
Code Block |
---|
|
{
"uuid": "c7bcbe04-ea77-4808-8e91-28d325d1b1fc",
"acceptedAturl": "https://media3.s-nbcnews.com/j/newscms/2020-06-25T23:09:41.729Z"
} |
{
"uuid": "c7bcbe04-ea77-4808-8e91-28d325d1b1fc",
_18/2724881/190122-handguns-new-york-cs-1005a_ae30ba7e5164f948822ba8d42c3db791.fit-1240w.jpg",
"acceptedAt": " |
202025T230941729ZFor a list of supported status messages, refer to Application Status Codes.
Step 2 – Submit a GET request to /image/classification/{uuid}/status
Submit a GET request to /image/classification/{uuid}/status specifying the uuid returned in the previous step. Within a short period, once analysis of the image is complete, a status change occurs. For example:
Code Block |
---|
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/image/classification/c7bcbe04-ea77-4808-8e91-28d325d1b1fc/status |
Verity API returns a JSON response with Content-Type: application/json; charset=UTF-8 showing the request has the following status:
"uuid" : "c7bcbe04-ea77-4808-8e91-28d325d1b1fc", |
Step 3 – Submit a GET request to /image/classification/{uuid}
Submit a GET request to /image/classification/{uuid} , specifying the uuid returned in the response during Step 1. Within a short period, once analysis of the image is complete, a status change occurs. For example:
Code Block |
---|
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/image/classification/ |
123e4567e89b12d3a456-426655440000Example Image JSON Response Body
The JSON response details the complete brand safety, keyword, and categorization analysis data for the image. See JSON Response for details about the fields included in the response.
6998e629ed074f0e94a47a684238a313
"url": "https://media3.s-nbcnews.com/j/newscms/2020_18/2724881/190122-handguns-new-york-cs-1005a_ae30ba7e5164f948822ba8d42c3db791.fit-1240w.jpg", |
{ {
"processedAt": "2021-05-28T00:28:36.472Z",
"expiresAt": "2021-06-11T00:28:36.472Z",
"keywords": |
[ "fitness_and_exercise"
],
[ {
"category": "Violence and gore", |
"confidence": "VERY_HIGH" |
}
],
"processedAt": "2020-09-29T22:34:10.143Z"
}
}