DeployGet started

Google Drive API

Interact with Google Drive to list files and track changes. This API lets you search, filter, and monitor files and changes in a user's or shared drive.

Version 1.0.04 endpoints
Google Drive API logo

Endpoints

GET/changeschanges_list

Lists all changes (file modifications, deletions, additions) that have occurred in Drive **since a given start page token**. **To list files changed since a specific date:** 1. First, call `/changes/startPageToken` at or just after your desired date to obtain a token. 2. Use the returned token as the `pageToken` parameter in this endpoint. 3. Each change entry includes the file and the time of the change; filter or process these results as needed. **Important:** The `pageToken` parameter must be a valid token from `/changes/startPageToken`, not a date string.

Parameters

NameInRequiredDescription
driveIdqueryNoThe shared drive from which changes will be returned. If specified, change IDs will be reflective of the shared drive.
includeCorpusRemovalsqueryNoWhether to include file resources that are still accessible even after removal from the list of changes.
includeItemsFromAllDrivesqueryNoWhether to include items from both My Drive and shared drives.
includeRemovedqueryNoWhether to include changes indicating items have been removed (e.g., deleted or lost access).
pageSizequeryNoMaximum number of changes to return per page.
pageTokenqueryNoToken for continuing a previous list request (from `nextPageToken` or `/changes/startPageToken`). This must be a valid token, not a date string.
restrictToMyDrivequeryNoRestrict results to changes inside the My Drive hierarchy.
spacesqueryNoComma-separated list of spaces to query within the corpora. Supported: `drive`, `appDataFolder`.
supportsAllDrivesqueryNoWhether the application supports both My Drives and shared drives.
includePermissionsForViewqueryNoSpecifies which additional view's permissions to include. Only `published` is supported.
includeLabelsqueryNoComma-separated list of label IDs to include in the response.

Responses

StatusDescription
200A list of changes for a user or shared drive. Each change includes the file, the type of change, and the time it occurred. Use this endpoint to list files changed since a specific date (using a valid page token).
GET/changes/startPageTokenchanges_startPageToken

Returns a token representing the current state of Drive. **To list all changes (such as file modifications, deletions, or additions) that occur after a specific date:** 1. Call this endpoint at or just after your desired start date (e.g., "2025-06-01") to obtain a start page token. 2. Save the returned token for use with the `/changes` endpoint. **Note:** The API does not accept a date string to fetch changes; you must use a valid token from this endpoint. **Workflow Example:** - On 2025-06-01, call `/changes/startPageToken` and save the `startPageToken` value. - Later, call `/changes` with `pageToken` set to this value to retrieve all changes since that time.

Responses

StatusDescription
200Start page token for change tracking.
GET/filesfiles_list

Lists files the user has access to. Supports advanced filtering, sorting, and pagination. Use the `q` parameter for powerful search queries (e.g., `name contains 'bionic'`). **Note:** This endpoint lists current files and their metadata, but does **not** provide change history or timestamps of when files were changed. For queries about files changed since a specific date, see the `/changes` endpoint and the workflow below.

Parameters

NameInRequiredDescription
qqueryNoA query string for filtering the file results. Example: `name contains 'bionic'`.
corporaqueryNoBodies of items to which the query applies. Example: `user`.
driveIdqueryNoID of the shared drive to search.
includeItemsFromAllDrivesqueryNoWhether to include items from both My Drive and shared drives.
orderByqueryNoComma-separated list of sort keys. Example: `modifiedTime desc`.
pageSizequeryNoMaximum number of files to return per page (1-1000).
pageTokenqueryNoToken for continuing a previous list request.
spacesqueryNoSpaces to query within the corpora. Example: `drive`.
fieldsqueryNoSelector specifying which fields to include in a partial response.

Responses

StatusDescription
200A list of files matching the query.
GET/files/{fileId}files_get

Retrieves the metadata or content of a specific file in Google Drive using its unique file ID. By default, only metadata is returned unless the `alt=media` parameter is specified, in which case the file's content is downloaded. **Typical Use Cases:** - Obtain file details (name, mime type, modified time, etc.) for display or further processing. - Download file content directly if the file is not a native Google Doc format. **File Content Download Workflow:** - To download binary or textual content, set `alt=media`. - For Google Workspace documents (Docs, Sheets, Slides), use the export endpoint or API export mechanism. **Permissions Required:** - The requester must have access to the file and appropriate OAuth scopes. **Usage Example (Metadata):** `GET /files/1A2B3C4D?fields=id,name,mimeType` **Usage Example (Download):** `GET /files/1A2B3C4D?alt=media`

Parameters

NameInRequiredDescription
fileIdpathYesThe unique ID of the file in Google Drive.
fieldsqueryNoSelector specifying which fields to include in a partial response.
altqueryNoSet to `media` to download file content instead of metadata (for binary/text files).
acknowledgeAbusequeryNoWhether the user is acknowledging the risk of downloading a file flagged as abusive.

Responses

StatusDescription
200File metadata in JSON format, or file content if `alt=media` is used.
404File not found or access not permitted.

Need help deploying this MCP server?

Product Screenshot