Cloud Vision API
  1. projects
Cloud Vision API
  • files
    • /v1p2beta1/files:annotate
      POST
    • /v1p2beta1/files:asyncBatchAnnotate
      POST
  • images
    • /v1p2beta1/images:annotate
      POST
    • /v1p2beta1/images:asyncBatchAnnotate
      POST
  • projects
    • /v1p2beta1/{parent}/files:annotate
      POST
    • /v1p2beta1/{parent}/files:asyncBatchAnnotate
      POST
    • /v1p2beta1/{parent}/images:annotate
      POST
    • /v1p2beta1/{parent}/images:asyncBatchAnnotate
      POST
  1. projects

/v1p2beta1/{parent}/images:annotate

POST
/v1p2beta1/{parent}/images:annotate
projects
Run image detection and annotation for a batch of images.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://vision.googleapis.com//v1p2beta1//images:annotate' \
--header 'Content-Type: application/json' \
--data-raw '{
    "parent": "string",
    "requests": [
        {
            "features": [
                {
                    "maxResults": 0,
                    "model": "string",
                    "type": "TYPE_UNSPECIFIED"
                }
            ],
            "image": {
                "content": "string",
                "source": {
                    "gcsImageUri": "string",
                    "imageUri": "string"
                }
            },
            "imageContext": {
                "cropHintsParams": {
                    "aspectRatios": [
                        0
                    ]
                },
                "languageHints": [
                    "string"
                ],
                "latLongRect": {
                    "maxLatLng": {
                        "latitude": 0,
                        "longitude": 0
                    },
                    "minLatLng": {
                        "latitude": 0,
                        "longitude": 0
                    }
                },
                "productSearchParams": {
                    "boundingPoly": {
                        "normalizedVertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ],
                        "vertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ]
                    },
                    "filter": "string",
                    "productCategories": [
                        "string"
                    ],
                    "productSet": "string"
                },
                "textDetectionParams": {
                    "advancedOcrOptions": [
                        "string"
                    ],
                    "enableTextDetectionConfidenceScore": true
                },
                "webDetectionParams": {
                    "includeGeoResults": true
                }
            }
        }
    ]
}'
Response Response Example
{
    "responses": [
        {
            "context": {
                "pageNumber": 0,
                "uri": "string"
            },
            "cropHintsAnnotation": {
                "cropHints": [
                    {
                        "boundingPoly": {
                            "normalizedVertices": [
                                {
                                    "x": 0,
                                    "y": 0
                                }
                            ],
                            "vertices": [
                                {
                                    "x": 0,
                                    "y": 0
                                }
                            ]
                        },
                        "confidence": 0,
                        "importanceFraction": 0
                    }
                ]
            },
            "error": {
                "code": 0,
                "details": [
                    {
                        "property1": null,
                        "property2": null
                    }
                ],
                "message": "string"
            },
            "faceAnnotations": [
                {
                    "angerLikelihood": "UNKNOWN",
                    "blurredLikelihood": "UNKNOWN",
                    "boundingPoly": {
                        "normalizedVertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ],
                        "vertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ]
                    },
                    "detectionConfidence": 0,
                    "fdBoundingPoly": {
                        "normalizedVertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ],
                        "vertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ]
                    },
                    "headwearLikelihood": "UNKNOWN",
                    "joyLikelihood": "UNKNOWN",
                    "landmarkingConfidence": 0,
                    "landmarks": [
                        {
                            "position": {
                                "x": 0,
                                "y": 0,
                                "z": 0
                            },
                            "type": "UNKNOWN_LANDMARK"
                        }
                    ],
                    "panAngle": 0,
                    "rollAngle": 0,
                    "sorrowLikelihood": "UNKNOWN",
                    "surpriseLikelihood": "UNKNOWN",
                    "tiltAngle": 0,
                    "underExposedLikelihood": "UNKNOWN"
                }
            ],
            "fullTextAnnotation": {
                "pages": [
                    {
                        "blocks": [
                            {
                                "blockType": "UNKNOWN",
                                "boundingBox": {
                                    "normalizedVertices": [
                                        {
                                            "x": 0,
                                            "y": 0
                                        }
                                    ],
                                    "vertices": [
                                        {
                                            "x": 0,
                                            "y": 0
                                        }
                                    ]
                                },
                                "confidence": 0,
                                "paragraphs": [
                                    {
                                        "boundingBox": {
                                            "normalizedVertices": [
                                                {
                                                    "x": 0,
                                                    "y": 0
                                                }
                                            ],
                                            "vertices": [
                                                {
                                                    "x": 0,
                                                    "y": 0
                                                }
                                            ]
                                        },
                                        "confidence": 0,
                                        "property": {
                                            "detectedBreak": {
                                                "isPrefix": true,
                                                "type": "UNKNOWN"
                                            },
                                            "detectedLanguages": [
                                                {
                                                    "confidence": 0,
                                                    "languageCode": "string"
                                                }
                                            ]
                                        },
                                        "words": [
                                            {
                                                "boundingBox": {
                                                    "normalizedVertices": [
                                                        {}
                                                    ],
                                                    "vertices": [
                                                        {}
                                                    ]
                                                },
                                                "confidence": 0,
                                                "property": {
                                                    "detectedBreak": {
                                                        "isPrefix": true,
                                                        "type": "UNKNOWN"
                                                    },
                                                    "detectedLanguages": [
                                                        {}
                                                    ]
                                                },
                                                "symbols": [
                                                    {
                                                        "boundingBox": {
                                                            "normalizedVertices": [],
                                                            "vertices": []
                                                        },
                                                        "confidence": 0,
                                                        "property": {
                                                            "detectedLanguages": []
                                                        },
                                                        "text": "string"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ],
                                "property": {
                                    "detectedBreak": {
                                        "isPrefix": true,
                                        "type": "UNKNOWN"
                                    },
                                    "detectedLanguages": [
                                        {
                                            "confidence": 0,
                                            "languageCode": "string"
                                        }
                                    ]
                                }
                            }
                        ],
                        "confidence": 0,
                        "height": 0,
                        "property": {
                            "detectedBreak": {
                                "isPrefix": true,
                                "type": "UNKNOWN"
                            },
                            "detectedLanguages": [
                                {
                                    "confidence": 0,
                                    "languageCode": "string"
                                }
                            ]
                        },
                        "width": 0
                    }
                ],
                "text": "string"
            },
            "imagePropertiesAnnotation": {
                "dominantColors": {
                    "colors": [
                        {
                            "color": {},
                            "pixelFraction": 0,
                            "score": 0
                        }
                    ]
                }
            },
            "labelAnnotations": [
                {
                    "boundingPoly": {
                        "normalizedVertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ],
                        "vertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ]
                    },
                    "confidence": 0,
                    "description": "string",
                    "locale": "string",
                    "locations": [
                        {
                            "latLng": {
                                "latitude": 0,
                                "longitude": 0
                            }
                        }
                    ],
                    "mid": "string",
                    "properties": [
                        {
                            "name": "string",
                            "uint64Value": "string",
                            "value": "string"
                        }
                    ],
                    "score": 0,
                    "topicality": 0
                }
            ],
            "landmarkAnnotations": [
                {
                    "boundingPoly": {
                        "normalizedVertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ],
                        "vertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ]
                    },
                    "confidence": 0,
                    "description": "string",
                    "locale": "string",
                    "locations": [
                        {
                            "latLng": {
                                "latitude": 0,
                                "longitude": 0
                            }
                        }
                    ],
                    "mid": "string",
                    "properties": [
                        {
                            "name": "string",
                            "uint64Value": "string",
                            "value": "string"
                        }
                    ],
                    "score": 0,
                    "topicality": 0
                }
            ],
            "localizedObjectAnnotations": [
                {
                    "boundingPoly": {
                        "normalizedVertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ],
                        "vertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ]
                    },
                    "languageCode": "string",
                    "mid": "string",
                    "name": "string",
                    "score": 0
                }
            ],
            "logoAnnotations": [
                {
                    "boundingPoly": {
                        "normalizedVertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ],
                        "vertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ]
                    },
                    "confidence": 0,
                    "description": "string",
                    "locale": "string",
                    "locations": [
                        {
                            "latLng": {
                                "latitude": 0,
                                "longitude": 0
                            }
                        }
                    ],
                    "mid": "string",
                    "properties": [
                        {
                            "name": "string",
                            "uint64Value": "string",
                            "value": "string"
                        }
                    ],
                    "score": 0,
                    "topicality": 0
                }
            ],
            "productSearchResults": {
                "indexTime": "string",
                "productGroupedResults": [
                    {
                        "boundingPoly": {
                            "normalizedVertices": [
                                {
                                    "x": 0,
                                    "y": 0
                                }
                            ],
                            "vertices": [
                                {
                                    "x": 0,
                                    "y": 0
                                }
                            ]
                        },
                        "objectAnnotations": [
                            {
                                "languageCode": "string",
                                "mid": "string",
                                "name": "string",
                                "score": 0
                            }
                        ],
                        "results": [
                            {
                                "image": "string",
                                "product": {
                                    "description": "string",
                                    "displayName": "string",
                                    "name": "string",
                                    "productCategory": "string",
                                    "productLabels": [
                                        {
                                            "key": "string",
                                            "value": "string"
                                        }
                                    ]
                                },
                                "score": 0
                            }
                        ]
                    }
                ],
                "results": [
                    {
                        "image": "string",
                        "product": {
                            "description": "string",
                            "displayName": "string",
                            "name": "string",
                            "productCategory": "string",
                            "productLabels": [
                                {
                                    "key": "string",
                                    "value": "string"
                                }
                            ]
                        },
                        "score": 0
                    }
                ]
            },
            "safeSearchAnnotation": {
                "adult": "UNKNOWN",
                "medical": "UNKNOWN",
                "racy": "UNKNOWN",
                "spoof": "UNKNOWN",
                "violence": "UNKNOWN"
            },
            "textAnnotations": [
                {
                    "boundingPoly": {
                        "normalizedVertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ],
                        "vertices": [
                            {
                                "x": 0,
                                "y": 0
                            }
                        ]
                    },
                    "confidence": 0,
                    "description": "string",
                    "locale": "string",
                    "locations": [
                        {
                            "latLng": {
                                "latitude": 0,
                                "longitude": 0
                            }
                        }
                    ],
                    "mid": "string",
                    "properties": [
                        {
                            "name": "string",
                            "uint64Value": "string",
                            "value": "string"
                        }
                    ],
                    "score": 0,
                    "topicality": 0
                }
            ],
            "webDetection": {
                "bestGuessLabels": [
                    {
                        "label": "string",
                        "languageCode": "string"
                    }
                ],
                "fullMatchingImages": [
                    {
                        "score": 0,
                        "url": "string"
                    }
                ],
                "pagesWithMatchingImages": [
                    {
                        "fullMatchingImages": [
                            {
                                "score": 0,
                                "url": "string"
                            }
                        ],
                        "pageTitle": "string",
                        "partialMatchingImages": [
                            {
                                "score": 0,
                                "url": "string"
                            }
                        ],
                        "score": 0,
                        "url": "string"
                    }
                ],
                "partialMatchingImages": [
                    {
                        "score": 0,
                        "url": "string"
                    }
                ],
                "visuallySimilarImages": [
                    {
                        "score": 0,
                        "url": "string"
                    }
                ],
                "webEntities": [
                    {
                        "description": "string",
                        "entityId": "string",
                        "score": 0
                    }
                ]
            }
        }
    ]
}

Request

Path Params
parent
string 
required
Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
Body Params application/json
Multiple image annotation requests are batched into a single service call.
parent
string 
optional
Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
requests
array[object (GoogleCloudVisionV1p2beta1AnnotateImageRequest) {3}] 
optional
Required. Individual image annotation requests for this batch.
features
array[object (GoogleCloudVisionV1p2beta1Feature) {3}] 
optional
Requested features.
image
object (GoogleCloudVisionV1p2beta1Image) 
optional
The image to be processed.
imageContext
object (GoogleCloudVisionV1p2beta1ImageContext) 
optional
Additional context that may accompany the image.
Examples

Responses

🟢200Successful response
application/json
Body
Response to a batch image annotation request.
responses
array[object (GoogleCloudVisionV1p2beta1AnnotateImageResponse) {14}] 
optional
Individual responses to image annotation requests within the batch.
context
object (GoogleCloudVisionV1p2beta1ImageAnnotationContext) 
optional
If present, contextual information is needed to understand where this image comes from.
cropHintsAnnotation
object (GoogleCloudVisionV1p2beta1CropHintsAnnotation) 
optional
If present, crop hints have completed successfully.
error
object (Status) 
optional
If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be correct, even when error is set.
faceAnnotations
array[object (GoogleCloudVisionV1p2beta1FaceAnnotation) {15}] 
optional
If present, face detection has completed successfully.
fullTextAnnotation
object (GoogleCloudVisionV1p2beta1TextAnnotation) 
optional
If present, text (OCR) detection or document (OCR) text detection has completed successfully. This annotation provides the structural hierarchy for the OCR detected text.
imagePropertiesAnnotation
object (GoogleCloudVisionV1p2beta1ImageProperties) 
optional
If present, image properties were extracted successfully.
labelAnnotations
array[object (GoogleCloudVisionV1p2beta1EntityAnnotation) {9}] 
optional
If present, label detection has completed successfully.
landmarkAnnotations
array[object (GoogleCloudVisionV1p2beta1EntityAnnotation) {9}] 
optional
If present, landmark detection has completed successfully.
localizedObjectAnnotations
array[object (GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation) {5}] 
optional
If present, localized object detection has completed successfully. This will be sorted descending by confidence score.
logoAnnotations
array[object (GoogleCloudVisionV1p2beta1EntityAnnotation) {9}] 
optional
If present, logo detection has completed successfully.
productSearchResults
object (GoogleCloudVisionV1p2beta1ProductSearchResults) 
optional
If present, product search has completed successfully.
safeSearchAnnotation
object (GoogleCloudVisionV1p2beta1SafeSearchAnnotation) 
optional
If present, safe-search annotation has completed successfully.
textAnnotations
array[object (GoogleCloudVisionV1p2beta1EntityAnnotation) {9}] 
optional
If present, text (OCR) detection has completed successfully.
webDetection
object (GoogleCloudVisionV1p2beta1WebDetection) 
optional
If present, web detection has completed successfully.
Modified at 2023-08-15 09:10:12
Previous
/v1p2beta1/{parent}/files:asyncBatchAnnotate
Next
/v1p2beta1/{parent}/images:asyncBatchAnnotate
Built with