Google Cloud Vision Images API

Analyze images for various features

OpenAPI Specification

google-cloud-vision-images-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Cloud Vision Files Images API
  description: Provides image analysis capabilities including label detection, face detection, text extraction (OCR), object detection, landmark recognition, and explicit content moderation.
  version: v1
  contact:
    name: Google Cloud
    url: https://cloud.google.com/vision/docs
servers:
- url: https://vision.googleapis.com/v1
  description: Google Cloud Vision production endpoint
security:
- oauth2:
  - https://www.googleapis.com/auth/cloud-vision
tags:
- name: Images
  description: Analyze images for various features
paths:
  /images:annotate:
    post:
      operationId: annotateImages
      summary: Google Cloud Vision Annotate images
      description: Run image detection and annotation for a batch of images. Supports label detection, face detection, text detection, landmark detection, and more.
      tags:
      - Images
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchAnnotateImagesRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchAnnotateImagesResponse'
  /images:asyncBatchAnnotate:
    post:
      operationId: asyncBatchAnnotateImages
      summary: Google Cloud Vision Async annotate images
      description: Run asynchronous image detection and annotation for a list of images. Results are written to a GCS output location.
      tags:
      - Images
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AsyncBatchAnnotateImagesRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
components:
  schemas:
    BatchAnnotateImagesRequest:
      type: object
      properties:
        requests:
          type: array
          items:
            $ref: '#/components/schemas/AnnotateImageRequest'
          description: Individual image annotation requests
    AnnotateImageRequest:
      type: object
      properties:
        image:
          type: object
          properties:
            content:
              type: string
              format: byte
              description: Base64-encoded image content
            source:
              type: object
              properties:
                imageUri:
                  type: string
                  format: uri
                  description: URI of the image
                gcsImageUri:
                  type: string
                  description: GCS URI of the image
        features:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                - LABEL_DETECTION
                - FACE_DETECTION
                - TEXT_DETECTION
                - DOCUMENT_TEXT_DETECTION
                - LANDMARK_DETECTION
                - LOGO_DETECTION
                - SAFE_SEARCH_DETECTION
                - IMAGE_PROPERTIES
                - OBJECT_LOCALIZATION
                - PRODUCT_SEARCH
              maxResults:
                type: integer
          description: Features to detect in the image
    BatchAnnotateImagesResponse:
      type: object
      properties:
        responses:
          type: array
          items:
            $ref: '#/components/schemas/AnnotateImageResponse'
    EntityAnnotation:
      type: object
      properties:
        mid:
          type: string
          description: Knowledge Graph machine ID
        description:
          type: string
          description: Entity textual description
        score:
          type: number
          description: Overall score of the result
        confidence:
          type: number
          description: Confidence score
        topicality:
          type: number
          description: Topicality score
        locale:
          type: string
          description: Language code for the locale
    AsyncBatchAnnotateImagesRequest:
      type: object
      properties:
        requests:
          type: array
          items:
            $ref: '#/components/schemas/AnnotateImageRequest'
        outputConfig:
          type: object
          properties:
            gcsDestination:
              type: object
              properties:
                uri:
                  type: string
    AnnotateImageResponse:
      type: object
      properties:
        labelAnnotations:
          type: array
          items:
            $ref: '#/components/schemas/EntityAnnotation'
        textAnnotations:
          type: array
          items:
            $ref: '#/components/schemas/EntityAnnotation'
        faceAnnotations:
          type: array
          items:
            type: object
        landmarkAnnotations:
          type: array
          items:
            $ref: '#/components/schemas/EntityAnnotation'
        safeSearchAnnotation:
          type: object
          properties:
            adult:
              type: string
            violence:
              type: string
            racy:
              type: string
    Operation:
      type: object
      properties:
        name:
          type: string
        done:
          type: boolean
        response:
          type: object
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/cloud-vision: Manage your Google Cloud Vision resources
            https://www.googleapis.com/auth/cloud-platform: Full access to Google Cloud Platform resources