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:asyncBatchAnnotate

POST
/v1p2beta1/{parent}/images:asyncBatchAnnotate
projects
Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the google.longrunning.Operations interface. Operation.metadata contains OperationMetadata (metadata). Operation.response contains AsyncBatchAnnotateImagesResponse (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://vision.googleapis.com//v1p2beta1//images:asyncBatchAnnotate' \
--header 'Content-Type: application/json' \
--data-raw '{
    "outputConfig": {
        "batchSize": 0,
        "gcsDestination": {
            "uri": "string"
        }
    },
    "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
{
    "done": true,
    "error": {
        "code": 0,
        "details": [
            {
                "property1": null,
                "property2": null
            }
        ],
        "message": "string"
    },
    "metadata": {
        "property1": null,
        "property2": null
    },
    "name": "string",
    "response": {
        "property1": null,
        "property2": null
    }
}

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
Request for async image annotation for a list of images.
outputConfig
object (GoogleCloudVisionV1p2beta1OutputConfig) 
optional
Required. The desired output location and metadata (e.g. format).
batchSize
integer <int32>
optional
The max number of response protos to put into each output JSON file on Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response protos will be generated. If batch_size = 20, then 5 json files each containing 20 response protos will be written under the prefix gcs_destination.uri. Currently, batch_size only applies to GcsDestination, with potential future support for other output configurations.
gcsDestination
object (GoogleCloudVisionV1p2beta1GcsDestination) 
optional
The Google Cloud Storage location to write the output(s) to.
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
This resource represents a long-running operation that is the result of a network API call.
done
boolean 
optional
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
error
object (Status) 
optional
The error result of the operation in case of failure or cancellation.
code
integer <int32>
optional
The status code, which should be an enum value of google.rpc.Code.
details
array [object {1}] 
optional
A list of messages that carry the error details. There is a common set of message types for APIs to use.
message
string 
optional
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
metadata
object 
optional
Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
Additional properties
optional
Properties of the object. Contains field @type with type URL.
name
string 
optional
The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}.
response
object 
optional
The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.
Additional properties
optional
Properties of the object. Contains field @type with type URL.
Modified at 2023-08-15 09:10:12
Previous
/v1p2beta1/{parent}/images:annotate
Built with