PPT-from-Text (Unified API)

NEW

The PPT-from-Text API is a unified endpoint that allows you to create PowerPoint presentations from various input types including plain text topics, summaries, YouTube videos, websites, PDFs, and DOCX documents. The API automatically detects the input type and processes it accordingly.

Endpoint

POST https://api.magicslides.app/public/api/ppt-from-text

Authentication

The API uses API key authentication. Get your API key from /dashboard/settings.

{
  "apiKey": "ms-api-your-api-key-here",
  "topic": "Your topic here"
}

Input Types

The unified API automatically detects the input type based on the parameter you provide. You should provide only one input type per request.

1. Generate from Topic

Create presentations from plain text topics. The API automatically detects if the topic is a URL or plain text.

Request Parameters

apiKey

Your API key

Type: string | Required: Yes

topic

Plain text topic or URL

Type: string | Required: Yes

Example Request

{
  "apiKey": "ms-api-your-api-key-here",
  "topic": "Introduction to Quantum Computing: Understanding quantum mechanics, qubits, superposition, and quantum algorithms.",
  "template": "bullet-point1",
  "slideCount": 10,
  "language": "en",
  "imageForEachSlide": true
}

Code Examples

TypeScript

import axios from 'axios';

async function generateFromTopic() {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt-from-text',
      {
        apiKey: 'ms-api-your-api-key-here',
        topic: 'Introduction to Quantum Computing',
        template: 'bullet-point1',
        slideCount: 10,
        language: 'en',
        imageForEachSlide: true
      }
    );
    
    console.log('Presentation URL:', response.data.url);
    console.log('PPT ID:', response.data.pptId);
    return response.data;
  } catch (error) {
    console.error('Error:', error);
    throw error;
  }
}

Python

import requests

def generate_from_topic():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt-from-text',
            json={
                'apiKey': 'ms-api-your-api-key-here',
                'topic': 'Introduction to Quantum Computing',
                'template': 'bullet-point1',
                'slideCount': 10,
                'language': 'en',
                'imageForEachSlide': True
            }
        )
        response.raise_for_status()
        result = response.json()
        print('Presentation URL:', result['url'])
        return result
    except requests.exceptions.RequestException as e:
        print('Error:', e)
        raise

cURL

curl -X POST https://api.magicslides.app/public/api/ppt-from-text \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "ms-api-your-api-key-here",
    "topic": "Introduction to Quantum Computing",
    "template": "bullet-point1",
    "slideCount": 10,
    "language": "en",
    "imageForEachSlide": true
  }'

2. Generate from Summary

Create presentations from text summaries. Perfect for converting existing content into slide format.

Request Parameters

apiKey

Your API key

Type: string | Required: Yes

summary

Plain text summary content

Type: string | Required: Yes

Example Request

{
  "apiKey": "ms-api-your-api-key-here",
  "summary": "Climate change is one of the most pressing issues of our time. Rising global temperatures, melting ice caps, and extreme weather events are causing significant environmental and economic impacts. Scientists worldwide are calling for urgent action to reduce greenhouse gas emissions and transition to renewable energy sources.",
  "template": "bullet-point1",
  "slideCount": 10,
  "language": "en",
  "imageForEachSlide": true
}

Code Examples

TypeScript

import axios from 'axios';

async function generateFromSummary() {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt-from-text',
      {
        apiKey: 'ms-api-your-api-key-here',
        summary: 'Your detailed summary text here...',
        template: 'bullet-point1',
        slideCount: 10,
        language: 'en'
      }
    );
    
    console.log('Presentation URL:', response.data.url);
    return response.data;
  } catch (error) {
    console.error('Error:', error);
    throw error;
  }
}

Python

import requests

def generate_from_summary():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt-from-text',
            json={
                'apiKey': 'ms-api-your-api-key-here',
                'summary': 'Your detailed summary text here...',
                'template': 'bullet-point1',
                'slideCount': 10,
                'language': 'en'
            }
        )
        response.raise_for_status()
        result = response.json()
        print('Presentation URL:', result['url'])
        return result
    except requests.exceptions.RequestException as e:
        print('Error:', e)
        raise

cURL

curl -X POST https://api.magicslides.app/public/api/ppt-from-text \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "ms-api-your-api-key-here",
    "summary": "Your detailed summary text here...",
    "template": "bullet-point1",
    "slideCount": 10,
    "language": "en"
  }'

3. Generate from YouTube Video

Convert YouTube videos into presentations by extracting transcripts and key information.

Request Parameters

apiKey

Your API key

Type: string | Required: Yes

youtubeURL

YouTube video URL

Type: string | Required: Yes

Example Request

{
  "apiKey": "ms-api-your-api-key-here",
  "youtubeURL": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "template": "bullet-point1",
  "slideCount": 15,
  "language": "en",
  "imageForEachSlide": true,
  "aiImages": false
}

Code Examples

TypeScript

import axios from 'axios';

async function generateFromYouTube() {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt-from-text',
      {
        apiKey: 'ms-api-your-api-key-here',
        youtubeURL: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
        template: 'bullet-point1',
        slideCount: 15,
        language: 'en',
        imageForEachSlide: true
      }
    );
    
    console.log('Presentation URL:', response.data.url);
    console.log('Input Type:', response.data.inputType);
    return response.data;
  } catch (error) {
    console.error('Error:', error);
    throw error;
  }
}

