International Business Machines Analyze API

Analyze text content.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

international-business-machines-analyze-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: International Business Machines IBM Cloud Object Storage Analyze API
  description: The IBM Cloud Object Storage API provides a RESTful interface compatible with S3 for storing and retrieving objects in buckets. It supports features such as multipart uploads, versioning, lifecycle policies, and server-side encryption.
  version: 1.0.0
  contact:
    name: IBM Cloud
    url: https://cloud.ibm.com/docs/cloud-object-storage
  license:
    name: IBM Cloud Terms
    url: https://www.ibm.com/terms
servers:
- url: https://s3.us-south.cloud-object-storage.appdomain.cloud
  description: US South
- url: https://s3.eu-de.cloud-object-storage.appdomain.cloud
  description: EU Germany
- url: https://s3.eu-gb.cloud-object-storage.appdomain.cloud
  description: EU Great Britain
security:
- bearerAuth: []
tags:
- name: Analyze
  description: Analyze text content.
paths:
  /v1/analyze:
    post:
      operationId: analyze
      summary: International Business Machines Analyze text
      description: Analyze text, HTML, or a public URL with one or more text analytics features.
      tags:
      - Analyze
      parameters:
      - name: version
        in: query
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalyzeRequest'
      responses:
        '200':
          description: Successful analysis
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalysisResults'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
components:
  schemas:
    Keyword:
      type: object
      properties:
        text:
          type: string
        relevance:
          type: number
        count:
          type: integer
    Entity:
      type: object
      properties:
        type:
          type: string
        text:
          type: string
        relevance:
          type: number
        count:
          type: integer
        confidence:
          type: number
    AnalyzeRequest:
      type: object
      required:
      - features
      properties:
        text:
          type: string
          description: The plain text to analyze.
        html:
          type: string
          description: The HTML content to analyze.
        url:
          type: string
          description: The URL of the content to analyze.
        features:
          type: object
          properties:
            sentiment:
              type: object
              properties:
                targets:
                  type: array
                  items:
                    type: string
                document:
                  type: boolean
            emotion:
              type: object
              properties:
                targets:
                  type: array
                  items:
                    type: string
                document:
                  type: boolean
            entities:
              type: object
              properties:
                limit:
                  type: integer
                sentiment:
                  type: boolean
                emotion:
                  type: boolean
            keywords:
              type: object
              properties:
                limit:
                  type: integer
                sentiment:
                  type: boolean
                emotion:
                  type: boolean
            categories:
              type: object
              properties:
                limit:
                  type: integer
            concepts:
              type: object
              properties:
                limit:
                  type: integer
            relations:
              type: object
            semantic_roles:
              type: object
              properties:
                limit:
                  type: integer
        language:
          type: string
        clean:
          type: boolean
    AnalysisResults:
      type: object
      properties:
        language:
          type: string
        analyzed_text:
          type: string
        sentiment:
          type: object
          properties:
            document:
              type: object
              properties:
                score:
                  type: number
                label:
                  type: string
        emotion:
          type: object
          properties:
            document:
              type: object
              properties:
                emotion:
                  type: object
                  properties:
                    sadness:
                      type: number
                    joy:
                      type: number
                    fear:
                      type: number
                    disgust:
                      type: number
                    anger:
                      type: number
        entities:
          type: array
          items:
            $ref: '#/components/schemas/Entity'
        keywords:
          type: array
          items:
            $ref: '#/components/schemas/Keyword'
        categories:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
              score:
                type: number
        concepts:
          type: array
          items:
            type: object
            properties:
              text:
                type: string
              relevance:
                type: number
              dbpedia_resource:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: IAM Token