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:
You have several parameters to play with:
- The location you want photos of as defined in the Yahoo Geo API
- A word you want to search for
- The format of the returned data, XML, HTML or JSON - preset is XML
- The amount of photos returned, max is 100 – preset is 20
- 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: