Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Google’s authentication-less on-the-fly image resizing service

Google's authentication-less on-the-fly image resizing service

I found it while poking around the Google+ HTML. Jotting down some notes felt like a good idea, so here goes. If you know more about this API, let me know, please!

(Word of warning: I spent ~30 minutes on both my experimentation and this here write-up, so it might not be the most thought-provoking, brilliant thing you read today.)

Base URL


  • url: original image URL
  • container: must be "focus" (i dunno lol)
  • refresh: time (in seconds) to cache it on G's servers
  • resize_w: width in pixels
  • resize_h: height in pixels

You can either specify both resize_* parameters or just one.


Let's resize that big panorama picture I took in Istanbul last year.

Make it square, 300x300px:

Make it 750px wide and keep the aspect ration:


At least in Chrome, opening the URL in the browser will force a download of a text file (which is actually a JPG). Putting the URL in an <img> tag is fine. Or just use curl.

Copy link

edent commented Jan 2, 2015

Really useful! Do you know if there's a way to specify a maximum width? Like, only resize if over X pixels?

Copy link

pajtai commented Jul 1, 2015

Are there any docs for this service? Tried googling a few things, but didn't find anything.

Copy link

martijndebruijn commented Dec 29, 2015

@lawloretienne: I have the same problem and I think it is related to the size of the image you want to resize. Try a smaller source image. I don't know what the maximum of the source message is but it looks like something of max 3000px X 3000px.

Copy link

sw-ms-roshanparmar commented Jan 10, 2018

Hi, it is not working for some of the images. below is the link of image which i used.

and i tried to resize it with the following url:

but, it still gives the image in same resolution. it is not resizing it.
any help ?

Copy link

Sauerstoffdioxid commented Feb 12, 2018

I've found two more options:

  • no_expand=1: when scaled to a larger size than the image itself is, it will not be resized (e.g. the dimensions set with resize_* act as a maximum but are not forced on smaller images).
    no_expand=0 seems to function as something like "force resize"
  • rewriteMime=image/*: normally the mime type is something like image/png; charset=UTF-8. With this option you can overwrite it. The * functions as a placeholder for whatever mime the image originally had, i. e. rewriteMime=image/* would give image/png if used on a PNG. Note that it won't affect the proxying – you'll still receive the same with or without this option (only the mime type changes)

Some other things:

  • There's a parameter gadget=a, not sure what it's for.
  • Only container and url are required parameters. The value of container=focus is irrelevant as long as it's there.

Copy link

ShaMan123 commented Apr 11, 2018

does this work?
couldn't get anything to work

Copy link

giautm commented Jul 17, 2018

You should use querystring.stringify to encode all params like bellow, or encodeURIComponent to keep original params to url.
Without encoding, all params in this URL will forward to Google rather original service.

        const params = querystring.stringify({
          no_expand: Number(noExpand),
          resize_h: height,
          resize_w: width,

Copy link

sanealytics commented Jan 30, 2020

This works! Has anyone used this 'at scale'?
I mean, I'm hoping Google does but do they block you if you put it on a busy website?

Copy link

mibus commented Aug 23, 2021

Please don't do this. It's not legitimate traffic from Google's perspective, and at some point they'll change things and break your website with no notice.

Copy link

larsomen commented Feb 2, 2022

@mibus guess what happened :)
We got a message from a client that his gallery plugin wasn't displaying the pictures anymore. Turns out that the plugin developer was using this "google resizing proxy" and it just stopped working probably a few days ago.

Copy link

tumagonx commented Mar 10, 2022

I got consistently this message like years ago:
We're sorry... but your computer or network may be sending automated queries.

surprised this way still works for someone else. Tried tor but still blocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment