Skip to content

Drive API API

by googleapis.com

OAuthHTTPSAnalytics
Open documentation ↗

Overview

Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.

Drive API is an analytics API from googleapis.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 48 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Analytics
Base URL
https://www.googleapis.com/drive/v3
Version
v3
Endpoints
48
Spec updated
2023-04-20

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://www.googleapis.com/drive/v3/about" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://www.googleapis.com/drive/v3/about", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://www.googleapis.com/drive/v3/about",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/aboutGets information about the user, the user's Drive, and system capabilities.
GET/changesLists the changes for a user or shared drive.
GET/changes/startPageTokenGets the starting pageToken for listing future changes.
POST/changes/watchSubscribes to changes for a user. To use this method, you must include the pageToken query parameter.
POST/channels/stopStop watching resources through this channel
GET/drivesLists the user's shared drives.
POST/drivesCreates a shared drive.
GET/drives/{driveId}Gets a shared drive's metadata by ID.
PATCH/drives/{driveId}Updates the metadata for a shared drive.
DELETE/drives/{driveId}Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.
POST/drives/{driveId}/hideHides a shared drive from the default view.
POST/drives/{driveId}/unhideRestores a shared drive to the default view.
GET/filesLists or searches files.
POST/filesCreates a file.
GET/files/generateIdsGenerates a set of file IDs which can be provided in create or copy requests.
DELETE/files/trashPermanently deletes all of the user's trashed files.
GET/files/{fileId}Gets a file's metadata or content by ID.
PATCH/files/{fileId}Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fiel
DELETE/files/{fileId}Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent.
GET/files/{fileId}/commentsLists a file's comments.
POST/files/{fileId}/commentsCreates a comment on a file.
GET/files/{fileId}/comments/{commentId}Gets a comment by ID.
PATCH/files/{fileId}/comments/{commentId}Updates a comment with patch semantics.
DELETE/files/{fileId}/comments/{commentId}Deletes a comment.
GET/files/{fileId}/comments/{commentId}/repliesLists a comment's replies.
POST/files/{fileId}/comments/{commentId}/repliesCreates a reply to a comment.
GET/files/{fileId}/comments/{commentId}/replies/{replyId}Gets a reply by ID.
PATCH/files/{fileId}/comments/{commentId}/replies/{replyId}Updates a reply with patch semantics.
DELETE/files/{fileId}/comments/{commentId}/replies/{replyId}Deletes a reply.
POST/files/{fileId}/copyCreates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied.
GET/files/{fileId}/exportExports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.
GET/files/{fileId}/listLabelsLists the labels on a file.
POST/files/{fileId}/modifyLabelsModifies the set of labels on a file.
GET/files/{fileId}/permissionsLists a file's or shared drive's permissions.
POST/files/{fileId}/permissionsCreates a permission for a file or shared drive. For more information on creating permissions, see Share files, folders & drives.
GET/files/{fileId}/permissions/{permissionId}Gets a permission by ID.
PATCH/files/{fileId}/permissions/{permissionId}Updates a permission with patch semantics.
DELETE/files/{fileId}/permissions/{permissionId}Deletes a permission.
GET/files/{fileId}/revisionsLists a file's revisions.
GET/files/{fileId}/revisions/{revisionId}Gets a revision's metadata or content by ID.
PATCH/files/{fileId}/revisions/{revisionId}Updates a revision with patch semantics.
DELETE/files/{fileId}/revisions/{revisionId}Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other file
POST/files/{fileId}/watchSubscribes to changes to a file.
GET/teamdrivesDeprecated use drives.list instead.
POST/teamdrivesDeprecated use drives.create instead.
GET/teamdrives/{teamDriveId}Deprecated use drives.get instead.
PATCH/teamdrives/{teamDriveId}Deprecated use drives.update instead
DELETE/teamdrives/{teamDriveId}Deprecated use drives.delete instead.

Questions

Does the Drive API API need an API key?

Yes. The Drive API API uses OAuth authentication; the documentation explains how to get credentials.

Does the Drive API API support HTTPS?

Yes, the Drive API API is served over HTTPS.

How many endpoints does the Drive API API have?

Its OpenAPI description lists 48 endpoints in version v3. All of them are shown on this page.

What are alternatives to the Drive API API?

Other Analytics APIs include Google Play Integrity API, versionhistory.googleapis.com API, Doc Converter, Perspective Comment Analyzer API, Safe Browsing API.

Compare alternatives →

Google Play Integrity API

Analytics

The Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.

OAuth1 endpoints

versionhistory.googleapis.com API

Analytics

Version History API - Prod

No auth4 endpoints

Doc Converter

Analytics

This api converts file formats of OpenXml and OpenOffice documents formats to vector files (e.g., svg)

No auth1 endpoints

Perspective Comment Analyzer API

Analytics

The Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the "toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the "doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.

OAuth2 endpoints

Safe Browsing API

Analytics

Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.

No auth7 endpoints

Web Fonts Developer API

Analytics

The Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.

No auth1 endpoints

Listed from APIs.guru (CC0).