Use Your Flickr Account as a Photo CMS

It is blindingly easy to use your Flickr account as a Photo Management system for a website.

At it’s very simplest, create a new Flickr account, apply for a API key ( under Explore -> Flickr Services ) and then make an HTTP call to one of the many services available through their API.

If all you want to do is load in your own images, then construct a simple URL using one of the following methods (or one of the hundreds available at Flickr Services):

Using flickr.photosets.getPhotos

Useful for targeting a set of photos in your account directly, instead of sifting through all photos at once.
You need your API KEY and a PHOTOSET ID

http://api.flickr.com/services/rest/?api_key=YOUR_API_KEY&method=flickr.photosets.getPhotos&photoset_id=YOUR_PHOTOSET_ID

Using flickr.photos.search

You can get all of your photos at once.
You need your API KEY and your USER ID

http://api.flickr.com/services/rest/?api_key=YOUR_API_KEY&method=flickr.photos.search&user_id =YOUR_USER_ID
( note: You can find your user id here, when you are signed in )

The link you create will return simple XML response containing photo nodes with attributes that allow you to construct URLs to ascertain their source.

<photo id=”2946128457″ secret=”6h73g678j6″ server=”2536″ farm=”4″ title=”I am a picture” isprimary=”0″/>

The url takes the following format. Note that size can be one of the following values: “_m”, “_s”, “_t” or “_o”.

“http://farm” + photo.@farm + “.static.flickr.com/” + photo.@server + “/”+ photo.@id + “_”+ photo.@secret + size + “.jpg”

You can find more information here.

Leave a Reply