How to Upload Videos Using YouTube API In Magento 2

We all are aware of YouTube and YouTube videos. Product videos are something that explains everything about your product and introduces customers to your business product. Moreover, product videos can be useful in many ways. In the current covid scenario, where everyone is being online, all e-commerce store owner needs to create product videos. Magento provides each and everything that an e-commerce store owner requires. Therefore, Magento 2 allows its users to add their product videos to the product page. But what about youTube product videos? How to add a youTube product video to your Magento 2 store? We're here with a solution for how to upload videos using youTube API in Magento 2.

Product videos can be the best way to interact with your visitor or customers with your product. Additionally, you can add some attractive animation with product usability, benefits, and features. If we check the numbers then according to invideo, 96% of consumers increased their online video consumption, and 9 out of 10 viewers said that they wanted to see more videos from brands and businesses in 2020. Research says, when you display 360-degree or 3D product videos, there are more chances for customers to make the purchase. Further, it also creates a lasting impression on the customer's mind.

How to upload videos using youTube API in Magento 2

We have listed here the step-by-step process to make your work easy. You just need to follow the steps described here.

Step 1: Get the YouTube API key

Firstly, log in to your Google Account and redirect to the Google Developer Console.

Now, go to Google APIs and click on YouTube Data APIs. Else you can also search for YouTube API.

To enable the API, click on the Enable button to enable the API.

Then, Redirect to the Credentials tab and click on Create Credentials.

Here, select the API key option to get the API key.

Copy and paste that key wherever you want to use it further.

Moreover, you can restrict this API by Some IP or anything. Click on the restrict key to restrict the API, or else click on the close button to close the popup.

Step 2: Configure the API in Magento Backend.

Now, login to your Magento admin panel. Go to Store -> Settings -> Configuration -> Catalog.

Here, expand the product video section. Now, paste the API key in the YouTube API key field which we have copied earlier. Check the below screenshot for a better understanding.

YouTube API key

Click on Save to save all the configurations.

Step 3: Add a YouTube video to the Product Page

Navigate to Catalog -> Product -> Edit Product. Tap on the Image and Videos section, and click on Add Video.

YouTube API key integration

Then, enter the URL of the product video(YouTube or Vimeo) in the URL field.

After that, fill in all the necessary fields such as title, description, etc.

YouTube API key blog

Hit the Save button to save all the configurations.

That's all you need to do.

Hope this article, on how to upload videos using youTube API in Magento 2 helps you to integrate youTube product videos into your store. Increase your sales by adding product videos to your store.

While implementing this, if you face any errors, feel free to contact us or directly reach out to our helpdesk.

Happy Coding :-)