Cloud Vision API
  1. files
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. files

/v1p2beta1/files:asyncBatchAnnotate

POST
/v1p2beta1/files:asyncBatchAnnotate
files
Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the google.longrunning.Operations interface. Operation.metadata contains OperationMetadata (metadata). Operation.response contains AsyncBatchAnnotateFilesResponse (results).
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://vision.googleapis.com//v1p2beta1/files:asyncBatchAnnotate' \
--header 'Content-Type: application/json' \
--data-raw '{
    "parent": "string",
    "requests": [
        {
            "features": [
                {
                    "maxResults": 0,
                    "model": "string",
                    "type": "TYPE_UNSPECIFIED"
                }
            ],
            "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
                }
            },
            "inputConfig": {
                "content": "string",
                "gcsSource": {
                    "uri": "string"
                },
                "mimeType": "string"
            },
            "outputConfig": {
                "batchSize": 0,
                "gcsDestination": {
                    "uri": "string"
                }
            }
        }
    ]
}'
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

Body Params application/json
Multiple async file 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 (GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest) {4}] 
optional
Required. Individual async file annotation requests for this batch.
features
array[object (GoogleCloudVisionV1p2beta1Feature) {3}] 
optional
Required. Requested features.
imageContext
object (GoogleCloudVisionV1p2beta1ImageContext) 
optional
Additional context that may accompany the image(s) in the file.
inputConfig
object (GoogleCloudVisionV1p2beta1InputConfig) 
optional
Required. Information about the input file.
outputConfig
object (GoogleCloudVisionV1p2beta1OutputConfig) 
optional
Required. The desired output location and metadata (e.g. format).
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/files:annotate
Next
/v1p2beta1/images:annotate
Built with