Method: files.export

Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.

HTTP request

GET https://www.googleapis.com/drive/v3/files/{fileId}/export

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
fileId

string

The ID of the file.

Query parameters

Parameters
mimeType

string

Required. The MIME type of the format requested for this export.

Request body

The request body must be empty.

Response body

If successful, this method returns the file content as bytes. For a list of Google Workspace documents and MIME type conversion formats, see Google Workspace documents and corresponding export MIME types.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.file
  • https://www.googleapis.com/auth/drive.meet.readonly
  • https://www.googleapis.com/auth/drive.readonly

Some scopes are restricted and require a security assessment for your app to use them. For more information, see the Authorization guide.