How to Import YouTube Public API Data into Airtable

Jul 3, 2022Rosie Threlfall

In this easy-to-follow guide, we'll import publicly available data from Youtube into Airtable using the Data Fetcher extension. This tutorial does not need any code.

First, we'll create a Data Fetcher request to perform a search for YouTube channels based on a certain topic (i.e. search term) and import details such as the YouTube channel URL, thumbnail and description.

Next, we'll create a separate request to import the statistics related to each channel, such as view count, video count and subscriber count.

If you want to import detailed YouTube Analytics for your channel into Airtable, check out this tutorial instead.

Install Data Fetcher

Add Data Fetcher to your base from the Airtable marketplace. This is a free extension that enables you to import data from many online services such as Youtube.

After you have added the Data Fetcher extension to your Airtable base, either create a free Data Fetcher account or sign in to your existing account using the 'Have an account?' button on the bottom left of the screen.

It's also easy to sign-up to Data Fetcher with your Google account by selecting 'Continue with Google'.

Data Fetcher Sign Up

Import YouTube Public Data into Airtable

Select 'Create your first request' from the Data Fetcher home screen. Data Fetcher requests enable us to import our data. You can create multiple requests for each Airtable base within Data Fetcher, although you can only add one extension per base on the Airtable Free plan.

Create your first request in Data Fetcher

On the create request screen in Data Fetcher, for Application, select 'YouTube Public Data'.

select YouTube

Now, you need to connect your YouTube account by clicking New YouTube Public Data Connection.

Connect You tube to Data Fetcher

Sign in to your YouTube account and allow Data Fetcher access.

Link YouTube To Data Fetcher

You'll now see your YouTube Analytics is linked under connection.

Youtube-auth2.png

For Endpoint, select 'Search for channels'.

Youtube-Endpoint.png

Enter a Name for your request, e.g. 'Import YouTube Channels'. Then click 'Save & Continue'.

Import-YouTube-Data.png

Next, under Search query, enter the search query (i.e. the topic) you want to import YouTube channel results for. For this example, we are going to use the query 'automation' to find channels related to automation.

Youtube-Search-Query2.png

For Order by we will select 'Relevance' which means when we import our Youtube channels, they will be ordered in terms of relevance.

YouTube Relevance

If you want to avoid importing thousands of YouTube results, you can restrict the number you import. To do this, under advanced settings, scroll down to Pagination and set the toggle for 'Fetch all pages' to off. For this example, we'll set the 'number of pages' to 1. 

Advanced settings pagination

Click 'Save & Run'.

YouTube-Settings2.png

The request will now be sent to YouTube and the response field modal window will open. This is where you specify which data fields will be imported from YouTube into Airtable. You can also map them to existing fields in your Airtable spreadsheet or create new ones.

Select 'Filter all' to de-select any pre-selected fields, then use the 'Find field' search bar to locate the fields you wish to import.

For this example, we'll import the 'Channel Id', 'Title', 'Description', and 'Default Thumbnail URL'. For the 'Title' field, map this to the existing 'Name' field, and all the others will be mapped to new fields that will be created for us in Airtable.

Click 'Save & Run'.

Youtube-mapping.png

Next, view your output table and add a new formula field called URL.

YouTube-Output-Table.png

Copy and paste this line into the URL formula field:

CONCATENATE("https://www.youtube.com/channel/",{Channel Id})

Click 'Save'.

you-tube-formula.png

You'll now see the URL of each YouTube channel in the URL column:

YouTube-Output-Table2.png

Import YouTube Channel Statistics to Airtable

Next, we will import the (publicly available) statistics for each of these YouTube channels and we'll need to create a separate request in Data Fetcher to do this.

Click on the 'EXTENSIONS' tab in the top right of your Airtable interface.

YouTube-Extentions.png

Click on 'Create request'.

Youtube-New-Request2.png

Create a new request and chose 'YouTube Public Data' for Application and 'Details for one or more channels' for Endpoint. Give your request a name, e.g. 'Import Channel Stats'.

Click 'Save & Continue'.

Youtube-New-Request.png

On the next screen, for Fields choose 'Statistics'.

YouTube-fields.png

For Channel Ids click the '+' button to add a reference to our output table.

YouTube-Channel-ID.png

Select a reference to your Table (we are using 'Table 1' in this example) and select the 'Channel Id' for the Field option to reference the 'Channel Id' field in the output table.

YouTube-table-ref.png

Then click 'Save & Run'.

YouTube-Request2-settings.png

In the Response field mapping modal, import 'View count', 'Video count', and 'Subscriber count'.

YouTube-mapping2.png

Data Fetcher will then run the request between Airtable and YouTube, and your output table will be populated with the requested stats for each YouTube channel.

YouTube-output-table3.png

Lookup and Import YouTube Public Data Automatically

At the moment, we have to manually click the 'Run' button for each request to look up the info from YouTube. It is possible to combine the two requests into a sequence, so they run together.

On the Data Fetcher home screen, click the blue dropdown icon on the 'Create request' button. Then click 'Create sequence'.

YouTube-create-request.png

Give the sequence a name, e.g. 'Search & Import YouTube Data'.

YouTube-sequence.png

Select 'Import YouTube Channels' for the first request and 'Import Channel Stats' for the second. Then click 'Save'. We've now created a sequence that will run both of our requests to search for and import YouTube channel data and their related stats.

Schedule YouTube to Airtable Requests Automatically

After following these steps, you would still currently need to manually click 'Run' in Data Fetcher to import any updates or changes made to the YouTube stats and other data.

By using Data Fetcher's scheduling feature, you can run this sequence of requests automatically at regular intervals so Data Fetcher will periodically check for changes in the YouTube data for you.

This is a paid Data Fetcher feature, so you will need to upgrade your account. To do this, in Data Fetcher, scroll to Schedule and click 'Upgrade'.

schedule-requests.png

Select a plan from the options and enter your payment details to upgrade. There are different plans depending on your needs.

data fetcher upgrade pricing plans.png

Return to Data Fetcher and click 'I've done this'.

schedule-upgrade.png

Under Schedule click '+ Authorize'.

Schedule Data Fetcher

A new window will now open and prompt you to authorize the Airtable bases you want Data Fetcher to access.

We recommend selecting 'All current and future bases in all current and future workspaces' to avoid any issues with unauthorized bases in the future.

Click 'Grant access'.

schedule-authorize-bases.jpg

Back in Data Fetcher, you'll see Schedule this request is now toggled on.

Select a schedule based on intervals of 'Minutes', 'Hours', 'Days' or 'Months'. Click 'Save', and any new data will automatically import into your Airtable base on your chosen schedule.

schedule-this-request.png

Other Recent Posts

How to Scrape Instagram into Airtable using RapidAPI

How to Scrape Instagram into Airtable using RapidAPI

Apr 11, 2024

Andy Cloke

RapidAPI
How to Look Up Data in Airtable When a New Record is Created

How to Look Up Data in Airtable When a New Record is Created

Mar 2, 2024

Andy Cloke

No-CodeAirtable
How to Sync Pipedrive Data to Airtable Automatically

How to Sync Pipedrive Data to Airtable Automatically

Feb 13, 2024

Andy Cloke

Pipedrive