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/v1Authentication
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 textRequest 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
| Field | Type | Description |
|---|---|---|
| wordCount | number | Total words in the text |
| sentenceCount | number | Number of sentences detected |
| characterCount | number | Total character count |
| readingTimeSeconds | number | Estimated reading time at 200 WPM |
| sentiment.score | number (-1 to 1) | Overall sentiment score |
| sentiment.label | string | positive | negative | neutral |
| sentiment.comparative | number | Score per word (normalized) |
| readability.fleschKincaidScore | number (0-100) | Higher = easier to read |
| readability.gradeLevel | string | Approximate US grade reading level |
| keywords | array | Top 10 keywords with frequency and relevance |
| topSentences | array | Up to 3 key sentences by keyword density |
Rate limits
Free tier
- • 20 requests / day
- • 2,000 characters max
- • No API key required
Error codes
| Code | Meaning |
|---|---|
| 400 | Missing or invalid text field |
| 401 | Invalid API key |
| 413 | Text exceeds character limit for your tier |
| 429 | Daily rate limit exceeded — upgrade to Pro |
| 500 | Internal server error |