Skip to main content
POST
/
v1
/
project
/
create
/
product-ads
Create Product Ad Video
curl --request POST \
  --url https://b8e35428b2f8.ngrok-free.app/api/v1/project/create/product-ads \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data @- <<EOF
{
  "name": "Product Launch Video",
  "script": "Introducing our revolutionary product that will change how you work. With cutting-edge features and an intuitive design, it's everything you need to boost your productivity.",
  "productAdSettings": {
    "websiteUrl": "https://example.com/product",
    "avatarIntroSeconds": 3,
    "scrollInterval": 3,
    "scrollDuration": 1500,
    "scrollDelay": 500,
    "scrollMode": "restart"
  },
  "avatarId": "confident_avatar_id",
  "voiceId": "professional_voice_id",
  "lipsyncModel": "base",
  "aspectRatio": "ratio_9_16",
  "caption": {
    "preset": "modern",
    "alignment": "bottom",
    "disabled": false
  },
  "addStickers": true,
  "audio": {
    "speed": 1,
    "stability": 0.5,
    "similarityBoost": 0.75,
    "style": 0,
    "useSpeakerBoost": true
  },
  "language": "en",
  "webhook": "https://yoursite.com/webhook",
  "metadata": {
    "campaignId": "summer2024",
    "productId": "prod_123"
  }
}
EOF
{
  "success": true,
  "data": {
    "videoId": "vid_pa_abc123xyz",
    "projectId": "proj_pa_abc123xyz",
    "status": "STARTED"
  },
  "message": "Product Ads project successfully created"
}
Try it out! Use the API playground on the right to test the Product Ads endpoint directly.

Overview

Product Ads combine AI avatars with automatic website scrolling to create engaging product advertisement videos. The avatar presents your product while the website scrolls in the background, showcasing your product page. This format is ideal for:
  • Product launches and demos
  • E-commerce advertising
  • SaaS product showcases
  • Website feature highlights
  • Landing page promotions
Product Ads automatically capture your website and create a scrolling video that syncs with the avatar’s narration. The website appears behind the avatar after a customizable intro duration.

Endpoint

POST /v1/project/create/product-ads

Required Fields

script
string
required
The script for the avatar to speak (1-10,000 characters). Write naturally as if presenting your product.
productAdSettings
object
required
Product Ad specific settings
avatarId
string
required
Avatar ID from /v1/avatar/list. Choose an avatar that matches your brand and target audience.
voiceId
string
required
Voice ID from /v1/voice/list. The voice used for the avatar’s speech.

Optional Fields

name
string
Video name (max 100 characters). If not provided, a name will be auto-generated.
lipsyncModel
string
default:"base"
Lipsync quality model for avatar synchronization:
  • base: Standard lipsync quality (faster, lower cost)
  • pro: Enhanced lipsync quality (slower, higher quality)
caption
object
Caption settings for the video
aspectRatio
string
default:"ratio_9_16"
Video aspect ratio:
  • ratio_9_16: Vertical (TikTok, Reels, Shorts) - Recommended
  • ratio_16_9: Horizontal (YouTube)
  • ratio_1_1: Square (Instagram)
language
string
default:"en"
Language code for the video (2 characters). Example: en, es
addStickers
boolean
default:"false"
Enable automatic sticker generation for the video. Adds engaging visual elements automatically.
audio
object
Voice audio settings
webhook
string
HTTPS URL to receive completion notification (max 500 characters). Highly recommended for production use.
metadata
object
Custom metadata object (max 5KB). Store any additional data you need to associate with this video.
{
  "campaignId": "summer2024",
  "productId": "prod_123"
}

Request Examples

Basic Product Ad

const response = await fetch('https://api.tryhooked.ai/v1/project/create/product-ads', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    script: 'Introducing our revolutionary product that will change how you work. With cutting-edge features and an intuitive design, it\'s everything you need to boost your productivity.',
    productAdSettings: {
      websiteUrl: 'https://example.com/product'
    },
    avatarId: 'confident_avatar_id',
    voiceId: 'professional_voice_id'
  })
});

const data = await response.json();
console.log('Video ID:', data.data.videoId);
console.log('Project ID:', data.data.projectId);

Product Ad with Custom Settings

const createProductAd = async () => {
  const response = await fetch('https://api.tryhooked.ai/v1/project/create/product-ads', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Product Launch Video',
      script: 'Discover the future of productivity with our latest SaaS platform. Experience seamless workflow management, real-time collaboration, and intelligent automation - all in one powerful tool.',
      productAdSettings: {
        websiteUrl: 'https://saas-product.com/features',
        avatarIntroSeconds: 5,
        scrollMode: 'loop'
      },
      avatarId: 'enthusiastic_avatar_id',
      voiceId: 'confident_voice_id',
      lipsyncModel: 'pro',
      aspectRatio: 'ratio_9_16',
      caption: {
        preset: 'modern',
        alignment: 'bottom',
        disabled: false
      },
      addStickers: true,
      audio: {
        speed: 1,
        stability: 0.5,
        similarityBoost: 0.75,
        style: 0,
        useSpeakerBoost: true
      },
      language: 'en',
      webhook: 'https://yoursite.com/webhook',
      metadata: {
        campaignId: 'summer2024',
        productId: 'prod_123',
        category: 'saas'
      }
    })
  });

  return await response.json();
};

