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.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Google Cloud Natural Language API