Skip to main content

YouTube

YouTube is the world's largest video-sharing platform, enabling users to upload, view, and interact with videos across a vast range of topics including entertainment, education, and news.

YouTube icon

Power end-to-end data operations for your YouTube API with Nexla. Our bi-directional YouTube connector is purpose-built for YouTube, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to YouTube or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your YouTube workflows fast, secure, and fully governed.

Features

Type: API

SourceDestination

  • Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
  • Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
  • API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
  • Request optimization with intelligent batching, retry, and caching to minimize API calls and costs

Prerequisites

Before creating a YouTube credential in Nexla, you need to set up an OAuth 2.0 integration in the Google Cloud Console and obtain the required credentials. This integration enables programmatic access to the YouTube Data API without requiring user interaction for each request.

OAuth 2.0 Setup

OAuth 2.0 authentication provides secure, token-based access to the YouTube Data API with automatic token refresh. The OAuth flow allows Nexla to access your YouTube account on your behalf. For detailed information about setting up OAuth 2.0 authentication, see the YouTube Data API documentation.

  1. Access Google Cloud Console: Sign in to your Google account and navigate to the Google Cloud Console.

  2. Create a Project: Create a new project or select an existing project in the Google Cloud Console. This project will contain your OAuth 2.0 credentials.

  3. Enable YouTube Data API: Navigate to APIs & Services > Library in the Google Cloud Console, search for "YouTube Data API v3", and click Enable to enable the API for your project.

  4. Create OAuth 2.0 Credentials: Navigate to APIs & Services > Credentials in the Google Cloud Console, and click Create Credentials > OAuth client ID.

  5. Configure OAuth Consent Screen: If you haven't configured the OAuth consent screen, you'll be prompted to do so. Complete the consent screen configuration with your application information.

  6. Configure OAuth Client: Select Web application as the application type, and configure the authorized redirect URIs. The redirect URI should match the callback URL provided by Nexla during the OAuth flow.

  7. Obtain Client Credentials: After creating the OAuth client, copy your Client ID and Client secret from the credentials page. These credentials are used to authenticate with the YouTube Data API OAuth 2.0 service.

  8. Configure API Scopes: Ensure that the following scopes are requested during the OAuth flow:

    • https://www.googleapis.com/auth/youtube.readonly - Read-only access to YouTube account data
    • https://www.googleapis.com/auth/yt-analytics.readonly - Read-only access to YouTube Analytics data
    • https://www.googleapis.com/auth/userinfo.email - Access to user email information

Authenticate

Create a credential in Nexla

  1. After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

New Credential Overlay – YouTube

YouTubeCred.png
  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  2. Complete the OAuth authorization flow by following the prompts to authorize Nexla to access your YouTube account. The OAuth flow will automatically handle token exchange and refresh. During the authorization process, you will be redirected to Google to grant permissions to Nexla.

    The OAuth 2.0 flow provides secure, token-based access to the YouTube Data API with automatic token refresh. The authorization process requires you to sign in to your Google account and grant permissions to Nexla. For detailed information about YouTube Data API authentication, see the YouTube Data API documentation.

    All OAuth configuration settings are automatically handled by Nexla. You only need to complete the authorization flow by clicking the Authorize button and granting permissions to Nexla in the Google authorization page. The OAuth flow will request the following scopes: read-only access to YouTube account data, read-only access to YouTube Analytics data, and access to user email information.

  3. Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.

Use as a data source

To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the YouTube connector tile, then select the credential that will be used to connect to the YouTube instance, and click Next; or, create a new YouTube credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common YouTube endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.

Get My Most Popular Videos

This endpoint template fetches statistics for your most popular videos. Default configuration fetches basic statistics for US. Update the region code and video properties to fetch other slices of data. Use this template when you need to access video statistics, popularity data, or video metadata for analysis, reporting, or integration purposes.

  • Enter the Properties to Fetch in the Properties to Fetch field. This should be a comma-separated list of one or more video resource properties that the API response will include (e.g., snippet,statistics). The default value is snippet,statistics. The Properties to Fetch determines which video properties will be included in the response.
  • Enter the Region Code in the Region Code field. This should be the region to fetch the statistics for. The parameter value is an ISO 3166-1 alpha-2 country code (e.g., US for United States, GB for United Kingdom). The default value is US. The Region Code determines which region's statistics will be retrieved.

