Skip to main content

Overview

TikTok Slideshow videos are perfect for storytelling with multiple images or clips, each with custom text overlays. Ideal for product showcases, tutorials, and social media content.

Basic Slideshow

const response = await fetch('https://api.hooked.ai/v1/project/create/tiktok-slideshow', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'Product Showcase',
    slides: [
      {
        media: 'media_001',
        texts: [
          {
            text: 'New Product Launch',
            fontSize: 16,
            x: 0,
            y: 43.13,
            width: 187,
            height: 36,
            color: '#ffffff',
            textAlign: 'center'
          }
        ]
      },
      {
        media: 'media_002',
        duration: 3,
        texts: [
          {
            text: 'Available Now!',
            x: 0,
            y: 43.13,
            width: 187,
            height: 36,
            fontSize: 36,
            color: '#00ff00'
          }
        ]
      }
    ]
  })
});

const data = await response.json();
console.log('Video ID:', data.data.videoId);
console.log('Project ID:', data.data.projectId);
Each slide requires a media field with the media ID from your media library. The media must already be uploaded to your account.

Advanced Slideshow with Avatar and Music

const createAdvancedSlideshow = async () => {
  const response = await fetch('https://api.hooked.ai/v1/project/create/tiktok-slideshow', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Summer Collection 2024',
      script: 'Check out our amazing summer collection. Three new styles, perfect for the season. Get yours today!',
      avatarId: 'avatar_id',
      voiceId: 'tzX5paJ07p5hyWFcU3uG',
      lipsyncModel: 'pro',
      musicId: 'upbeat_001',
      audio: {
        speed: 1.0,
        stability: 0.5,
        similarityBoost: 0.75,
        style: 0.0,
        useSpeakerBoost: true
      },
      slides: [
        {
          media: 'media_summer_001',
          duration: 4,
          texts: [
            {
              text: 'Summer Collection 2024',
              x: 100,
              y: 150,
              width: 880,
              height: 100,
              fontSize: 52,
              fontWeight: "700",
              color: "#ffffff",
              backgroundColor: "#ff6b6b",
              textAlign: "center",
              borderRadius: 12,
              padding: 20,
              opacity: 0.95
            },
            {
              text: 'Fresh & Stylish',
              x: 200,
              y: 280,
              width: 680,
              height: 70,
              fontSize: 32,
              fontWeight: "600",
              color: "#ffed4e",
              backgroundColor: "transparent",
              textAlign: "center"
            }
          ]
        },
        {
          media: 'media_summer_002',
          duration: 4,
          texts: [
            {
              text: '100% Premium Cotton',
              x: 150,
              y: 1400,
              width: 780,
              height: 90,
              fontSize: 36,
              fontWeight: "600",
              color: "#ffffff",
              backgroundColor: "#000000",
              textAlign: "center",
              borderRadius: 10,
              padding: 12,
              opacity: 0.9
            }
          ]
        },
        {
          media: 'media_summer_003',
          duration: 4,
          texts: [
            {
              text: 'Shop Now!',
              x: 200,
              y: 1650,
              width: 680,
              height: 120,
              fontSize: 56,
              fontWeight: '800',
              color: '#000000',
              backgroundColor: '#ffed4e',
              textAlign: 'center',
              borderRadius: 20,
              padding: 25,
              scale: 1.1
            }
          ]
        }
      ],
      webhook: 'https://yoursite.com/webhook',
      metadata: {
        campaignId: 'summer-2024',
        collection: 'beachwear',
        variant: 'A'
      }
    })
  });

  return await response.json();
};

Tips for TikTok Slideshows

Keep slides short: 1-10 seconds per slide works best for engagement (default: 3 seconds)
Use high-contrast text: Ensure text is readable on all backgrounds
Coordinate positioning: For 9:16 format, canvas is 1080x1920 pixels
Add voiceover: When using script, avatar, and voice together, they create engaging voiceover content
Layer text properly: Use zIndex to control text stacking order
Media IDs only: Each slide only needs the media ID - the media must already be uploaded to your account

Canvas Dimensions by Aspect Ratio

When using custom text positioning, remember these canvas sizes:
Aspect RatioCanvas SizeBest For
ratio_9_161080 x 1920TikTok, Reels, Shorts
ratio_16_91920 x 1080YouTube, horizontal videos
ratio_1_11080 x 1080Instagram square posts

Text Positioning Guide

// Example: Create a text box in the top-right corner (9:16 format)
{
  x: 580,        // X position from left
  y: 100,        // Y position from top
  width: 400,    // Width in pixels
  height: 200    // Height in pixels
}

// Example: Full-width text at bottom
{
  x: 100,
  y: 1650,
  width: 880,
  height: 150
}

// Example: Centered text box
{
  x: 290,        // Roughly centered horizontally
  y: 860,        // Roughly centered vertically
  width: 500,
  height: 200
}

Styling Examples

Bold Title Style

{
  text: 'BOLD ANNOUNCEMENT',
  fontSize: 56,
  fontWeight: '800',
  color: '#ffffff',
  backgroundColor: '#000000',
  textAlign: 'center',
  borderRadius: 10,
  padding: 20,
  opacity: 0.95
}

Subtle Subtitle Style

{
  text: 'Secondary information',
  fontSize: 28,
  fontWeight: '400',
  color: '#cccccc',
  backgroundColor: 'transparent',
  textAlign: 'center',
  opacity: 0.8
}

Call-to-Action Style

{
  text: 'CLICK HERE',
  fontSize: 42,
  fontWeight: '700',
  color: '#000000',
  backgroundColor: '#00ff00',
  textAlign: 'center',
  borderRadius: 25,
  padding: 18,
  scale: 1.05
}

Common Use Cases

  • Product Launches: Showcase multiple product angles with descriptions
  • Tutorials: Step-by-step guides with visual aids
  • Before/After: Transformations with text explanations
  • Lists: “Top 5” or “Best of” content with images
  • Stories: Narrative content with sequential images
  • Testimonials: Customer reviews with photos

Handling the Webhook Response

// Express.js webhook handler
app.post('/webhook', (req, res) => {
  const { data, status, message } = req.body;

  if (status === "COMPLETED") {
    const { videoId, status: videoStatus, url, shareUrl } = data;
    console.log('Slideshow completed!');
    console.log('Video ID:', videoId);
    console.log('Download URL:', url);
    console.log('Share URL:', shareUrl);

    // Save to your database, notify team, etc.
  }

  res.status(200).send('OK');
});