Google Drive Direct Link
API key v1Turn 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".
https://api.zactonz.com/gdrive/directlink/
Parameters
| Name | Type | Description |
|---|---|---|
urlrequired |
string |
The Google Drive share link. |
Send parameters in the query string.
Response
The direct download URL.
| Field | Type | Description |
|---|---|---|
status |
integer |
|
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 |
|
403 |
Could not resolve | The file is private, was removed, or Google is throttling it. |
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.