Text Analytics REST API reference - Azure Cognitive Services

Important

This article describes an outdated version of the REST API. For up-to-date information, see Cognitive Service for Language REST API.

This article demonstrates how to call a REST API endpoint for Text Analytics, a service in Azure Cognitive Services suite. The Text Analytics API is a cloud-based service that provides Natural Language Processing (NLP) features for text mining and text analysis, including sentiment analysis, opinion mining, key phrase extraction, language detection, and named entity recognition.

Call the Text Analytics endpoint

  1. Start by creating an Azure Cognitive Services resource, and within that specifically a Text Analytics resource. For instructions, see Create a Cognitive Services resource using the portal.

  2. From the Azure portal, copy the key and endpoint required to make the call. For instructions, see Get the keys for your resource.

  3. From the left navigation on this article, expand the node for the version of the API you want to work on, select the operation that you want to perform (e.g., Sentiment). On the right pane, select Try It.

  4. In the REST API Try It pane, perform the following steps:

    1. In the Endpoint text box, enter the resource endpoint that you copied from the Azure portal.
    2. In the Ocp-Apim-Subscription-Key text box, enter the key that you copied from the Azure portal. If the call requires any more headers, add those with the appropriate values as well.
    3. Provide other parameters, headers, and message payload (body) as required for the operation.
    4. Select Run.
  5. You will see the relevant response with an appropriate response code.

Samples

Visit the Cognitive Services REST API Sample GitHub repo for various samples on working with Cognitive Services using REST.

See also