> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: Connecting to YouTube

> Connect YouTube data to Integrate.io ETL. Set up Google OAuth authorization and configure a pipeline to read YouTube channel and video data.

Integrate.io ETL can access your YouTube data. This article details creating the YouTube connection and the process of building a data pipeline to read YouTube data in Integrate.io ETL. There are also pre-built templates to read data from YouTube. Please see [Create a package from a template](/etl/create-a-package-from-a-template) for instructions on using a template.

## To create a YouTube connection In Integrate.io ETL

<Steps>
  <Step>
    Click the **Connections** icon (lightning bolt) on the top left menu.
  </Step>

  <Step>
    To create a connection, click **New connection**.

    <Frame>
      <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-279.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=e002fb533e7c59792156b06254a70be9" alt="New connection button in the Connections menu" width="1200" height="828" data-path="images/connectivity-and-security/image-279.webp" />
    </Frame>
  </Step>

  <Step>
    Choose YouTube.

    <Frame>
      <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-280.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=3153bb36e72dd1d4fe65330a329218ff" alt="Selecting YouTube from the connection type list" width="1200" height="828" data-path="images/connectivity-and-security/image-280.webp" />
    </Frame>
  </Step>

  <Step>
    (If required, sign in to YouTube)
  </Step>

  <Step>
    Click **Authenticate** to authorize Integrate.io ETL access to your YouTube account.
  </Step>

  <Step>
    In the new YouTube connection window, name the connection and click **Create YouTube connection.**
  </Step>
</Steps>

## To modify YouTube connections in Integrate.io ETL

<Steps>
  <Step>
    Click the **Connections** icon (lightning bolt) on the top left menu.
  </Step>

  <Step>
    Click a connection to open it and re-connect if your password has changed or the token has expired. Make any necessary changes, then click Reconnect, and Save changes. To exit the connection window without changes, click Back to connections (grey tab on the left side) on the connection window.
  </Step>

  <Step>
    To delete a YouTube connection, click on the three vertical dots on the far right of the connection listing and select the Delete connection option.
  </Step>
</Steps>

## To build a data pipeline to read YouTube channel list data in Integrate.io ETL

<Frame>
  <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-281.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=ea98c117745bcf9f5db0098f32073010" alt="YouTube channel list data pipeline overview in the package designer" width="1200" height="828" data-path="images/connectivity-and-security/image-281.webp" />
</Frame>

## REST API Component: Channels\_List

* **Authentication** - Click **Connection** and then select your YouTube connection. If you haven't created your YouTube connection yet, click **+ New** and follow the instructions found above.
  <Frame>
    <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-282.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=8f4b21daa9e884d5f8a029e91c56c145" alt="REST API component authentication with YouTube connection selected" width="2052" height="842" data-path="images/connectivity-and-security/image-282.webp" />
  </Frame>
* **URL** - Enter the URL for the Channel List endpoint of the YouTube API: **`https://www.googleapis.com/youtube/v3/channels?part=snippet%2CcontentDetails%2CbrandingSettings%2Cstatistics&id=$Channel_id`**. Replace the variable `$Channel_id` with your Channel ID. Make sure the method is set to **GET.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-283.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=bd1fd539ca2d20cbeb36df239a722c46" alt="YouTube Channel List API endpoint URL configuration" width="2114" height="634" data-path="images/connectivity-and-security/image-283.webp" />
  </Frame>
* **Response** - Make sure the **JSON** response type is selected as well as the **Object** record type.
  <Frame>
    <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-284.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=c1fcd45cc210ddd3aedf445504fd8b0b" alt="JSON response type with Object record type selected" width="1712" height="686" data-path="images/connectivity-and-security/image-284.webp" />
  </Frame>
* **Input fields** - Click **Select all** to move all the Available fields over to the Selected fields or pick and choose which fields you would like by clicking on the **+** icon next to the field name in the Available Fields column. Then click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-285.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=769f1771d96df3a952ffd3a9791f452f" alt="Input fields selection with available and selected fields" width="2184" height="1222" data-path="images/connectivity-and-security/image-285.webp" />
  </Frame>

## Select Component: Extract\_Channel\_Fields

* Click **Autofill** to bring in all the fields from the source component. Parse the nested fields inside the four Map fields (snippet, contentDetails, statistics, and brandingSettings) using this syntax: field\_name#'key' For example, **snippet#'title'**. For the nested field called relatedPlaylist inside the contentDetails field, use the JsonStringToMap function and then parse the keys within it (for more information on the JsonStringToMap function see [this](/etl/jsonstringtomap/) article; for information on processing JSON data see [this](/etl/how-do-i-process-json-data/) article) like this: **JsonStringToMap(contentDetails#'relatedPlaylists')#'likes'**. Click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-286.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=7f19a6f3c54d60e02d3a255f4d30006c" alt="Select component extracting nested channel fields from Map types" width="1094" height="822" data-path="images/connectivity-and-security/image-286.webp" />
  </Frame>

## Destination Component: Channels\_List\_Table

* The template shows a Redshift destination component; however, if you'd prefer to use a different destination, delete the Redshift component and select a destination component of your choice.
  <Frame>
    <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-287.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=3367d2912ea2dd2ae8cf76ccd7b7ff7a" alt="Redshift destination component in the pipeline designer" width="788" height="824" data-path="images/connectivity-and-security/image-287.webp" />
  </Frame>
* **Choose target connection** - Select your target connection. If you haven't created your connection yet, click **+ New.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-288.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=d05905dd0098c9925b412f9fec8ec1f4" alt="Target connection selection dropdown" width="2062" height="688" data-path="images/connectivity-and-security/image-288.webp" />
  </Frame>
* **Destination properties** - Fill in the values for target schema and table, select an operation type, pre or post-action SQL, and advanced options.
* **Schema mapping** - Click **Auto-fill** to bring in all of the fields. If you've selected a Merge operation type, click the **Key** box next to the merge key field(s). Click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/K1OxIkBgHF64pvnH/images/connectivity-and-security/image-289.webp?fit=max&auto=format&n=K1OxIkBgHF64pvnH&q=85&s=df5c3ab12eba9904ff7e67e9245a1d37" alt="Schema mapping with auto-filled fields and merge key selection" width="2188" height="1486" data-path="images/connectivity-and-security/image-289.webp" />
  </Frame>
