YouTube to PPT

DEPRECATED

⚠️ This endpoint is deprecated

This endpoint is still functional but deprecated. We recommend using the unified PPT-from-Text API for all new integrations. The unified API supports all input types including topics, summaries, YouTube videos, websites, PDFs, and DOCX documents.

New endpoint: POST /api/ppt-from-text (use the youtubeURL parameter)

Generate PowerPoint presentations from YouTube videos using the MagicSlides API.

Endpoint

POST https://api.magicslides.app/public/api/ppt_from_youtube

Request Parameters

youtubeURL

The YouTube video URL to convert into a presentation.

Type: string

Required: Yes

email

Your registered email address.

Type: string

Required: Yes

accessId

Your API access ID.

Type: string

Required: Yes

template

Presentation template style.

Type: string

Required: No

Default: "bullet-point1"

language

Target language for the presentation.

Type: string

Required: No

Default: "en"

slideCount

Number of slides to generate (1-50).

Type: number

Required: No

Default: 10

aiImages

Enable AI-generated images.

Type: boolean

Required: No

Default: false

imageForEachSlide

Include images on every slide.

Type: boolean

Required: No

Default: true

googleImage

Use Google Images instead of AI images.

Type: boolean

Required: No

Default: false

googleText

Use Google search for content enhancement.

Type: boolean

Required: No

Default: false

model

AI model to use - "gpt-4" or "gpt-3.5".

Type: string

Required: No

Default: "gpt-4"

presentationFor

Target audience for the presentation.

Type: string

Required: No

watermark

Optional object to apply an image watermark on all slides.

Type: object

Required: No

Fields: width (string), height (string), brandURL (string URL), position (TopLeft, TopRight, BottomLeft, BottomRight)

Supported Templates

We support the following templates.

Editable

ed-bullet-point9ed-bullet-point7ed-bullet-point6ed-bullet-point5ed-bullet-point2ed-bullet-point4Custom gold 1custom Dark 1custom sync 5custom sync 4custom sync 6custom sync 1custom sync 2custom sync 3custom-ed-7custom-ed-8custom-ed-9pitchdeckorignalpitch-deck-3pitch-deck-2custom-ed-10custom-ed-11custom-ed-12ed-bullet-point1

Default

bullet-point1bullet-point2bullet-point4bullet-point5bullet-point6bullet-point7bullet-point8bullet-point9bullet-point10custom2custom3custom4custom5custom6custom7custom8custom9verticalBulletPoint1verticalCustom1

Example Request

{
  "youtubeURL": "https://www.youtube.com/watch?v=example",
  "email": "your-email@example.com",
  "accessId": "your-access-id",
  "template": "bullet-point1",
  "language": "en",
  "slideCount": 10,
  "aiImages": false,
  "imageForEachSlide": true,
  "googleImage": false,
  "googleText": false,
  "model": "gpt-4",
  "presentationFor": "general audience",
  "watermark": {
    "width": "48",
    "height": "48",
    "brandURL": "https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png",
    "position": "BottomRight"
  }
}

Example Response

{
  "success": true,
  "data": {
    "url": "https://example.com/path/to/presentation.pptx",
    "slideCount": 10,
    "generatedAt": "2024-03-21T14:30:00Z",
    "fileSize": 2048576
  },
  "message": "Presentation generated successfully"
}

Code Examples

TypeScript

import axios from 'axios';

async function generateFromYouTube() {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt_from_youtube',
      {
        youtubeURL: 'https://www.youtube.com/watch?v=example',
        email: 'your-email@example.com',
        accessId: 'your-access-id',
        template: 'bullet-point1',
        language: 'en',
        slideCount: 10,
        aiImages: false,
        imageForEachSlide: true,
        googleImage: false,
        googleText: false,
        model: 'gpt-4',
        presentationFor: 'general audience',
        watermark: {
          width: '48',
          height: '48',
          brandURL: 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
          position: 'BottomRight'
        }
      },
      {
        headers: {
          'Content-Type': 'application/json'
        }
      }
    );

    console.log('Presentation URL:', response.data.data.url);
    return response.data;
  } catch (error) {
    console.error('Error generating presentation:', error);
    throw error;
  }
}

Python

import requests

def generate_from_youtube():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt_from_youtube',
            json={
                'youtubeURL': 'https://www.youtube.com/watch?v=example',
                'email': 'your-email@example.com',
                'accessId': 'your-access-id',
                'template': 'bullet-point1',
                'language': 'en',
                'slideCount': 10,
                'aiImages': False,
                'imageForEachSlide': True,
                'googleImage': False,
                'googleText': False,
                'model': 'gpt-4',
                'presentationFor': 'general audience',
                'watermark': {
                    'width': '48',
                    'height': '48',
                    'brandURL': 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
                    'position': 'BottomRight'
                }
            },
            headers={
                'Content-Type': 'application/json'
            }
        )
        response.raise_for_status()
        data = response.json()
        print('Presentation URL:', data['data']['url'])
        return data
    except requests.exceptions.RequestException as e:
        print('Error:', e)
        raise

cURL

curl -X POST https://api.magicslides.app/public/api/ppt_from_youtube \
  -H "Content-Type: application/json" \
  -d '{
    "youtubeURL": "https://www.youtube.com/watch?v=example",
    "email": "your-email@example.com",
    "accessId": "your-access-id",
    "template": "bullet-point1",
    "language": "en",
    "slideCount": 10,
    "aiImages": false,
    "imageForEachSlide": true,
    "googleImage": false,
    "googleText": false,
    "model": "gpt-4",
    "presentationFor": "general audience",
    "watermark": {
      "width": "48",
      "height": "48",
      "brandURL": "https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png",
      "position": "BottomRight"
    }
  }'