Import YouTube API Data to Google Sheets

In this guide, we’ll walk through how to pull data from the YouTube Data API directly into Google Sheets using the API Connector add-on for Sheets. We’ll first get an API key from YouTube, and then set up a request to pull in video details and metrics from YouTube to your spreadsheet.



YouTube requires that all API requests contain an API key. This is the detailed, step-by-step process to get your YouTube API key:

  1. Navigate to If this is your first time accessing this page, you’ll be prompted to accept Google Cloud Platform’s terms of service. Click agree and continue.
  2. Now in the top left, click Select a Project, which will open up a modal. Click New Project
  3. This will open up the New Project modal. You can name your project anything, but let’s call it YouTube API. You’ll also be prompted to browse for a Location (aka folder). For our purposes here, it doesn’t matter which one you pick.
  4. Once you create your project, click on Credentials in the left-hand menu. Next, click the Create credentials dropdown and click ‘API key’.
  5. Your YouTube API key is now ready. You’ll see a screen containing your API key; copy this to your clipboard and click Close.
  6. There’s still one last step: you need to enable the YouTube API in your project. To do this, click Library and search for ‘YouTube Data API’. Alternately, you can navigate there directly with this link: Click Enable as shown:
  7. Congrats, you’re done! You now have access to the YouTube Data API, and can start pulling YouTube data into Google Sheets.


We’re going to follow the YouTube API documentation to search for specific types of videos using the “search” endpoint.

  • API root:
  • Endpoint: /search
  • Parameters: ?part=snippet&key=YOUR_API_KEY
    Parameters Example: ?part=snippet&key=12345

Putting this all together, we get the full API Request URL:

Where it says YOUR_API_KEY, you’ll need to substitute your actual API key from part 1 (step 5) above.



We’re now ready to enter all our values into API Connector and import YouTube data into Google Sheets:

  1. Open up Google Sheets and click Add-ons > API Connector > Create New API Request
  2. In the Create Request interface, enter the Request URL we just created:
  3. Leave Headers empty as we don’t need them for this request.
  4. Create a new tab. You can call it whatever you like, but here we’ll call it ‘YouTube’. While still in that tab, click ‘Set’ to use that tab as your data destination.
  5. Name your request. Again we’ll call it ‘YouTube’
  6. Click Run and a moment later you’ll see some YouTube data populate the YouTube tab:



  1. Now that the basic Request URL is set up, you can modify it using parameters listed in the documentation. For example, you may want to change the number of results to 50 (default is 5) and search for videos related to a specific query string, say ‘google sheets’. You’d do that using the parameters ‘maxResults’ and ‘q’, creating the following request URL: sheets&maxResults=50


  2. To see a list of all the videos in a playlist, change the API URL path to include the playlistId parameter:

    You can find your playlist ID by clicking into a YouTube video in your playlist and checking the URL. It will be located inside the list parameter.

  3. To see statistics like views and subscribers for your own channel (or any public channel), you can use the following URL. Substitute in your own channel ID, which you can get in YouTube by clicking on your photo in the top right corner, then Settings > Advanced Settings > Channel ID:
  4. You can filter your results using the “fields” parameter as described here: For example:,contentDetails,statistics&id=VIDEO_IDs&key=YOUR_API_KEY&fields=items(id),items(snippet(publishedAt,title)),items(contentDetails(duration)),items(statistics(viewCount,likeCount,dislikeCount,commentCount))

4 thoughts on “Import YouTube API Data to Google Sheets”

  1. Hi Ana, thank you for this, I managed to set up my API url. how do I get the full url of the Youtube videos into google sheets? sorry completely new to this . I’ve set up an api to search for videos with the keyword podcasting and want to get the full url link of the videos as well as the channel IDs, what do I need to add extra from this:{API_key}&q=google sheets&maxResults=50 ?

    • Hey Riva, have you run that search request yet? If so, in the response you should see a field called items » id » videoId. YouTube doesn’t return the full URL, but it’s easy to construct it yourself by adding that value to the YouTube base URL (
      For example, when I run the search request for ‘podcasting’, in cell J2 under the items » id » videoId header, I see an ID of PIJpOcFf5h4.
      In a new column, I can make a formula like =""&J2 to get the full URL of the YouTube video. Of course you can copy this down or, even better, add it to an array formula like =arrayformula(""&J2:J) to get the URLs for all the video IDs returned by the API. Let me know if that makes sense!

  2. Will you be adding a walkthrough of how to to set up Youtube Data Api / Analytics for your own channel reports? The documentation has me very confused!

    • Hi, yes! I totally understand, Google makes extremely confusing documentation. I added a line on getting data for your own channel, please let me know if that’s what you were looking for.


Leave a Comment