URL to Video
This use case demonstrates how to replicate the โLink to Videoโ flow from Creatify App.It demonstrates how to use Creatifyโs APIs to transform a product URL into a complete marketing video โ from link scraping, AI script generation, video preview creation, to final video rendering.
1. Create Link from URL
Extract content (title, description, images, videos, etc.) from a product URL.POST /api/links/
๐ก Errors:
- Successfully scraped the URL but it contains no images or videos.
status_code: 400
body: [โLink must have at least one image or one video.โ]- Failed to scrape the URL (due to anti-scraping or other issues).
status_code: 400
body: [โFailed to scrape url: โ]
2. (Optional) Create Link with Parameters
If you donโt have a URL but have product data, create a link directly using parameters.POST /api/links/link_with_params/
๐ก If no videos are included, provide at least 3 images.
3. (Optional) Update Link
Modify an existing linkโs metadata (title, description, images, videos).PUT /api/links/{id}/
4. Generate Recommended Scripts
Generate AI-powered marketing scripts for the product.POST /api/ai_scripts/
๐ก The title and description are the same as those in the link.
5. Generate Preview Videos
Generate video previews for the link.POST /api/link_to_videos/preview_list_async/
โ ๏ธ Costs 1 credit per 30 seconds preview video. Even if multiple previews are generated, youโll only be charged once. For example, 8 previews of 30 seconds each still cost just 1 credit.
๐ก link param is the response id of create link
override_script is the response paragraphs of ai_scripts
6. Get Preview Videos Result
๐ Webhook Callback Example
If you provide awebhook_url, Creatify will notify your backend of the preview generation result:
๐ Poll API to get Result without Webhook
If you did not provide awebhook_url, you will have to pool Creatify API to the preview generation result:
GET /api/link_to_videos/{id}/
โน๏ธ You can embed the preview URLs using <iframe> tags in your UI to display them.
7. Render Selected Preview
Render a chosen preview video into a final output.POST /api/link_to_videos/{id}/render_single_preview/
8. Get Render result
๐ Webhook Callback Example
If you provide awebhook_url, Creatify will notify your backend of the render result:
๐ Poll API to get Result without Webhook
If you did not provide awebhook_url, you will have to pool Creatify API to the render result:
GET /api/link_to_videos/{id}/
Status values in link to video response:
| status | description |
|---|---|
pending and previews is empty | Created |
pending and previews is not empty | Previews generated |
failed | Failed (check failed_reason) |
done | Successfully completed |
rejected | Rejected (content is moderated by our system) |
โ Summary of Endpoints
| Step | Endpoint | Description |
|---|---|---|
| 1 | /api/links/ | Create link from URL |
| 2 | /api/links/link_with_params/ | (Optional) Create link from parameters |
| 3 | /api/links/{id}/ | (Optional) Update link |
| 4 | /api/ai_scripts/ | Generate scripts |
| 5 | /api/link_to_videos/preview_list_async/ | Generate preview videos |
| 6 | /api/link_to_videos/{id}/ (GET) | Get preview videos |
| 7 | /api/link_to_videos/{id}/render_single_preview/ | Render selected preview |
| 8 | /api/link_to_videos/{id}/ (GET) | Check job status |

