curl --request POST \
--url https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"script": "0.0-2.0s\nClose-up of the product...",
"out_number": 2,
"resolution": 720,
"aspect_ratio": "9:16"
}
'import requests
url = "https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos"
payload = {
"script": "0.0-2.0s
Close-up of the product...",
"out_number": 2,
"resolution": 720,
"aspect_ratio": "9:16"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
script: '0.0-2.0s\nClose-up of the product...',
out_number: 2,
resolution: 720,
aspect_ratio: '9:16'
})
};
fetch('https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'script' => '0.0-2.0s
Close-up of the product...',
'out_number' => 2,
'resolution' => 720,
'aspect_ratio' => '9:16'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos"
payload := strings.NewReader("{\n \"script\": \"0.0-2.0s\\nClose-up of the product...\",\n \"out_number\": 2,\n \"resolution\": 720,\n \"aspect_ratio\": \"9:16\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"script\": \"0.0-2.0s\\nClose-up of the product...\",\n \"out_number\": 2,\n \"resolution\": 720,\n \"aspect_ratio\": \"9:16\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"script\": \"0.0-2.0s\\nClose-up of the product...\",\n \"out_number\": 2,\n \"resolution\": 720,\n \"aspect_ratio\": \"9:16\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"trace_id": "45c30d76f06549b199a3775544515689",
"message": null,
"data": {
"project_id": "683f1a2b3c4d5e6f7890abcd",
"project_status": "running",
"current_step": "generating_video",
"task_ids": [
"68401a2b3c4d5e6f7890abcd",
"68401a2b3c4d5e6f7890abce"
]
}
}Create Viral Ad Clone Video Tasks
Creates one or more video generation tasks from a Viral Ads Clone project whose script is already available. This endpoint can be called multiple times for the same project. If a script is provided, it is used only for this batch and does not overwrite the project view_script.
curl --request POST \
--url https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"script": "0.0-2.0s\nClose-up of the product...",
"out_number": 2,
"resolution": 720,
"aspect_ratio": "9:16"
}
'import requests
url = "https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos"
payload = {
"script": "0.0-2.0s
Close-up of the product...",
"out_number": 2,
"resolution": 720,
"aspect_ratio": "9:16"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
script: '0.0-2.0s\nClose-up of the product...',
out_number: 2,
resolution: 720,
aspect_ratio: '9:16'
})
};
fetch('https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'script' => '0.0-2.0s
Close-up of the product...',
'out_number' => 2,
'resolution' => 720,
'aspect_ratio' => '9:16'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos"
payload := strings.NewReader("{\n \"script\": \"0.0-2.0s\\nClose-up of the product...\",\n \"out_number\": 2,\n \"resolution\": 720,\n \"aspect_ratio\": \"9:16\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"script\": \"0.0-2.0s\\nClose-up of the product...\",\n \"out_number\": 2,\n \"resolution\": 720,\n \"aspect_ratio\": \"9:16\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loova.ai/api/v1/video/viral-ads-clone/{project_id}/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"script\": \"0.0-2.0s\\nClose-up of the product...\",\n \"out_number\": 2,\n \"resolution\": 720,\n \"aspect_ratio\": \"9:16\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"trace_id": "45c30d76f06549b199a3775544515689",
"message": null,
"data": {
"project_id": "683f1a2b3c4d5e6f7890abcd",
"project_status": "running",
"current_step": "generating_video",
"task_ids": [
"68401a2b3c4d5e6f7890abcd",
"68401a2b3c4d5e6f7890abce"
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The project ID returned by the create project endpoint.
Body
Validation rules:
- The project script must already be generated
out_number, if provided, must be between 1 and 4- If
scriptis provided, it must be a non-empty string after trimming
Optional script for this video batch. If omitted, the project view_script is used. This value does not overwrite the project original script.
Number of video tasks to create in this call. If omitted, the project default is used.
1 <= x <= 4Resolution for this video batch. If omitted, the project default is used.
Aspect ratio for this video batch. If omitted, the project default is used.
9:16, 1:1, 16:9