Google Drive Direct Link

API key v1

Turn a Google Drive share link into a direct download URL.

Resolves a Google Drive share link (the file/d/<id>/view or open?id= forms) to the URL that serves the file bytes directly, so it can be used in download buttons, wget scripts or media tags. The file must be shared with "anyone with the link".

GET https://api.zactonz.com/gdrive/directlink/

Parameters

NameTypeDescription
urlrequired string

The Google Drive share link.

Send parameters in the query string.

Response

The direct download URL.

FieldTypeDescription
status integer

200 on success. See status codes below.

data string

The direct download URL, or an explanation for non-200 statuses.

Status codes

The outcome is reported in the JSON status field. See Errors & status codes for the general rules.

200 OK

Resolved.

400 Missing url

url was empty or absent.

403 Could not resolve

The file is private, was removed, or Google is throttling it. data carries the reason.

Notes

Direct links for large files pass through Google's virus-scan interstitial; the resolver follows it for you. Google may rate-limit files that are downloaded very frequently, in which case the reply is a 403 with the explanation in data.