Photo Image URLs

You can construct the source URL to a photo once you know its ID, server ID, and secret as returned by many API methods.

The URL takes the following format:

# Typical usage

# Unique URL format for 500px size

# Originals might have a different file format extension

# Example
#   server-id: 7372
#   photo-id: 12502775644
#   secret: acfd415fa7
#   size: w

Size Suffixes

The various sizes offered on Flickr have the following letter suffixes:

Suffix Class Longest edge (px) Notes
sthumbnail75cropped square
qthumbnail150cropped square
hlarge1600has a unique secret; photo owner can restrict
klarge2048has a unique secret; photo owner can restrict
3kextra large3072has a unique secret; photo owner can restrict
4kextra large4096has a unique secret; photo owner can restrict
fextra large4096has a unique secret; photo owner can restrict; only exists for 2:1 aspect ratio photos
5kextra large5120has a unique secret; photo owner can restrict
6kextra large6144has a unique secret; photo owner can restrict
ooriginalarbitraryhas a unique secret; photo owner can restrict; files have full EXIF data; files might not be rotated; files can use an arbitrary file extension


All photo image URLs use a secret value that's provided by API methods. All sizes below the H (1600) size use one shared secret. All sizes above and including the H (1600) size each use a unique secret for just themselves. The original size, regardless of dimensions, always uses its own secret.

A few more notes on originals

The original size behaves a little differently than the other sizes. They have their own secret (called originalsecret in responses) and a variable file extension (called originalformat in responses). These values are returned via the API only when the caller has permission to view the original size (based on a user preference and various other criteria). The values are returned by the method and by any method that returns a list of photos and allows an extras parameter (with a value of original_format), such as The method, as always, will return the full original URL where permissions allow.

Additionally, since original files are the exact file uploaded to Flickr they may have extra EXIF, XMP, etc. metadata embedded within them. This might include rotation data which may result in the image displaying in an unexpected orientation. Metadata can also include sensitive info like geographic details. With these details in mind it is important to only expose access to original files when you know it's safe and required.

Image dimensions

A particular size will exist for one of three reasons:

  1. It’s one of these sizes which always exist: s, q, t, o (subject to the original downloading pref).
  2. It’s smaller than the original (subject to the max resolution pref).
  3. It’s larger than the original and the original is within a certain number of pixels of the size.
    • This case is a little funny and worth thinking about. For example, it means that if you upload a 1000×1000 original then it will have a 1024 size even though it's smaller than that size normally is. The dimensions on that size will be 1000×1000 and the API will correctly report the dimensions as such. How many pixels of wiggle room each size has varies, but generally it’s “half the number of pixels between this size and the next smaller size”.

Legacy URLs

In the past Flickr has supported several different styles for image URLs. These continue to work but are considered deprecated. Please update to the style detailed in this document.

Web Page URLs

URLs to photo and profile pages use either the user's NSID (the number with the '@' sign in it) or their custom URL (if they've chosen one). You can find their custom URL with a call to flickr.people.getInfo. The NSID version of the URL will always work, regardless of whether they've set up a 'pretty' URL, so you can avoid the API call by simply using the the user ID returned by most photo API calls.

You can then easily build URLs to profiles, photostreams, individual photos, or albums:{user-id}/ - profile{user-id}/ - photostream{user-id}/{photo-id} - individual photo{user-id}/albums/ - all albums{user-id}/albums/{album-id} - single album

Other URLs can be constructed similarly. Directing a user to* or* will replace the 'me' with their own user ID, if they're logged in (otherwise it will redirect to the latest photos page).


Short URLs

Flickr provides a URL shortening service for uploaded photos (and videos). Short URLs can be useful in a variety of contexts including: email, on business cards, IM, text messages, or short status updates.

Every photo on Flickr has a mathematically calculated short URL of the form:{base58-photo-id}

Base58 is used to compress the photo-ids using a mix of letters and numbers. You can find more info on base58, and code samples in the Flickr API Group.