Photo Source URLs

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

The URL takes the following format:


* Before November 18th, 2011 the API returned image URLs with hostnames like: "farm{farm-id}". Those URLs are still supported.

Size Suffixes

The letter suffixes are as follows:

ssmall square 75x75
qlarge square 150x150
tthumbnail, 100 on longest side
msmall, 240 on longest side
nsmall, 320 on longest side
-medium, 500 on longest side
zmedium 640, 640 on longest side
cmedium 800, 800 on longest side†
blarge, 1024 on longest side*
hlarge 1600, 1600 on longest side†
klarge 2048, 2048 on longest side†
ooriginal image, either a jpg, gif or png, depending on source format

* Before May 25th 2010 large photos only exist for very large original images.

† Medium 800, large 1600, and large 2048 photos only exist after March 1st 2012.

Note: Original photos behave a little differently. 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.


farm-id: 1
server-id: 2
photo-id: 1418878
secret: 1e92283336
size: m

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 photosets:{user-id}/ - profile{user-id}/ - photostream{user-id}/{photo-id} - individual photo{user-id}/sets/ - all photosets{user-id}/sets/{photoset-id} - single photoset

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.