22

I want to add an image stored in my Google Photos. How can I get the direct link to an image in my Google Photos? The links I copied are not direct.

1
  • 1
    As an alternative, if your content is freely licensed, I would recommend uploading your photos to Wikimedia Commons or archive.org and using them from there. These are trustworhy not-for-profits that will likely be around for a long time. Commented Aug 20, 2019 at 11:04

9 Answers 9

13

At this time Google actively changes its image service behavior. Now, there is not any algorithms how to receive direct and permanent links to your shared photos. The URLs are received by the right-button click, like https://lh3.googleusercontent.com/(LONGLONGCODE...)=w800-h600-no, are temporary and live one-two days and then will be closed.

You can try new Google service - Google Archive Album. This service was created as holder for albums from the deleted Picasa service. But it contains photos and albums from Google Photo too. The Google Archive Album have two greats advantages:

  • links are much shorter the from those of Google Photos,
  • this links are permanent!

For working with Google Archive Album you need to follow rules:

  1. create standard (NOT PUBLIC) album in Google Photos.
  2. go to Google Archive Album and make sure that you see the new album.
  3. add to album required photos and only now change its type to the public by creating the shared link to it.
  4. again go to Google Archive Album, open your album.
  5. click on first photo.
  6. right-clink on photo image and copy link to the clipboard.
  7. insert received link where you need.
  8. repeat steps 5-7 for others photos.
  9. voilà!

But how long time Google Archive Album will working I don't know :(

P.S.: If you don't know - URL links from Google Photos and Google Archive Album can be tuned. For detail reads the special site.

UPDATE: Google Album Archive has been shutdown, so this method doesn't work anymore!

5
  • 1
    For those who know the Russian language I had described in details on my blog
    – 23W
    Commented Sep 20, 2016 at 14:49
  • This does not work with very large images (e.g. 9526x4370) as they get split in multiple smaller images Commented Dec 29, 2018 at 11:53
  • 1
    FYI, Google Archive Album now uses the very same temporary URLs as Google Photos, so this no longer has an advantage.
    – kynan
    Commented Jan 4, 2020 at 6:13
  • Please see my answer for a way to get a stable URL.
    – kynan
    Commented Jan 4, 2020 at 7:14
  • 1
    The Archive Album link now shows that it has been shut down as of July 19, 2023. Commented Aug 12, 2023 at 17:06
10

As mentioned by 23W, the long URL you get by copying the image URL of any given photo in Google Photos while logged in to your Google account is "secret" and may be short lived and may stop working after a few days (though many people have reported that this is not in fact the case).

