[google-drive-api] Displaying files (e.g. images) stored in Google Drive on a website

EDIT : As of 2020, THIS is working. Most previous answers are outdated.

Easy Solution

All you have to do is open your file:

Image of mountain on Google Drive

Then, go into your web inspector (for Chrome, Cmd-Shift-I or Ctrl-Shift-I depending on your OS) and get the link. Paste that link into your browser and it will redirect to another link. Copy the new URL. Done!

Image of link for image shown in web inspector


What's the redirect for?

It seems that if you use the first link, it can only be accessed when signed in to your Google account. Not very helpful for other people. The second, redirected link, however, does not need you to be signed in. That's the rationale behind it.


I deleted the original file shown in the images, but I have another working example here.


I've actually checked back on my example link that I posted in my edit about a week ago, but it no longer seems to be working. I guess these links only work temporarily, so don't use them for any kind of production environment.