API Documentation

Everything you need to integrate SummarizeAPI into your applications

Introduction

The SummarizeAPI provides a simple REST API for text summarization. Send your text and receive an accurate, concise summary in seconds.

🎉 Free Tier Available: Get started immediately with our free tier offering 100 summaries per month.

Authentication

Currently, the API is free and open. For production use, you'll need an API key (coming soon).

Future Authentication
Authorization: Bearer YOUR_API_KEY

Quick Start

Here's a simple example to get you started:

cURL
curl -X POST https://summarizeapi.com/ \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Your text to summarize here...",
    "length": "medium",
    "style": "professional",
    "format": "paragraph",
    "outputLang": "auto"
  }'

API Endpoint

POST https://summarizeapi.com/

Request Parameters

All parameters should be sent as JSON in the request body.

Parameter Type Required Description
text string ✅ Yes The text to summarize (min 50 characters)
length string ❌ No Summary length: short, medium, long, extensive
Default: medium
style string ❌ No Writing style: professional, casual, academic, technical, simple
Default: professional
format string ❌ No Output format: paragraph, bullets, mixed
Default: paragraph
outputLang string ❌ No Output language: auto, en, fr, es, de, it, pt, ar, zh, ja, ru
Default: auto
includeKeywords boolean ❌ No Extract keywords (5-7 key terms)
Default: false

Response Format

Successful responses return JSON with the following structure:

Success Response (200 OK)
{
  "success": true,
  "summary": "The generated summary text...",
  "detectedLanguage": "auto",
  "keywords": "keyword1, keyword2, keyword3",
  "original_length": 1234,
  "summary_length": 456,
  "model": "advanced-ai"
}

Error Handling

Error responses include an error message:

Error Response
{
  "error": "Error description here"
}

Common Error Codes

  • 400 Bad Request: Invalid parameters or missing required fields
  • 500 Internal Server Error: Server-side processing error

cURL Example

cURL
curl -X POST https://summarizeapi.com/ \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Artificial intelligence is transforming industries worldwide. From healthcare to finance, AI algorithms analyze data, predict outcomes, and automate processes. Machine learning models learn from vast datasets to improve accuracy over time. Deep learning, a subset of AI, uses neural networks to tackle complex problems like image recognition and natural language processing.",
    "length": "short",
    "style": "professional",
    "format": "paragraph",
    "outputLang": "en",
    "includeKeywords": true
  }'

JavaScript Example

JavaScript (Fetch API)
const summarizeText = async (text) => {
  const response = await fetch('https://summarizeapi.com/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      text: text,
      length: 'medium',
      style: 'professional',
      format: 'paragraph',
      outputLang: 'auto',
      includeKeywords: false
    })
  });
  
  const data = await response.json();
  
  if (data.success) {
    console.log('Summary:', data.summary);
    console.log('Reduction:', 
      Math.round((1 - data.summary_length / data.original_length) * 100) + '%');
  } else {
    console.error('Error:', data.error);
  }
};

// Usage
summarizeText('Your long text here...');

Python Example

Python (requests)
import requests
import json

def summarize_text(text, length='medium', style='professional'):
    url = 'https://summarizeapi.com/'
    
    payload = {
        'text': text,
        'length': length,
        'style': style,
        'format': 'paragraph',
        'outputLang': 'auto',
        'includeKeywords': False
    }
    
    headers = {
        'Content-Type': 'application/json'
    }
    
    response = requests.post(url, json=payload, headers=headers)
    
    if response.status_code == 200:
        data = response.json()
        if data.get('success'):
            print(f"Summary: {data['summary']}")
            print(f"Original: {data['original_length']} chars")
            print(f"Summary: {data['summary_length']} chars")
        else:
            print(f"Error: {data.get('error')}")
    else:
        print(f"HTTP Error: {response.status_code}")

# Usage
text = "Your long text here..."
summarize_text(text, length='short', style='casual')

PHP Example

PHP (cURL)
<?php
function summarizeText($text, $length = 'medium', $style = 'professional') {
    $url = 'https://summarizeapi.com/';
    
    $data = [
        'text' => $text,
        'length' => $length,
        'style' => $style,
        'format' => 'paragraph',
        'outputLang' => 'auto',
        'includeKeywords' => false
    ];
    
    $ch = curl_init($url);
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => json_encode($data),
        CURLOPT_HTTPHEADER => [
            'Content-Type: application/json'
        ]
    ]);
    
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    
    if ($httpCode === 200) {
        $result = json_decode($response, true);
        
        if ($result['success']) {
            echo "Summary: " . $result['summary'] . "\n";
            echo "Original: " . $result['original_length'] . " chars\n";
            echo "Summary: " . $result['summary_length'] . " chars\n";
        } else {
            echo "Error: " . $result['error'] . "\n";
        }
    } else {
        echo "HTTP Error: $httpCode\n";
    }
}

// Usage
$text = "Your long text here...";
summarizeText($text, 'short', 'casual');
?>

Rate Limits

Current rate limits (subject to change):

  • Free Tier: 100 requests per month
  • Professional: 5,000 requests per month
  • Business: Unlimited requests

Support

Need help? We're here for you: