Method: documents.classifyText

Classifies a document into categories.

HTTP request

POST https://language.googleapis.com/v1beta2/documents:classifyText

The URL uses Google API HTTP annotation syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "document": {
    object(Document)
  },
}
Fields
document

object(Document)

Input document.

Response body

If successful, the response body contains data with the following structure:

The document classification response message.

JSON representation
{
  "categories": [
    {
      object(ClassificationCategory)
    }
  ],
}
Fields
categories[]

object(ClassificationCategory)

Categories representing the input document.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-language
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Natural Language API