Response

{
  "success": true,
  "data": {
    "videoId": "vid_pa_abc123xyz",
    "projectId": "proj_pa_abc123xyz",
    "status": "STARTED"
  },
  "message": "Product Ads project successfully created"
}

Webhook Notification

When your video is ready, we’ll POST to your webhook URL:
Webhook Payload
{
  "status": "COMPLETED",
  "data": {
    "videoId": "vid_pa_abc123xyz",
    "status": "COMPLETED",
    "url": "https://cdn.tryhooked.ai/videos/abc123xyz.mp4",
    "shareUrl": "https://cdn.tryhooked.ai/shared/abc123xyz.mp4",
    "metadata": {
      "projectId": "proj_pa_abc123xyz",
      "campaignId": "summer2024"
    }
  },
  "message": "Video completed"
}
Your webhook endpoint must return a 200 status code. We’ll retry up to 3 times if the request fails.

Scroll Modes

Available scroll modes for website behavior:
ModeDescriptionUse Case
restartScroll down, jump to top when reaching bottomProduct listings, feature pages
loopPing-pong scroll (down then up, then down…)Landing pages, hero sections
onceScroll down only, stay at bottomLong-form content, testimonials
fixedNo scroll, just capture initial viewStatic pages, splash screens

Lipsync Models

ModelQualitySpeedCostBest For
baseStandardFasterLowerQuick content, social media
proEnhancedSlowerHigherProfessional ads, brand content

Caption Presets

Available caption presets for the caption.preset field:
PresetDescription
defaultDefault caption style with bold text and shadow effects
beastBold uppercase style with Komika font
umiYellow glowing text style
tiktokViral & trendy style, perfect for social media
wrap1Wrapped style with red background highlight
wrap2Wrapped style with blue background highlight (uppercase)
arielBold uppercase style with purple highlight
hookedBrand style with purple background
classicClean, simple captions with black background
activeGreen background with bold text
bubbleWhite background bubble style
glassGlassmorphic transparency effect
comicComic Sans font with colorful style
glowPink and orange glow effects
pastelSoft pastel pink background
neonGreen neon glow effect
retroTVRetro TV style with cyan glow
redRed glow effect with white text
markerYellow marker/highlighter style
modernContemporary white background style
blueBlue background style
vividVibrant pink background with uppercase text

Best Practices

Choose the Right Avatar

Select an avatar that matches your brand personality and target audience demographics.

Optimize Website URL

Use a clean, focused landing page that highlights your product’s key features.

Set Intro Duration

Use 2-5 seconds for the avatar intro to grab attention before showing the website.

Select Scroll Mode

Use restart for product listings, loop for hero sections, once for long content.

Use Pro Lipsync

Choose pro lipsync model for professional ads and brand content.

Add Background Music

Enhance engagement with subtle background music that complements the narration.

Website URL Guidelines

Important: The website URL must be publicly accessible and not behind authentication.

Best Practices

  • Use HTTPS URLs only
  • Ensure the website loads quickly
  • Use mobile-responsive pages
  • Avoid pages with heavy animations or popups
  • Test the URL in an incognito browser window
  • Product landing pages
  • Feature highlight pages
  • Pricing pages
  • Homepage hero sections
  • Demo pages

Error Handling

ErrorDescriptionSolution
script: Script is requiredMissing or empty scriptAdd the script field with your narration
script: Script cannot exceed 10000 charactersScript too longShorten your script to under 10,000 characters
productAdSettings.websiteUrl: Website URL is requiredMissing website URLAdd the websiteUrl field in productAdSettings
productAdSettings.websiteUrl: Invalid website URLInvalid URL formatEnsure URL starts with https:// and is valid
avatarId: Avatar "xxx" not foundInvalid avatar IDUse a valid avatar ID from /v1/avatar/list
voiceId: Voice "xxx" not foundInvalid voice IDUse a valid voice ID from /v1/voice/list
productAdSettings.avatarIntroSeconds: Number must be between 1 and 30Invalid intro durationUse a value between 1 and 30 seconds in productAdSettings.avatarIntroSeconds
Not enough creditsInsufficient creditsTop up your account credits

Next Steps

Authorizations

x-api-key
string
header
required

Body

application/json
script
string
required

The script for the avatar to speak (1-10,000 characters)

Required string length: 1 - 10000
productAdSettings
object
required

Product Ad specific settings

avatarId
string
required

Avatar ID from /v1/avatar/list

Required string length: 1 - 30
voiceId
string
required

Voice ID from /v1/voice/list

Required string length: 1 - 30
name
string

Video name (max 100 characters)

Maximum string length: 100
lipsyncModel
enum<string>
default:base

Lipsync quality model for avatar synchronization

Available options:
base,
pro
caption
object
addStickers
boolean
default:false

Enable automatic sticker generation for the video

audio
object

Voice audio settings

aspectRatio
enum<string>
default:ratio_9_16

Video aspect ratio

Available options:
ratio_9_16,
ratio_16_9,
ratio_1_1
language
string
default:en

Language code (2 characters)

Required string length: 2
webhook
string

HTTPS URL to receive completion notification

Maximum string length: 500
metadata
object

Custom metadata object (max 5KB)

Response

Product Ads project created successfully

success
boolean
data
object
message
string