Skip to main content

Read text API

POST https://read.heimdallapp.org/read/v1/api/process

Before you start

Unstructured API key. For bulk labeled text, use Lake zip ingest.

Request

Headers: X-api-key, X-username
Body JSON: { "text": "..." }

Avoid line breaks and double quotes in text.

Response fields

GroupFields
Countslength, word_count, sentence_count, avg_word_length, avg_sentence_length
Vocaboov_ratio, oov_ratio_2
POSnoun_count, verb_count, adjective_count, adverb_count, pronoun_count, stopword_count
Termstfidf_top1, tfidf_top2, tfidf_top3
Sentimentsentiment, compound_sentiment_score
Qualityline_punct_ratio, short_line_ratio, dup_line_char_frac, top_2gram_char_frac, alpha_ratio, frac_all_caps_words, unigram_entropy, compression_ratio
Embeddingemb_00emb_63 (64-d; zeros for empty text)

Example

import requests

url = "https://read.heimdallapp.org/read/v1/api/process"
headers = {"X-api-key": "YOUR-API-KEY", "X-username": "YOUR-USERNAME"}
response = requests.post(url, headers=headers, json={"text": "Short sample sentence."})
print(response.status_code, response.json().get("sentiment"))
422

Wrong body shape or missing headers.

Next