What is this?

getFlickrBy is a wrapper API for Flickr using YQL to retrieve photos for a certain term and/or geo located photos from Flickr licensed with the Creative Commons "by" license.

Using this API you can retrieve only the most important information for photos: title, link, description and image url.

Examples

REST Parameters

You have several parameters to define what kind of data you want. You have to provide either a location or a search parameter, or both.

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 75x75px, "t" for thumbnail, "m" for medium, omit to get big size
user NEW
the flickr user, accepts name or ID.

There are three output formats: XML, JSON and HTML

Output format structure

HTML output


  <ul>
    <!-- YQL: {yql query}, search: {search} location: {location} -->
    <li><a href="{url}"><img src="{image}" alt="{title} by {owner}"></a>
    <p>{description}</p></li>
    ... repeated for each photo ...
  </ul>

Error case


  <ul>
    <!-- no photos for {location} or {search} with {yql} -->
  </ul>

XML output


  <?xml version="1.0"?>
  <flickresults>
    <yql>{yql query}</yql>
    <search>{search}</search>
    <location>{location}</location>
    <photos>
      <photo>
        <url>{url}</url>
        <owner>{owner}</owner>
        <src>{image}</src>
        <title>{title}</title>
        <description>{description}</description>
      </photo> 
      ... repeated for each photo ...
    </photos>
    <results>{amount of results}</results>
  </flickresults>

Error case


  <?xml version="1.0"?>
  <flickresults>
    <yql>{yql query}</yql>
    <search>{search}</search>
    <location>{location}</location>
    <error>No photos available</error>
  </flickresults>

JSON output


  <callback>({
    "search":"<search>",
    "yql":"<yql>",
    "location":"<location>",
    "photos":[
      {
        "url":"<url>",
        "owner":"<owner>",
        "src":"<image>",
        "description":"<description>",
        "title":"<title>"
      },
      ... repeated for each photo ...
    ],
    "results":"<amount of results>" 
  })

Error case


  <callback>({
    "search":"<search>",
    "yql":"<yql>",
    "location":"<location>",
    "error":"No photos available"
  })