Skip to main content
All CollectionsOctoparse AI Essentials
How to Connect Octoparse AI to Google Sheets

How to Connect Octoparse AI to Google Sheets

Learn how to set up OAuth 2.0 credentials to enable Octoparse AI to automate tasks in Google Sheets.

Jane avatar
Written by Jane
Updated today

💡To allow Octoparse AI to access and edit your Google Sheets, you'll need to create access credentials first. This tutorial will walk you through the steps.

For a more detailed guide, you can also refer to Google's official documentation here.

Step 1: Go to Google Cloud Console

  1. Open this link: Google Cloud Console.

  2. If you're new to the Google Cloud Console, create a new project. Follow the on-screen prompts to complete the project setup.


Step 2: Configure the Google OAuth Platform

  1. In the Google Cloud Console, navigate to the OAuth consent screen.

  2. Complete the required fields, such as the App Name and Support Email.


Step 3: Create a Client

  1. After configuring the OAuth platform, go to the Client section in the Google Cloud Console.

  2. Click on Create client.

  3. Follow the prompts to create the OAuth 2.0 client for your project.


Step 4: Enable the Google Sheets API

  1. In your project, go to the APIs & Services section in the left sidebar.

  2. Find the Google Sheets API and enable it. This step allows Octoparse AI to access your Google Sheets.


Step 5: Set Up Data Access Permissions

  1. Go to the OAuth consent screen and configure the scopes under the Data Access section.

  2. Ensure you select the correct scopes to allow access to Google Sheets.


Step 6: Add a Tester

Under Audience, add your Google account as a tester. This allows Octoparse AI to access your Google Sheets.

Step 7: Connect to Google Sheets in Octoparse AI

  1. Copy your credentials: Go to the Client section in Google Cloud Console, then copy your Client ID and Client Secret.

  2. Open Octoparse AI and follow these steps:

    1. Create an App: Start a new workflow in Octoparse AI to test the connection.

    2. Add Commands: Add the commands needed to interact with Google Sheets and fill in the fields as shown in the following sections.


App Setup in Octoparse AI

🤖In the following steps, we will show you how to configure an app in Octoparse AI to link to your Google Sheet, enabling automatic data retrieval from the sheet.

Command#1: Get Google Sheets API Credentials

Paste your Client ID and Client Secret from Google Cloud Console into the appropriate fields in Octoparse AI.

Command #2: Get Google Spreadsheet

  1. Get the Google Sheet link from your Google account.

  2. Enter the sheet name into Octoparse AI. This will create an object for you to use in the next steps.

📌Note: The "sheet name" refers to the name of the tab within your Google Spreadsheet (e.g., Sheet1), not the file name of the spreadsheet.

Command #3: Read Google Sheets

Define what data you want to read from your sheet (e.g., specific rows or columns).

Final Step: Running the App to Retrieve Data from Google Sheets

After you've finished setting up your app in Octoparse AI, here's how to pull data from your Google Sheet:

  • Verifying the Connection:

    1. Click the "Run" button located at the top of the canvas.

    2. A Chrome window will appear, prompting you to log in to your Google account and grant Octoparse AI permission to access your Google Sheet. Click "Continue" to proceed.

    3. Once the connection is successful, you'll see a message that reads, "Received verification code. You may now close this window." This confirms that Octoparse AI is now linked to your Google Sheet.

  • Retrieving the Data:

    1. Click the "Run" button again to initiate the data extraction.

    2. Octoparse AI will now begin pulling the data from your Google Sheet, based on the specifications you defined during the setup process.

Troubleshooting

If you encounter any errors, here are some common issues and their solutions:

  1. Error 403: Access Denied

    1. Cause: This error occurs if your Google account hasn’t been added as a tester for the Client ID.

    2. Solution: Follow Step 4 to add your Google account as a tester in the Google Cloud Console, then try again.

  2. Other Errors After Completing the Setup

    1. Cause: The OAuth Client ID may take anywhere from 5 minutes to a few hours to become fully active.

    2. Solution: Wait for a short period, then try running the app in Octoparse AI again.

If the issue persists, feel free to contact us at [email protected]. Please attach a screenshot of the error so we can quickly assist you in resolving the issue.

Did this answer your question?