Start summarizing content from files, URLs, or direct text input with intelligent AI processing
# Summarize text content ✨
curl -X POST "http://localhost:3001/api/summarizer/text" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"content": "Your long document content here...",
"summaryLength": "medium",
"includeKeyPoints": true,
"tone": "professional"
}'
# Summarize from URL 🌐
curl -X POST "http://localhost:3001/api/summarizer/url" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"url": "https://example.com/article",
"summaryLength": "short",
"focusAreas": ["main points", "conclusions"]
}'
Smart Content Analysis
Automatically extracts key points, adjusts tone, and provides compression analytics
/api/summarizer/text
Summarize direct text content with customizable length and focus areas
/api/summarizer/url
Fetch and summarize content from any web URL with smart HTML parsing
/api/summarizer/file
Upload and summarize documents (TXT, MD, PDF, Word) with multipart form support
/api/summarizer/stats
Get usage statistics, compression ratios, and summarization insights
Parameter | Type | Default | Description |
---|---|---|---|
summaryLength | enum | 'medium' | 'short' (2-3 sentences), 'medium' (1-2 paragraphs), 'long' (3-4 paragraphs) |
focusAreas | string[] | [] | Specific topics to focus on (e.g., ["conclusions", "methodology"]) |
includeKeyPoints | boolean | true | Extract 3-5 key points as bullet points |
tone | enum | 'professional' | 'professional', 'casual', 'academic' |
content
- Text content to summarize (required, max 50,000 chars)url
- Valid web URL to fetch and summarize (required)file
- File upload (multipart/form-data, max 10MB)// Text summarization
async function summarizeText(content) {
const response = await fetch('/api/summarizer/text', {
method: 'POST',
headers: {
'Authorization': `Bearer ${YOUR_JWT_TOKEN}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: content,
summaryLength: 'medium',
focusAreas: ['key findings', 'conclusions'],
includeKeyPoints: true,
tone: 'professional'
})
});
const result = await response.json();
console.log('Summary:', result.summary);
console.log('Key Points:', result.metadata.keyPoints);
}
// URL summarization
async function summarizeUrl(url) {
const response = await fetch('/api/summarizer/url', {
method: 'POST',
headers: {
'Authorization': `Bearer ${YOUR_JWT_TOKEN}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: url,
summaryLength: 'short',
tone: 'casual'
})
});
const result = await response.json();
return result;
}
// File upload summarization
async function summarizeFile(fileInput) {
const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('summaryLength', 'long');
formData.append('includeKeyPoints', 'true');
const response = await fetch('/api/summarizer/file', {
method: 'POST',
headers: {
'Authorization': `Bearer ${YOUR_JWT_TOKEN}`
},
body: formData
});
return await response.json();
}
import requests
import json
def summarize_text(content, token, summary_length='medium'):
"""Summarize text content using VecTrail Summarizer API"""
url = "http://localhost:3001/api/summarizer/text"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
payload = {
"content": content,
"summaryLength": summary_length,
"focusAreas": ["main points", "conclusions"],
"includeKeyPoints": True,
"tone": "academic"
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
result = response.json()
print(f"Summary: {result['summary']}")
print(f"Compression Ratio: {result['metadata']['compressionRatio']}")
return result
else:
print(f"Error: {response.status_code} - {response.text}")
return None
def summarize_file(file_path, token):
"""Summarize uploaded file"""
url = "http://localhost:3001/api/summarizer/file"
headers = {
"Authorization": f"Bearer {token}"
}
with open(file_path, 'rb') as f:
files = {'file': f}
data = {
'summaryLength': 'medium',
'includeKeyPoints': 'true',
'tone': 'professional'
}
response = requests.post(url, files=files, data=data, headers=headers)
if response.status_code == 200:
return response.json()
else:
print(f"Error: {response.status_code} - {response.text}")
return None
# Example usage
content = "Your long document content here..."
result = summarize_text(content, "your-jwt-token", "short")
print(f"Processing time: {result['metadata']['processingTime']}ms")
{
"success": true,
"summary": "This article discusses the implementation of artificial intelligence in modern healthcare systems. The integration of AI technologies has shown significant improvements in diagnostic accuracy, treatment personalization, and operational efficiency across medical institutions.",
"metadata": {
"originalLength": 15420,
"summaryLength": 234,
"compressionRatio": 0.15,
"processingTime": 1250,
"keyPoints": [
"AI improves diagnostic accuracy by 23% compared to traditional methods",
"Machine learning algorithms personalize treatment plans for individual patients",
"Operational costs reduced by 18% through automated administrative processes",
"Integration challenges include data privacy and staff training requirements",
"Future developments focus on real-time patient monitoring systems"
],
"sourceType": "url",
"sourceInfo": "https://example.com/ai-healthcare-article"
}
}
AI-generated concise summary of the content based on specified parameters
Processing statistics including compression ratio and performance metrics
Extracted bullet points highlighting main themes and conclusions
💡 Tip: Try different summary lengths and content types to see how the AI adapts its summarization approach.
Quickly summarize news articles, blog posts, and research papers for content curation and analysis.
Extract key insights from reports, contracts, and technical documentation for faster decision-making.
Summarize academic papers and research findings to accelerate literature reviews and knowledge synthesis.
Transform lengthy business reports and market analysis into actionable executive summaries.
Create study guides and course summaries from textbooks and educational materials.
Power chatbots, content management systems, and knowledge bases with intelligent summarization.
All Summarizer API endpoints require JWT authentication:
Authorization: Bearer YOUR_JWT_TOKEN
🔒 Security Note: Always use HTTPS in production and keep your JWT tokens secure. The API processes content through OpenAI's services with appropriate privacy measures.
🚀 Ready to transform your content with intelligent summarization?
Made with ❤️ for developers who value efficient content processing