Skip to content

Latest commit

 

History

History
195 lines (141 loc) · 3.85 KB

File metadata and controls

195 lines (141 loc) · 3.85 KB

API Endpoints

The Summarization API provides multiple endpoints for summarizing text, files, and YouTube videos. Below is a list of available endpoints, along with their request formats and expected responses.


Available Endpoints

1. API Health Check

Endpoint:

GET /

Description:
Returns a simple response to verify that the API is running correctly.

Response:

{ "message": "Hello there." }

2. Summarize YouTube Video

Endpoint:

POST /summarize/video

Description:
Summarizes the content of a YouTube video using either transcript-based extraction (fast but not always available) or audio-based transcription (slower but more accurate).

Request Body:

Example

{
  "content": { "videoUrl": "https://www.youtube.com/watch?v=EXAMPLE" },
  "options": {
    "length": "standard",
    "format": "bullet-points",
    "model": "openai",
    "speed": "fast",
    "lang": "english",
    "list": true
  }
}

Response:

  • summary: The generated summary.
  • transcript: The transcript of the video.
  • videoMetadata: Metadata about the video.
  • audioFilePath: Path to the audio file of the summary (tts).
{
  "summary": "...",
  "text": "...",
  "videoMetadata": {
    "title": "...",
    "description": "...",
    "thumbnailUrl": "..."
  },
  "audioFilePath": "..."
}

3. Summarize Uploaded File

Endpoint:

POST /summarize/file

Description:
Extracts text from an uploaded file (PDF, DOCX, TXT) and generates a summary.

Request Headers:

Content-Type: multipart/form-data

Request Body:

Example

{
  "options": {
    "length": "detailed",
    "format": "narrative",
    "model": "deepseek",
    "lang": "english"
  }
}

Response:

  • summary: The generated summary.
  • text: The text of the document.

Example

{
  "summary": "...",
  "text": "..."
}

4. Summarize Raw Text

Endpoint:

POST /summarize/text

Description:
Generates a summary from raw text input using AI models.

Request Body:

Example

{
  "content": {
    "text": "Machine learning is a subset of artificial intelligence..."
  },
  "options": {
    "length": "detailed",
    "format": "narrative",
    "model": "deepseek",
    "lang": "english"
  }
}

Response:

  • summary: The generated summary.
  • text: The text of the document.
{
  "summary": "Machine learning is a specialized branch of AI that enables computers to learn..."
}

Authentication & API Key Usage

  • An API key must be provided in the Authorization header, if the request is from an unauthorized origin:
    Authorization: Bearer YOUR_API_KEY
    
  • If the request comes from an allowed origin, API keys set in .env can be used automatically.

Next Steps