API Documentation

Authentication

All API requests require authentication using a Bearer token. Include your token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN_HERE

You can obtain your API token from your profile page after signing up.

Rate Limiting

The API is rate-limited to protect our services. You will receive a 429 Too Many Requests response if you exceed the limit.

Endpoints

POST /summarize

Generate summaries and transcripts for YouTube videos.

Request Body

{
    "video_url": "string (required) - YouTube video URL",
    "verbose_level": "string (optional) - Verbosity level: 'short', 'medium', 'long', 'extralong' (default: 'medium')",
    "style": "string (optional) - Summary style: 'article', 'essay', 'analytical', 'informative'",
    "format": "string (optional) - Output format: 'html' or 'markdown' (default: 'html')",
    "source_language": "string (optional) - Source language for forced transcription (only used when force_transcribe is 'true', default: 'auto')",
    "output_language": "string (optional) - Output language (default: 'english')",
    "force_transcribe": "string (optional) - Force new transcription, use 'true' or 'false' (default: 'false')",
    "transcript_only": "string (optional) - Return only transcript, use 'true' or 'false' (default: 'false')",
    "is_playlist": "string (optional) - Process as playlist, use 'true' or 'false' (default: 'false')"
}

Example Request (Python)

import requests

url = "https://api.mysmartbuddy.com/summarize"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN_HERE",
    "Content-Type": "application/json"
}
payload = {
    "video_url": "https://www.youtube.com/watch?v=example",
    "verbose_level": "short",
    "style": "informative",
    "format": "markdown",
    "source_language": "auto",
    "output_language": "english",
    "force_transcribe": "false",
    "transcript_only": "false",
    "is_playlist": "false"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())

Example Request (JavaScript)

const response = await fetch('https://api.mysmartbuddy.com/summarize', {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer YOUR_API_TOKEN_HERE',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        video_url: 'https://www.youtube.com/watch?v=example',
        verbose_level: 'short',
        style: 'informative',
        format: 'html',
        source_language: 'auto',
        output_language: 'english',
        force_transcribe: 'false',
        transcript_only: 'false',
        is_playlist: 'false'
    })
});

const data = await response.json();

Response

{
    "summary": "string - Generated summary in requested format",
    "transcript": "string - Video transcript (if transcript_only is true)",
    "cost": "number - Cost of the request",
    "balance": "number - Remaining credit balance",
    "status": "string - Request status"
}

Important Notes

  • The source_language parameter is only used when force_transcribe is set to "true". It determines the language used for speech recognition.
  • All boolean parameters (force_transcribe, transcript_only, is_playlist) must be passed as strings with values "true" or "false".
  • The verbose_level parameter accepts specific values: 'short', 'medium', 'long', or 'extralong'.
  • The style parameter accepts specific values: 'article', 'essay', 'analytical', or 'informative'.
  • The format parameter only accepts 'html' or 'markdown'.

Error Handling

The API uses standard HTTP response codes to indicate success or failure:

  • 200 - Success
  • 400 - Bad Request (invalid parameters)
  • 401 - Unauthorized (invalid or missing token)
  • 429 - Too Many Requests (rate limit exceeded)
  • 500 - Internal Server Error

Supported Languages

The API supports multiple languages for both source and output:

  • English
  • Spanish
  • French
  • German
  • Chinese
  • Arabic
  • Bengali
  • Danish
  • Dutch
  • Gujarati
  • Hindi
  • Hungarian
  • Indonesian
  • Italian
  • Japanese
  • Kannada
  • Korean
  • Latvian
  • Lithuanian
  • Malayalam
  • Marathi
  • Norwegian
  • Portuguese
  • Romanian
  • Slovenian
  • Swahili
  • Swedish
  • Tamil
  • Telugu
  • Turkish
  • Ukrainian
  • Urdu
  • Vietnamese

Use 'auto' for automatic language detection of the source content.