Add YouTube Videos with products

Magento 2 Add YouTube Videos

Today we are going to talk about how add to add YouTube videos in Magento 2 against the product. We had the similar requirement on our one of our client website where they wanted to show demonstrated videos of their products.

YouTube API Key

To show YouTube video in Magento 2 against your product, you need to add YouTube API key to add YouTube video links in Magento 2 product video / image gallery. To do this you will need to object YouTube Data API v3 API Key from Google console for developers.

As usual lets crack on with our step by step implementation to obtain YouTube API key for your Magento 2 website -:

Step 1 – Go To https://console.developers.google.com/cloud-resource-manager

Step 2 – Click on create project

  • Enter project name – YouTube M2 API
  • Organisation – No Organisation (unless you have one)

Step 3 – Once project is created, click on the project and select explore and enable APIs

Step 4 – Click on “Enable APIs and Services”

Step 5 – Search or Find YouTube Data API v3 and click Enable

Step 6 – Once enabled, create credential

Step 7 – Select the following options

  • Which API are you using? – YouTube Data API v3
  • Where will you be calling the API from? – Web server (e.g. node.js, Tomcat)
  • What data will you be accessing? – Public Data

Step 7 – Click on the button “What credentials do I need?” and next screen you will get YouTube API key

Step 8 – Magento admin → Stores → Configuration → Catalog → Catalog → Product Video and add YouTube API key

Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.

Similar Posts