Python

import requests

def generate_from_youtube():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt-from-text',
            json={
                'apiKey': 'ms-api-your-api-key-here',
                'youtubeURL': 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
                'template': 'bullet-point1',
                'slideCount': 15,
                'language': 'en',
                'imageForEachSlide': True
            }
        )
        response.raise_for_status()
        result = response.json()
        print('Presentation URL:', result['url'])
        print('Input Type:', result['inputType'])
        return result
    except requests.exceptions.RequestException as e:
        print('Error:', e)
        raise

cURL

curl -X POST https://api.magicslides.app/public/api/ppt-from-text \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "ms-api-your-api-key-here",
    "youtubeURL": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "template": "bullet-point1",
    "slideCount": 15,
    "language": "en",
    "imageForEachSlide": true
  }'

4. Generate from Website URL

Extract content from websites and convert it into presentations.

Request Parameters

apiKey

Your API key

Type: string | Required: Yes

websiteURL

Website URL to extract content from

Type: string | Required: Yes

Example Request

{
  "apiKey": "ms-api-your-api-key-here",
  "websiteURL": "https://www.wikipedia.org/wiki/Artificial_intelligence",
  "template": "custom1",
  "slideCount": 12,
  "language": "en",
  "presentationCategory": {
    "category": "Technology",
    "subCategory": "AI",
    "tone": "Professional"
  }
}

Code Example

import axios from 'axios';

async function generateFromWebsite() {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt-from-text',
      {
        apiKey: 'ms-api-your-api-key-here',
        websiteURL: 'https://www.wikipedia.org/wiki/Artificial_intelligence',
        template: 'custom1',
        slideCount: 12,
        language: 'en',
        presentationCategory: {
          category: 'Technology',
          subCategory: 'AI',
          tone: 'Professional'
        }
      }
    );
    
    console.log('Presentation URL:', response.data.url);
    return response.data;
  } catch (error) {
    console.error('Error:', error);
    throw error;
  }
}

5. Generate from PDF URL

Convert PDF documents into presentations by extracting text content.

Request Parameters

apiKey

Your API key

Type: string | Required: Yes

pdfURL

PDF file URL (must be publicly accessible)

Type: string | Required: Yes

Example Request

{
  "apiKey": "ms-api-your-api-key-here",
  "pdfURL": "https://example.com/document.pdf",
  "template": "bullet-point2",
  "slideCount": 10,
  "language": "en"
}

Code Example

import axios from 'axios';

async function generateFromPDF() {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt-from-text',
      {
        apiKey: 'ms-api-your-api-key-here',
        pdfURL: 'https://example.com/document.pdf',
        template: 'bullet-point2',
        slideCount: 10,
        language: 'en'
      }
    );
    
    console.log('Presentation URL:', response.data.url);
    return response.data;
  } catch (error) {
    console.error('Error:', error);
    throw error;
  }
}

6. Generate from DOCX URL

Convert DOCX documents into presentations by extracting text content.

Request Parameters

apiKey

Your API key

Type: string | Required: Yes

docxURL

DOCX file URL (must be publicly accessible)

Type: string | Required: Yes

Example Request

{
  "apiKey": "ms-api-your-api-key-here",
  "docxURL": "https://example.com/document.docx",
  "template": "bullet-point3",
  "slideCount": 10,
  "language": "en"
}

Code Example

import axios from 'axios';

async function generateFromDOCX() {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt-from-text',
      {
        apiKey: 'ms-api-your-api-key-here',
        docxURL: 'https://example.com/document.docx',
        template: 'bullet-point3',
        slideCount: 10,
        language: 'en'
      }
    );
    
    console.log('Presentation URL:', response.data.url);
    return response.data;
  } catch (error) {
    console.error('Error:', error);
    throw error;
  }
}

Response Format

The API returns a JSON response with the following structure:

{
  "status": "success",
  "message": "Presentation generated successfully",
  "inputType": "topic",
  "url": "https://example.com/path/to/presentation.pptx",
  "pptId": "presentation-id",
  "pdfUrl": "https://example.com/path/to/presentation.pdf",
  "json": {
    "presentationTitle": "Title",
    "presentationSubtitle": "Subtitle",
    "slides": [...]
  },
  "tokenUsed": 1234,
  "openAICallTime": 5000
}

Error Response

{
  "status": "failed",
  "message": "Error message",
  "error": {
    "field": "apiKey",
    "message": "Invalid API key",
    "inputType": "youtube",
    "url": "https://youtube.com/...",
    "error": "Detailed error message"
  }
}

Optional Parameters

template

Presentation template style

Default: "bullet-point1"

language

Target language code (ISO 639-1)

Default: "en"

slideCount

Number of slides to generate

Default: 10

imageForEachSlide

Whether to include images for each slide

Default: true

aiImages

Use AI-generated images instead of stock photos

Default: false

presentationCategory

Object with category, subCategory, and tone

Default: {category: 'General', subCategory: 'General', tone: 'Neutral'}

Ask AI about MagicSlides
ChatGPT logoClaude logoGemini logoPerplexity logo