Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

How can I automatically retrieve the exact URL of a Flickr photo when I pass the ID to the API?

I have the IDs of all pictures and I'm currently using the flickr.photos.getInfo method that takes the ID as parameter and it gives me an XML file with the picture page URL as an answer.

However the picture page URL is not the URL of the picture (which is displayed in this page).

How can I automatically retrieve the exact URL of the picture?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

From the Official Flickr documentation:

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:

http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg
or
http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}_[mstzb].jpg
or
http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{o-secret}_o.(jpg|gif|png)

share|improve this answer
    
The answer says "once you know its ID, server ID, farm ID and secret". So my question is how do you find those? –  user10433 Apr 25 '11 at 7:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.