Flickr Services |
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:
http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg
or
http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}_[mstb].jpg
or
http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{o-secret}_o.(jpg|gif|png)
The letter suffixes are as follows:
| s | small square 75x75 |
| t | thumbnail, 100 on longest side |
| m | small, 240 on longest side |
| - | medium, 500 on longest side |
| b | large, 1024 on longest side (only exists for very large original images) |
| o | original image, either a jpg, gif or png, depending on source format |
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 flickr.photos.getInfo method and by any method that returns a list of photos and allows an extras parameter (with a value of original_format), such as flickr.photos.search. The flickr.photos.getSizes method, as always, will return the full original URL where permissions allow.
http://farm1.static.flickr.com/2/1418878_1e92283336_m.jpg farm-id: 1 server-id: 2 photo-id: 1418878 secret: 1e92283336 size: m
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:
http://www.flickr.com/people/{user-id}/ - profile
http://www.flickr.com/photos/{user-id}/ - photostream
http://www.flickr.com/photos/{user-id}/{photo-id} - individual photo
http://www.flickr.com/photos/{user-id}/sets/ - all photosets
http://www.flickr.com/photos/{user-id}/sets/{photoset-id} - single photoset
Other URLs can be constructed similarly. Directing a user to http://www.flickr.com/photos/me/* or http://www.flickr.com/people/me/* will replace the 'me' with thier own user ID, if they're logged in (otherwise it will redirect to the latest photos page).
http://www.flickr.com/photos/12037949754@N01/ http://www.flickr.com/photos/12037949754@N01/155761353/ http://www.flickr.com/photos/12037949754@N01/sets/ http://www.flickr.com/photos/12037949754@N01/sets/72157594162136485/