🚀 New: Run requests via webhooks. Learn more
In this easy-to-follow guide, we'll import publicly available data from Youtube into Airtable using the Data Fetcher extension.
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.
This tutorial does not need any code.
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'.
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.
On the create request screen in Data Fetcher, for Application, select 'YouTube Public Data'.
Now, you need to connect your YouTube account by clicking New YouTube Public Data Connection.
Sign in to your YouTube account and allow Data Fetcher access.
You'll now see your YouTube Analytics is linked under connection.
For Endpoint, select 'Search for channels'.
Enter a Name for your request, e.g. 'Import YouTube Channels'. Then click 'Save & Continue'.
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.
For Order by we will select 'Relevance' which means when we import our Youtube channels, they will be ordered in terms of 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.
Click 'Save & Run'.
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'.
Next, view your output table and add a new formula field called URL.
Copy and paste this line into the URL formula field:
You'll now see the URL of each YouTube channel in the URL column:
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.
Click on 'Create request'.
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'.
On the next screen, for Fields choose 'Statistics'.
For Channel Ids click the '+' button to add a reference to our output table.
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.
Then click 'Save & Run'.
In the Response field mapping modal, import 'View count', 'Video count', and 'Subscriber count'.
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.
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'.
Give the sequence a name, e.g. 'Search & Import YouTube Data'.
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.
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'.
Select a plan from the options and enter your payment details to upgrade. There are different plans depending on your needs.
Return to Data Fetcher and click 'I've done this'.
Click 'Add API key' and copy and paste your Airtable API key. You can find your Airtable API key here.
Enter your Airtable API key and click 'Save'.
Toggle Schedule this sequence.
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.
Aug 9, 2022•
Rosie Threlfall•Currency ConversionWebhook