Search code examples
flickr

Flickr API: getInfo on Guest Pass photos?


So, Flickr Guest Pass URLs are in the following format:

www.flickr.com/x/t/[numericID]/gp/[userID]/[alphanumericID]

Now if I try an API call of the following form:

API_KEY = 'myapikey'
PHOTO_ID = '[numericID]'
SECRET = '[alphanumericID]'
url = 'http://api.flickr.com/services/rest/?method=flickr.photos.getInfo' +
    '&api_key=%s&photo_id=%s&secret=%s' % (API_KEY, PHOTO_ID, SECRET)

I do get some photo information back, but for completely the wrong photograph!

It may be relevant that the photo ID in my Guest Pass starts "00": in the info returned by the API, the initial zeros have been chopped off.

Am I supplying the right information to getInfo()?


Solution

  • Figured it out in the end. The Photo ID is in the URL that the Guest Pass resolves to. The secret is in the URL of the jpeg of the photo itself.

    So, for example, on a photo:

    flickr.com/curiouskiwi/5203020393
    

    The photo ID is the final part of the URL. If you view the photo, you find that the JPG of the URL is

    farm6.static.flickr.com/5045/5203020393_f41c8d7fe7_z.jpg
    

    And from that, you know the secret is f41c8d7fe7.