Step 1: Go to Google API Console and log in with your Google account.
Step 2: Click on YouTube Data API
Step 3: Click on Create Project
Step 4: Create the new project (you can give it any name you would like)
Step 5: Click on Enable
Step 6: Go to Credentials in the left hand menu and Create Credentials and Choose API Key
Step 7: Copy your new API Key (when you past in the key make sure there are no spaces at the beginning or end)