Skip to main content

URL to Video

Let's say you have a great blog post that you want to turn into a video. We can help you do that.

How it works​

We'll use this blog post from this blog as an example. When you call the API we will extract the content from the URL as well as images, fonts, and colors.

curl -X POST "https://ENDPOINT/v1/template/url-to-video?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.semrush.com/blog/what-is-seo/", "draft": true}'

Here is the response we get back.

{
"video_id": "8gCLZ9HloT",
"title": "Using video to standout on social media",
"editor_url": "https://ENDPOINT/editor/8gCLZ9HloT",
"created": 1616425200000
}

Other video types​

Custom template​

You can pass a markdown template to the API to control the layout of the video. Let's take our same blog post and pass a custom template to the API.

We will us this markdown template:

# [Short catchy title]
[2 sentence summary]

## [Section 1 title]
[1 sentence summary]

## [Section 2 title]
[1 sentence summary]

! Want to learn more? Visit example.com

Text in the square brackets are instructions to the AI of what to put in that section. For example [Short catchy title] will be replaced with the title of the blog post. Alternatively, you could write [6 word title] and the AI will make sure the title is 6 words long.

Note

The instructions are suggestions to the AI. The AI will do its best to follow the instructions, but it may not be perfect.

curl -X POST "https://ENDPOINT/v1/template/url-to-video?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://https://www.semrush.com/blog/what-is-seo/", "type": "custom_template", "template": "# [Short catchy title]\n[2 sentence summary]\n\n## [Section 1 title]\n[1 sentence summary]\n\n## [Section 2 title]\n[1 sentence summary]\n\n! [Call to Action]", "draft": true}'

Longer video​

For some video types, you can specify the length parameter. It can be:

  • short: < 60 seconds
  • medium: 2-3 minutes
  • long: 4+ minutes
curl -X POST "https://ENDPOINT/v1/template/url-to-video?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.semrush.com/blog/what-is-seo/", "type": "article_summary", "length": "medium", "draft": true}'