This endpoint fetches statistics for your most popular videos from the YouTube Data API, including video IDs, titles, descriptions, view counts, like counts, and other video metadata. The endpoint uses token-based pagination to handle large result sets efficiently. Nexla will automatically follow the pagination to fetch subsequent pages of video data.

For detailed information about videos, API response structures, pagination, and available video data, see the YouTube Data API documentation.

Get Activities for Channel

This endpoint template fetches a list of activity events for a channel. Update the region code and properties to fetch other slices of data. Use this template when you need to access channel activity data, event information, or activity metadata for analysis, reporting, or integration purposes.

  • Enter the Channel ID in the Channel ID field. This should be the channel ID to fetch activities for. The Channel ID determines which channel's activities will be retrieved.
  • Enter the Properties to Fetch in the Properties to Fetch field. This should be a comma-separated list of one or more resource properties that the API response will include (e.g., snippet,contentDetails). The default value is snippet,contentDetails. The Properties to Fetch determines which activity properties will be included in the response.
  • Enter the Region Code in the Region Code field. This should be the region to fetch the statistics for. The parameter value is an ISO 3166-1 alpha-2 country code (e.g., US for United States, GB for United Kingdom). The default value is US. The Region Code determines which region's statistics will be retrieved.

This endpoint fetches a list of activity events for a channel from the YouTube Data API, including activity IDs, types, timestamps, and other activity metadata. The endpoint uses token-based pagination to handle large result sets efficiently. Nexla will automatically follow the pagination to fetch subsequent pages of activity data.

For detailed information about activities, API response structures, pagination, and available activity data, see the YouTube Data API documentation.

Get Analytics Report

This endpoint template fetches YouTube analytics report data. Modify the query parameters to specify a channel ID or content owner, a start date, an end date, and at least one metric. Use this template when you need to access YouTube Analytics data, performance metrics, or analytics reports for analysis, reporting, or integration purposes.

  • Enter the Start Date (YYYY-MM-DD) in the Start Date (YYYY-MM-DD) field. This should be the start date for fetching YouTube Analytics data in YYYY-MM-DD format. You can also use Nexla macros like `{now}`, `{now - 1}` etc. The default value is `{now-2}` (two days ago). The Start Date determines the beginning of the date range for analytics data.
  • Enter the End Date (YYYY-MM-DD) in the End Date (YYYY-MM-DD) field. This should be the end date for fetching YouTube Analytics data in YYYY-MM-DD format. You can also use Nexla macros like `{now}`, `{now - 1}` etc. The default value is `{now-1}` (yesterday). The End Date determines the end of the date range for analytics data.
  • Enter the Channel or Owner IDs in the Channel or Owner IDs field. This should identify the YouTube channel or content owner for which you are retrieving YouTube Analytics data. Enter as channel==CHANNEL_ID or contentOwner==OWNER_NAME as applicable. The default value is channel==MINE. The Channel or Owner IDs determines which channel or content owner's analytics will be retrieved.
  • Enter the Metrics in the Metrics field. This should be a comma-separated list of YouTube Analytics metrics, such as views, likes, dislikes. The default value is views,comments,likes,dislikes,estimatedMinutesWatched,averageViewDuration. The Metrics determines which analytics metrics will be included in the report. See the endpoint documentation link for the list of available metrics.

This endpoint fetches YouTube Analytics report data from the YouTube Analytics API, including views, comments, likes, dislikes, estimated minutes watched, average view duration, and other analytics metrics. The endpoint returns analytics data for the specified date range, channel, and metrics.

For detailed information about YouTube Analytics reports, API response structures, available metrics, and query parameters, see the YouTube Analytics API documentation.

Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.

Manual configuration

YouTube data sources can also be manually configured to ingest data from any valid YouTube Data API or YouTube Analytics API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.

YouTube Data API endpoints typically follow the pattern https://www.googleapis.com/youtube/v3/{endpoint_path}, and YouTube Analytics API endpoints follow the pattern https://youtubeanalytics.googleapis.com/v2/{endpoint_path}. The endpoint requires OAuth 2.0 authentication via the Authorization header, which is handled automatically by your credential configuration.

Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new YouTube data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.