Wednesday, September 19, 2012

Obtaining Tweeted Images in Original Size

An increasing number of tweets contains images uploded to twitter. Here is one example:
A particular example

I assume that you know how to find out URLs of images that are used on a web page.

The URL of the image you see in the tweet is https://pbs.twimg.com/media/A0BRGqGCcAEBdHW.jpg with the dimensions 600px × 428px (scaled to 435px × 310px).

If you click on the image to obtain a larger version you are presented with https://pbs.twimg.com/media/A0BRGqGCcAEBdHW.jpg:large with the dimensions 1,024px × 730px. This still isn't the original image.

I then made a well-educated guess and tried
https://pbs.twimg.com/media/A0BRGqGCcAEBdHW.jpg:orig and it actually worked; I got the original size image with dimensions 2,048px × 1,460px.

So all you need to do to obtain an original size image is to append »:orig« to the URL of the small version of the image.

Note that this only works for images uploaded to twitter not for images hosted on flickr.

Here is one example: https://twitter.com/VirtualAstro/status/241683461155475456 shows a nice photo of a blue moon; the 3 MP image can be found at https://pbs.twimg.com/media/A1qS3JvCQAE0QPv.jpg:orig

6 comments:

  1. I realize this post is months old now, but you sir are fucking amazing! I've been trying to make this work for hours! I tried .jpg:original .jpg:o but never thought to try orig

    You da man!

    ReplyDelete
  2. Thanks, even now (June 2015) this post is really useful.

    ReplyDelete
  3. Just used it, worked beautifully.

    ReplyDelete