Watson Natural Language Understanding API

Text Analysis / OAuth Advanced HTTPS
Varies by plan (check documentation)

Overview

IBM Watson Natural Language Understanding (NLU) is a powerful AI-driven API that extracts semantic meaning from text, including sentiment, entities, keywords, categories, and emotion. It is built on IBM Cloud and supports multiple languages with enterprise-grade reliability. Developers use it to build smarter chatbots, content analyzers, and customer feedback tools.

💡

Beginner Tip

Always specify the "features" object in your request body — without it the API returns an error. Start with just "sentiment" and "keywords" to understand the response structure before enabling all available features.

Available Data

translated text
source language
target language
confidence score

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Watson Natural Language Understanding",
    "description": "Natural language processing for advanced text analysis",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

sentiment.document.score Overall document sentiment score from -1 (negative) to 1 (positive)
sentiment.document.label Human-readable sentiment label: "positive", "negative", or "neutral"
keywords List of important keywords extracted from the text with relevance scores
entities Named entities detected in the text, including type (Person, Organization, Location) and confidence
categories Hierarchical content categories the text belongs to, with confidence scores
language Detected or specified language of the analyzed text as an ISO 639-1 code

Implementation Example

const url = "https://cloud.ibm.com/apidocs/natural-language-understanding/natural-language-understanding";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Incorrect Basic Auth credentials or using the wrong service URL for your region
Find your instance credentials in IBM Cloud dashboard; encode "apikey:YOUR_API_KEY" in Base64 for Basic Auth
400 features required The "features" field is missing from the request body
Always include a "features" object specifying at least one feature like {"sentiment":{}} or {"keywords":{}}
422 unsupported text language The language of the input text is not supported for the requested features
Specify the "language" field explicitly in your request, or check which languages each feature supports in IBM docs

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 3/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS UNKNOWN
Category Text Analysis
Difficulty Advanced
Verified: 2026-04-07

Alternatives to Watson Natural Language Understanding

Technical alternatives for different use cases.

IBM's NLP service with emotion and concept extraction

Better For

Pricing simplicity and free tier size

Trade-off

Emotion analysis and advanced concept tagging

Similar APIs

View All →