How to Generate SEO-Friendly Technical Blogs from YouTube Videos
Tags: tutorial, beginners, javascript, productivity
Published: 2024-01-17 21:08:42

Are you looking to generate high-quality SEO-friendly technical blogs directly from a YouTube video? With this new BuildShip Template, you can now easily extract video captions and generate well-formatted technical blogs in markdown using the OpenAI Text Generator.

This template is designed to help you make the most out of your YouTube videos and improve your search engine rankings. In this blog, we will guide you on how to use this feature effectively.

## **How to Use the YouTube URL to Blog Template**

To get started, follow these simple steps:

- Clone the template “YouTube Video Blog Generator” and add your OpenAI API key in the node prompted. Once done, hit "Ship".

![YouTube Video Blog generator template](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6b0x0ajc8szirneqxtat.png)

- Copy the endpoint URL provided. You can use Postman, Hoppscotch, or any other API testing platform to create a POST request.

![Endpoint URL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tovbmtxz6z1aq6q0vp9i.png)
    
- In your API testing platform, add the copied endpoint URL and set the request method to POST.

- In the params section, add the YouTube Video URL you want to generate a blog from.
    

![YouTube Video URL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qqhbn1dqau9a773r8abx.png)
    
- If you want to make your blog SEO-friendly, you can include a list of SEO keywords. To do this, navigate to the body section and select the `raw` format. Then, choose `JSON` from the dropdown and input your SEO keywords as a string array.

![SEO Keywords](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/szrnp0qvcexg2lgrb5ky.png)

> Note: Adding SEO keywords is optional. If you don't want to include any keywords, you can set the body to none.

- Hit "Send" to generate the SEO-friendly technical blog based on the YouTube video captions.

## Understanding the Workflow

Let's take a closer look at the workflow behind the YouTube URL to Blog template:

- **HTTP POST Trigger**: The workflow starts with a trigger that listens for a POST request.

![HTTP POST Trigger](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjvqqy9dugjknllepmb8.png)

- **Get Query Param:** This node checks for the presence of the Video URL parameter in the request.

![Get Query Param](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w7soxbrt3fio6zu87nij.png)

- **YouTube Caption Extractor:** The "YouTube Caption Extractor" node is used to extract the captions for the video. It supports both user-submitted and auto-generated captions with language options. The captions are returned as an array of subtitle objects with properties like start time, duration, and text content.

![YouTube Caption Extractor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6u42rjfjcxnmpv8r9wjg.png)
    
- **Extract & Join By Key:** This node processes the returned array, extracts the subtitles, and concatenates them into a single string representing the captions for the entire YouTube video.

![Extract & Join By Key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mt76koqb1stu6dm5uok6.png)

- **OpenAI Text Generation:** The workflow then utilizes the power of the OpenAI Text Generation node. The token limit depends on the OpenAI Model being used. GPT-3.5 Turbo allows up to 4,097 tokens, while GPT-4, the more advanced model, allows up to 8,192 tokens.
    
> Here are the YouTube video captions to generate a blog from: `${userPrompt}`. Here's a list of the SEO Keywords to be included in this blog: `${keywords}`. Also, make sure to return the blog content formatted in markdown.
    
- **System Prompt:** This prompt sets the context for the text generation. It instructs the OpenAI Model to generate SEO-friendly technical blogs based on the content transcript. You can use the default prompt provided or customize it to suit your specific use-case.
    
- **User Prompt**: The extracted YouTube video captions and the SEO Keywords are used as the user prompt for the OpenAI Model.
    
- **SEO Keywords**: This node takes in the SEO keywords specified in the request body and sends them as part of the user prompt. You can include the SEO keywords in the user prompt to optimize your blog for search engines. Here's an example of how the user prompt can be constructed:``
    
    You can set fallback keywords or leave the field blank if you don't have specific keywords to include.

- **OpenAI Model**: You can choose between GPT-3.5 Turbo, GPT-4, and GPT-4 Turbo for the text generation process. In terms of the token limit, the GPT-3.5 Turbo allows up to 4,097 tokens, GPT-4 allows up to 8,192 tokens, and GPT-4 Turbo allows 128,000 tokens, as mentioned in the [OpenAI Docs](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo).

- **Max Tokens**: This parameter sets the maximum number of tokens reserved for the response size. It ensures that the response fits within the specified token limit.

![OpenAI GPT Text Generation Node](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cghtk3x92c6uavnhnkur.png)

> The time limit of the video depends on factors such as speech rate, pauses, and content density. If the token limit has not been exceeded, the workflow proceeds to the OpenAI Text Generation node.

### Customizing the Template 🪄

- **Blog Style:** You can customize the blog style by modifying the prompts in the OpenAI Text Generation node (System and User Prompt).
- **SEO Keywords:** Include relevant SEO keywords to optimize your blog for search engines.
- **Token Limit:** If you need more tokens for longer videos or complex content, you can upgrade to higher-tier OpenAI Models. Keep in mind that this may result in higher costs and may require a paid plan.

If you enjoyed our content, please give us a [follow on Twitter](https://twitter.com/BuildShipApp) or [join our Discord](https://buildship.com/discord) in case of any questions. We look forward to hearing from you! 💜