Connecting to YouTube

The Sisense YouTube connector is a certified connector that allows you to import data from the YouTube API into Sisense via the Sisense generic JDBC connector. The YouTube connector offers the most natural way to easily consume YouTube account Comments, Captions, Activities, and more, and provides additional powerful features.

The Sisense YouTube is a certified connector. The support for the connector is provided by Sisense and will be assisted by the certification partner's support, if needed. For any support issues or additional functionality requests, please contact your Sisense representative or open a request through our Help Center. For advanced inquiries, you can also contact our certification partner’s support directly via [email protected].

After you have downloaded and installed the connector, you can connect to the YouTube API through a connection string you provide Sisense. The connection string is used to authenticate users who connect to YouTube’s API. To obtain a connection string, you will need to create a YouTube app. Once you have connected to YouTube, you can import a variety of tables from the YouTube API.

This page describes how to download the YouTube driver and deploy it, how to connect to YouTube with a connection string, provides information about the YouTube data model, and more.

Downloading the YouTube JDBC Driver

You can download the YouTube JDBC driver here.

Deploying the YouTube JDBC Driver

To run the setup, execute the following command: java -jar setup.jar (OR, if your system is set up to run Java applications, double-click on setup.jar).
During the installation, pay attention to the path of the installation (you will need it later on, to direct Sisense to the Jar file. The default path is C:\Program Files\CData\CData JDBC Driver for YouTube\lib).
Note: The install file (setup.jar) is a Java application that requires Java 6 (J2SE) or above to run. If you do not have Java 6 installed, you may download it from here.

Connecting to YouTube

To access YouTube’s REST API from Sisense, you must provide valid Oauth YouTube credentials through a connection string. These credentials are provided by YouTube when you create an application.

After you receive your credentials from YouTube, you can create the connection string and provide Sisense with it to connect to your data.

Creating an App

You can follow the procedure below to register an app and obtain the OAuth client credentials, the OAuthClientId and OAuthClientSecret:

  1. Log in to the Google Developers Console.
  2. Click Create Project or select an existing project.
  3. In the API Manager, click Credentials > Create Credentials > OAuth Client Id.
  4. Click Configure Consent Screen to customize the information displayed to users when they connect.
  5. If you are connecting from a desktop application, click Other in the Application Type section. If you are connecting from a Web application, click the Web Application option. In the Authorized Redirect URIs box, enter the URL you want to be used as a trusted redirect URL, where the user will return with the token that verifies that they have granted your app access.
  6. Click Create. The OAuthClientId and OAuthClientSecret are displayed. Save these credentials as they need to be passed to YouTube in the connection string when importing data into Sisense.
  7. Click OK.
  8. Select Library > YouTube Data API.
  9. Click Enable.

Creating a Connection String

Sisense uses connection strings to connect to YouTube and import data into the ElastiCube Manager. Each connection string contains authentication parameters that the data source uses to verify your identity and what information you can export to Sisense.

After you have obtained the relevant credentials, you can create the connection used to connect to your YouTube account. The YouTube connection string has the following structure:

jdbc:DataSourceName:Property1=Value1;Property2=Value2;

The following is an example of a YouTube connection string:

jdbc:youtube:OAuthClientId=112345383774486;OAuthClientSecret=064c524478d712534b7e7e4224fad;

InitiateOAuth=GETANDREFRESH;Version=2.10;CallbackURL=http://localhost/33333;

The example above includes mandatory parameters you can provide in the connection. The required parameters are emphasized in bold.

Mandatory Parameters

Alternatively, you can keep the OAuthClientId and the OAuthClientSecret parameters empty to redirect your users to the YouTube authentication page where they can log in to their accounts to access their tables without creating a YouTube app.

If you have any issues connecting to your data source, see Troubleshooting JDBC Data Connectors.

Adding YouTube Tables to your ElastiCube

  1. In the Data page, open an ElastiCube or create a new ElastiCube.
  2. In the Model Editor, click . The Add Data dialog box is displayed.
  3. Click Generic JDBC to open the JDBC settings.

  4. In Connection String, enter the YouTube URL. See Creating a Connection String for more information.
  5. In JDBC JARs Folder, enter the name of the directory where the YouTube JAR file is located (see Deploying the YouTube JDBC Driver).
  6. In Driver's Class Name, enter the following class name: cdata.jdbc.youtube.YouTubeDriver.
  7. In User Name and Password, enter your YouTube credentials. These fields are not required if the user name and password were provided in the connection string. 
  8. Click Next. A list of tables in the database are displayed. All tables and views associated with the database will appear in a new window.
  9. From the Tables list, select the relevant table or view you want to work with. You can click next to the relevant table or click Preview to see a preview of the data inside it. 
  10. (Optional) Click + to customize the data you want to import with SQL. See Importing Data with Custom Queries for more information.
  11. After you have selected all the relevant tables, click Done. The tables are added to your data model.

YouTube Connector: Additional Resources

For the full documentation set for the YouTube connector, click here.

For connection string options, click here.

For information on the YouTube data model, click here.