DEV Community

ShotaTanikawa
ShotaTanikawa

Posted on

Summarize Any Text with AI - Paragraph Bullets or TLDR

Summarize Any Text with AI — Paragraph, Bullets, or TL;DR

The AI Text Summarizer API condenses long text into concise summaries using Claude AI. Choose your format: flowing paragraph, bullet points, or a single TL;DR sentence. Supports 5 languages.

Quick Start

curl -X POST https://summarizer-api-zeta.vercel.app/api/summarize \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Your long article text here...",
    "format": "tldr",
    "language": "en"
  }'
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "summary": "The article discusses the key impacts of AI on modern software development.",
  "word_count": 12,
  "original_word_count": 850,
  "compression_ratio": 0.0141,
  "language": "en",
  "format": "tldr"
}
Enter fullscreen mode Exit fullscreen mode

Three Formats

Paragraph (default)

{"format": "paragraph", "max_length": 100}
Enter fullscreen mode Exit fullscreen mode

Returns a flowing prose summary in 1-2 paragraphs.

Bullet Points

{"format": "bullets", "max_length": 100}
Enter fullscreen mode Exit fullscreen mode

Returns key points as a bullet list:

• First key point
• Second key point
• Third key point
Enter fullscreen mode Exit fullscreen mode

TL;DR

{"format": "tldr"}
Enter fullscreen mode Exit fullscreen mode

Returns a single sentence capturing the essence.

Supported Languages

en (English), ja (Japanese), es (Spanish), fr (French), de (German)

Python Example

import requests

article = open("long_article.txt").read()

result = requests.post(
    "https://summarizer-api-zeta.vercel.app/api/summarize",
    json={
        "text": article,
        "format": "bullets",
        "max_length": 50,
        "language": "en",
    },
).json()

print(f"Compressed {result['original_word_count']} words to {result['word_count']} words")
print(f"Compression: {(1 - result['compression_ratio']) * 100:.0f}%")
print(result["summary"])
Enter fullscreen mode Exit fullscreen mode

Use Cases

  • News aggregation: Summarize articles for digest emails
  • Content curation: Create previews for link roundups
  • Document processing: Extract key points from reports
  • Accessibility: Provide quick summaries for long-form content
  • Slack/Discord bots: Auto-summarize shared links

Try It

Available on RapidAPI with a free tier.


Built by @ShotaTanikawa

Top comments (0)