How to add Product Video using YouTube API Key in Magento 2

In today’s digital age, integrating videos into your e-commerce website can significantly enhance the user experience and boost sales. Magento 2, a robust e-commerce platform, allows you to seamlessly integrate product videos using the YouTube API key.

Have you ever made a purchase and had that moment of realization, ‘Wait, this isn’t what I had in mind’? Videos wipe away that element of surprise. They offer your customers a clear view of what they’re investing in, erasing any uncertainty. It’s akin to unwrapping a gift and discovering precisely what you had hoped for 🎥 🚀

Steps to Integrating YouTube Video on the Magento 2 product page:

1. Get Your YouTube API Key
  1. First, you have to log in to your Google account for YouTube API key and go to Google Developers Console.
  2. After logging in create a new project by clicking on “New Project” on the right side of page.

3. Type “YouTube” in the search box and click on “Youtube Data API v3“.


4. Then click on “Enable“.


5. After enabling, click on “Create Credential” then configure.

6. Copy your “API Key”.

2. Configure the API key in Magneto 2
  1. Log in to admin and navigate to Store > Configuration > Catalog > Catalog and in the Product Video section paste your API key and Save Config.
3. Configure the Product in Magneto 2 Admin
  1. Navigate to Admin > Catalog > Product > Add or Edit Product > Images and Videos

2. If you get an error message while adding video, it means your API is not Correct, first you have to setup the API correctly

3. Click on Add Video and Paste your YouTube video URL

That’s it, Now you are able to see YouTube videos on the image gallery of the Product detail page.

For Vimeo setup, you need to follow the same steps. For More check Offical DevDocs.

Congratulations you have successfully configured YouTube video in your Magento 2 store, If you still getting issues after following the above steps please have a look at this Article.

Thank you for reading my Article! Feel free to share your thoughts or ask any questions in the comments section below and spread the word by sharing. Your engagement is appreciated!

2 thoughts on “How to add Product Video using YouTube API Key in Magento 2”

Leave a reply

Your email address will not be published. Required fields are marked *

Cookies Notice

Our website use cookies. If you continue to use this site we will assume that you are happy with this.