Skip to main content
Google Classroom is a free learning management system developed by Google as part of Google Workspace for Education. It helps educators manage coursework, assignments, and communication.
This page covers how to load data from Google Classroom using the GoogleClassroomLoader. The loader fetches courses, assignments (courseWork), announcements, course materials, student submissions, rubrics, topics, and class rosters from the Classroom API and converts each item into a LangChain Document. When file attachments are present on classroom items, the loader automatically downloads and parses them from Google Drive—supporting PDF, DOCX, CSV, plain text, Google Docs, Sheets, Slides, and images. Learn more about the package on GitHub.

Overview

Integration details

Prerequisites

To use this loader, you will need:
  1. A Google Cloud project
  2. The Classroom API enabled
  3. The Drive API enabled (for file attachments)
  4. One of the following authentication methods:
    • OAuth 2.0 credentials—for personal Google accounts or testing
    • Service Account credentials—for Google Workspace domains (production)

Installation

Install the integration package:
To enable parsing of PDF and DOCX attachments, install with the optional parsers extra:

Credentials

Option A: OAuth 2.0 (personal accounts)

  1. In the Google Cloud Console, create an OAuth 2.0 Client ID (Desktop application).
  2. Download the client secrets file and save it as credentials.json in your working directory.
  3. On first run, a browser window will open for user consent. The resulting token is cached to token.json for subsequent runs.

Option B: Service Account (Google Workspace)

  1. In the Google Cloud Console, create a Service Account.
  2. Enable Domain-Wide Delegation for the service account.
  3. Download the key file and save it as service_account.json.

Instantiation

Constructor parameters

Load documents

Use load() to fetch all documents at once:
Each Document has structured page_content and rich metadata:

Lazy loading

For large courses or memory-constrained environments, use lazy_load() to stream documents one at a time:

Async loading

The loader supports async iteration via alazy_load():

Loading additional data types

Student submissions

Topics

Class roster (students and teachers)

File attachment parsing

When load_attachments=True (the default), the loader resolves Google Drive file attachments on each classroom item and parses them into additional Document objects.

Supported formats

Using a vision LLM for images

To process image attachments and extract visual context from PDF pages, provide a vision-capable model:

Using a custom file parser

You can replace the built-in parsers with any BaseBlobParser subclass:

API reference