API Reference

Text Analysis API

Analyze text for sentiment, keywords, readability, and more. 20 free requests/day — no account needed.

Base URL

https://your-domain.vercel.app/api/v1

Authentication

Free tier: no authentication required (20 requests/day, 2,000 chars max).
Pro tier: include your API key in the Authorization header.

Authorization: Bearer qs_YOUR_API_KEY

Endpoints

POST/api/v1/analyzeAnalyze text

Request body

{
  "text": "Your text to analyze here..."
}

Example request

curl -X POST https://your-domain.vercel.app/api/v1/analyze \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer qs_YOUR_API_KEY" \
  -d '{"text": "The product is absolutely fantastic and I love using it every day."}'

Response

{
  "ok": true,
  "tier": "pro",
  "data": {
    "wordCount": 14,
    "sentenceCount": 1,
    "characterCount": 69,
    "readingTimeSeconds": 5,
    "sentiment": {
      "score": 0.842,
      "label": "positive",
      "comparative": 0.2105
    },
    "readability": {
      "fleschKincaidScore": 72.4,
      "gradeLevel": "7th grade"
    },
    "keywords": [
      { "word": "product", "frequency": 1, "relevance": 1 },
      { "word": "fantastic", "frequency": 1, "relevance": 1 },
      { "word": "love", "frequency": 1, "relevance": 1 }
    ],
    "topSentences": [
      "The product is absolutely fantastic and I love using it every day."
    ]
  }
}
GET/api/v1/analyze?text=...Quick analysis (2,000 chars)
curl "https://your-domain.vercel.app/api/v1/analyze?text=Great+product!"

Response fields

FieldTypeDescription
wordCountnumberTotal words in the text
sentenceCountnumberNumber of sentences detected
characterCountnumberTotal character count
readingTimeSecondsnumberEstimated reading time at 200 WPM
sentiment.scorenumber (-1 to 1)Overall sentiment score
sentiment.labelstringpositive | negative | neutral
sentiment.comparativenumberScore per word (normalized)
readability.fleschKincaidScorenumber (0-100)Higher = easier to read
readability.gradeLevelstringApproximate US grade reading level
keywordsarrayTop 10 keywords with frequency and relevance
topSentencesarrayUp to 3 key sentences by keyword density

Rate limits

Free tier
  • • 20 requests / day
  • • 2,000 characters max
  • • No API key required
Pro — $9/month
  • • Unlimited requests
  • • 50,000 characters max
  • • API key authentication
Get API key →

Error codes

CodeMeaning
400Missing or invalid text field
401Invalid API key
413Text exceeds character limit for your tier
429Daily rate limit exceeded — upgrade to Pro
500Internal server error