Text statistics: words, sentences, characters, top words, entities like emails/URLs

Counts characters, words, unique words, sentences and paragraphs, returns the most frequent words, and picks out any emails, URLs, #hashtags and @mentions.

Request

POSThttps://text-analysis.p.apihiver.com/v1/stats

JSON object. Required: text.

Request Body

Edit the values below to test different scenarios.

Parameters and body structure are inherited from this endpoint's definition. Changes here only apply to this test run.

Language
Client
1curl --request POST \
2  --url https://text-analysis.p.apihiver.com/v1/stats \
3  --header 'Accept: application/json' \
4  --header 'Content-Type: application/json' \
5  --header 'X-API-Key: YOUR_API_KEY' \
6  --data '{
7  "text": "APIHiver is a marketplace where developers discover, test and subscribe to APIs. Providers publish their APIs with documentation and pricing plans. The platform handles keys, billing and analytics so that developers can focus on building great products. Many teams love how simple it is."
8}'

Text statistics: words, sentences, characters, top words, entities like emails/URLs: Text Analysis API reference

Counts characters, words, unique words, sentences and paragraphs, returns the most frequent words, and picks out any emails, URLs, #hashtags and @mentions. This endpoint is part of the Text Analysis API: Sentiment, keywords, extractive summaries, readability scores and text statistics for English text — one simple JSON call each.

Example response (200, application/json)

Success.

1{
2  "urls": [],
3  "words": 44,
4  "emails": [],
5  "hashtags": [],
6  "mentions": [],
7  "sentences": 4,
8  "top_words": [
9    {
10      "word": "developers",
11      "count": 2
12    },
13    {
14      "word": "apis",
15      "count": 2
16    },
17    {
18      "word": "apihiver",
19      "count": 1
20    }
21  ],
22  "characters": 287,
23  "paragraphs": 1,
24  "unique_words": 39,
25  "average_word_length": 5.41,
26  "characters_no_spaces": 244
27}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "text: Field required"
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.