The trick is to copy the image URL while in an incognito window:

  1. Add the photo to a shared album if you haven't yet (if it's already in a shared album you can use the existing)
  2. Copy the "Link to share" (should be https://photos.app.goo.gl/<some hash>)
  3. Open a new incognito window and paste the link
  4. Navigate to your photo and copy the image URL (should be https://lh3.googleusercontent.com/<140 character hash>=<size info>)

You now have a deep link to the image that will not expire.

Note that when logged in you will get a "secret" image URL also starting with https://lh3.googleusercontent.com, however followed by a much longer 755 character hash. Do not use this URL as it may expire.

Also note that you can customize the =<size info> to get any resolution you want.

You can also install the Google Photos Direct Link Chrome extension to simplify the process.

8
  • also open network tab, click download button, observe request made, copy url, orl make extension to do so Commented Jun 7, 2020 at 12:15
  • The description on the add-on says the links only work for a few days (and point towards using the Google Archive Album) can anyone confirm that this approach does not expire after a few days? I've also found this website that appears to do a similar thing: labnol.org/embed/google/photos I'll report back if the URL still works in a weeks time!
    – T. Kiley
    Commented Jun 22, 2020 at 15:05
  • 1
    Can confirm that one week on the links generated from the above site still seem to work.
    – T. Kiley
    Commented Jul 6, 2020 at 9:29
  • 1
    This is the answer, accept this one!
    – Waylon
    Commented Nov 12, 2023 at 15:49
  • 1
    Thanks a lot for this amazing technique ! This makes a reliable and stable way of sharing images on tutorials for forums and cie !!!
    – Zzirconium
    Commented Nov 28, 2023 at 10:21
7

It's simple:

  • open photos.google.com
  • open album
  • open any image (black layout will appear)
  • right click mouse button on image
  • copy image URL

URL should look like

https://lh3.googleusercontent.com/(LONGLONGCODE...)=w800-h600-no

Or, right click mouse button - open image with new tab. Then copy image URL from your browser address bar.

3
  • ... or right click mouse button - open image with new tab. Then copy image url from your browser address bar
    – Dek4nice
    Commented May 14, 2016 at 22:45
  • 1
    SE sites require image urls ended in ".jpg" or ".png", while the links copied from Google Photos are not.
    – Tim
    Commented May 15, 2016 at 3:00
  • 6
    These links are temporal and will be work one-two days, then they will be closed. So, this is no solution. For details look at google forum - productforums.google.com/forum/#!msg/picasa/08ba8idWrW8/… May be Google Album Archive can help to us. But, I don't know how add albums from Google Photos to it, be default it shows albums from Picasa Web Albums.
    – 23W
    Commented Sep 16, 2016 at 9:07
3

I developed a very simple Chrome extension, called "Google Photos Direct Link". This Chrome extension is a helper to obtain a valid direct link (with .jpg file extension). Is possible to configure the desired image size too.

1
  • I added my answer, please read it.
    – 23W
    Commented Sep 17, 2016 at 11:37
1

Another option is to use Blogger to get the URL for an image from Google Photos.

You need to add the photo to an album, and then edit a blog-post and add the image to it. Then you can look at the HTML code behind the blog-post, and get the URL from that. (You don't actually need to publish the blog post, just use the post-editor to get the code.)

1
  1. Share picture from photos.google to Google Plus.
  2. In Google Plus click right button on picture and select Copy image address.

You get direct link to jpg file.

1
0

Follow these steps if you want a direct link to a single image in the context of a Google Photos album. This link will allow the user to navigate to other photos in the album.

  1. Create an album in Google Photos.
  2. Create a sharing link for the album.
  3. Navigate to the photo you wish to link to. The URL in the address bar is the direct link.
-1

I had some good results using the "export" function of Google Drive:
https://drive.google.com/uc?export=view&id=[FileId]

It's useful to embed resources.

Edit1: of course the image must be public

Edit2: here are some explanation:

1/ Upload the image in your GDrive

upload to gdrive

2/ Got to Share... select Get a shareable link.

get a sharable link

3/ See the link that just appears ? It should be something like https://drive.google.com/file/d/[FileId]/view?usp=sharing.

4/ Now the you have the FileId and your file is available via a link, You can click on Done. The direct link to your picture will be https://drive.google.com/uc?export=view&id=[FileId]

5/ As far as I know, you can use this link as attributes src of img markups.

Example: <img src="https://drive.google.com/uc?export=view&id=0Bx7WIDEbAmAqOXpDdFM5VkNUZHM"/> gives:

Some more info (a bit off topic): The export function of GDrive seems -to say the least- not well documented, but it can use to convert on the fly lots of format, the main use is to export GDoc to PDF.

4
  • 1
    Could you describe this in more detail? How do you find this "export" function? Does it somehow give the FileId? Commented Jan 4, 2017 at 9:31
  • 1
    @Madgui: Welcome to Web Applications! This answer is promising, but needs more detail. Preferably also screenshots demonstrating the procedure. Commented Jan 4, 2017 at 9:48
  • I edited my answer with some details. The main trick is to use the GDrive 'on the fly' exporting function, so it's difficult to use some official relevant data, but this trick is definitely working. I hope it will help you !
    – Madgui
    Commented Jan 5, 2017 at 17:14
  • you can also open network tab and intercept the downloaded url Commented Jun 7, 2020 at 12:14
-3

Add the following to the link:

?.jpg

i.e. a question mark followed by a period followed by jpg

Not the answer you're looking for? Browse other questions tagged or ask your own question.