Retrieve and display Flickr photos the easy way with getFlickrBy
As part of my talk on YQL for Open Hack London I’ve thought of an easy way to get Flickr photos that you are allowed to display in your products and hacks.
The wrapper API getFlickrBy works around the somewhat convoluted data returned from Flickr’s API methods and uses YQL to cut the information you want down to the bare necessities. Furthermore the API only returns photos that are licenced with Creative Commons’ “By” license to avoid you using photos you have no right to use (which is a big thing with the Flickr crowd).
The API endpoint is:
http://isithackday.com/api/getFlickrBy.php
You have several parameters to play with:
location- The location you want photos of as defined in the Yahoo Geo API
search- A word you want to search for
format- The format of the returned data, XML, HTML or JSON - preset is XML
callback- A name of a JavaScript function call to wrap the JSON data in, in case you want to use the API in a script node
amount- The amount of photos returned, max is 100 – preset is 20
size- the photo size, “s” for 75×75px, “t” for thumbnail, “m” for medium, omit to get big size
The API returns only what you need: the image title, the owner, the url of the image and the link to Flickr. If you use html as the output format it returns an HTML list of linked images. For output demos and explanations simply call the API without any parameters
Here are some examples how to use the API:
- Get 5 photos from Paris,France as JSON calling the function
foo() - Get 20 photos from Ankara as HTML
- Get 20 photos from London as XML
- Get 20 photos of bridges in munich as XML
- Get 10 photos of kittens json calling the function
meow()
Tags: api, creativecommons, flickr, openhacklondon, wrapper


May 9th, 2009 at 11:30 am
Any chance of adding a user parameter onto that?
May 11th, 2009 at 2:39 pm
I second martinb’s request – this would be extremely handy with an optional user parameter.
May 12th, 2009 at 2:02 am
Alright then, now it also works with user parameter, go nuts :)
July 4th, 2009 at 4:00 pm
Hello Chris,
Long time .NET reader of yours, and have only just stumbled upon your site following a ‘Flickr API more than 20’ search!
At present I can only exact 20 photos from a Flickr account, though need much more. Your solution requires that accounts have Creative Commons licenses, however I don’t have the authority to grant one to the photostream in question (just in case!). I’d like to, but don’t feel I can.
I there a way I can change the license parameter?
Thanks in advance for any help,
Matt