Flickr: Scheme API for Flickr
David Van Horn <dvanhorn@ccs.neu.edu>
1 Overview
This collection provides a Scheme wrapping to the Flickr web service:
http://www.flickr.com/services/api/
See example.ss for a example program that logs in a user and makes
authenticated calls to the API.
Procedures are named exactly as in the Flickr API. Arguments are
specified with keywords spelled exactly as in the API, their values
must always be strings.
Calling a procedure returns a list of Xexprs constituting the
[xml-payload-here] portion of the response (see the Flickr
documentation on example responses).
Here is an example call to the echo method (the value of the api_key
should be changed to your own key, assigned by Flickr).
Example: |
> (flickr.test.echo #:api_key "138427ce2d97d6a2d0c4a2f045a59bfa") |
((method () "flickr.test.echo") (api_key () "138427ce2d97d6a2d0c4a2f045a59bfa")) |
If the Flickr service responds with an error response, an exception is
raised.
The api_key argument is required of every method in the Flickr API.
If ommitted from a Scheme procedure call, the value defaults to the
value of the
current-api-key parameter. So the above could be
written as:
Examples: |
> (current-api-key "138427ce2d97d6a2d0c4a2f045a59bfa") |
> (flickr.test.echo) |
((method () "flickr.test.echo") (api_key () "138427ce2d97d6a2d0c4a2f045a59bfa")) |
Methods may have required arguments and an error will be raised if
ommitted.
Signed methods rely on the
current-sec-key parameter for the Flickr
API secret key.
When true, all methods are signed; when false, only methods that need signing are signed.
For example:
(flickr.reflection.getMethods)
Evaluates to:
'((methods |
() |
"\n\t" |
(method () "flickr.activity.userComments") |
"\n\t" |
(method () "flickr.activity.userPhotos") |
"\n\t" |
...)) |
Whereas:
Evaluates to:
'((methods |
() |
(method () "flickr.activity.userComments") |
(method () "flickr.activity.userPhotos") |
...)) |
2 Methods
Returns a list of recent activity on photos commented on by the calling user. <b>Do not poll this method more than once an hour</b>.
Returns a list of recent activity on photos belonging to the calling user. <b>Do not poll this method more than once an hour</b>.
Returns the credentials attached to an authentication token. This call <b>must</b> be signed as specified in the <a href="/services/api/auth.spec.html">authentication API spec</a>.
Returns a frob to be used during authentication. <b>This method call must be signed</b>.
Get the full authentication token for a mini-token. <b>This method call must be signed.</b>
Returns the auth token for the given frob, if one has been attached. <b>This method call must be signed.</b>
Get a list of configured blogs for the calling user.
Return a list of Flickr supported blogging services
Returns information for a single collection. Currently can only be called by the collection owner, this may change.
Returns a tree (or sub tree) of collections belonging to a given user.
Retrieves a list of the current Commons institutions.
Get a list of contacts for the calling user.
Return a list of contacts for a user who have recently uploaded photos along with the total count of photos uploaded.<br /><br />
This method is still considered experimental. We don’t plan for it to change or to go away but so long as this notice is present you should write your code accordingly.
Get the contact list for a user.
Adds a photo to a user’s favorites list.
Returns a list of the user’s favorite photos. Only photos which the calling user has permission to see are returned.
Returns a list of favorite public photos for the given user.
Removes a photo from a user’s favorites list.
Add a photo to a gallery.
Create a new gallery for the calling user.
Modify the meta-data for a gallery.
Edit the comment for a gallery photo.
Modify the photos in a gallery. Use this method to add, remove and re-order photos.
Return the list of galleries created by a user. Sorted from newest to oldest.
Return the list of galleries to which a photo has been added. Galleries are returned sorted by date which the photo was added to the gallery.
Return the list of photos for a gallery
Browse the group category tree, finding groups and sub-categories.
Get information about a group.
Get a list of the members of a group. The call must be signed on behalf of a Flickr member, and the ability to see the group membership will be determined by the Flickr member’s group privileges.
Add a photo to a group’s pool.
Returns next and previous photos for a photo in a group pool.
Returns a list of groups to which you can add photos.
Returns a list of pool photos for a given group, based on the permissions of the group and the user logged in (if any).
Remove a photo from a group pool.
Search for groups. 18+ groups will only be returned for authenticated calls where the authenticated user is over 18.
Returns the list of interesting photos for the most recent day or a user-specified date.
Return a list of unique namespaces, optionally limited by a given predicate, in alphabetical order.
Return a list of unique namespace and predicate pairs, optionally limited by predicate or namespace, in alphabetical order.
Return a list of unique predicates, optionally limited by a given namespace.
Fetch recently used (or created) machine tags values.
Return a list of unique values for a namespace and predicate.
Return a list of <a href="http://www.flickr.com/explore/panda">Flickr pandas</a>, from whom you can request photos using the <a href="/services/api/flickr.panda.getPhotos.htm">flickr.panda.getPhotos</a> API method.
Ask the <a href="http://www.flickr.com/explore/panda">Flickr Pandas</a> for a list of recent public (and "safe") photos.
Return a user’s NSID, given their email address
Return a user’s NSID, given their username.
Get information about a user.
Return photos from the given user’s photostream. Only photos visible to the calling user will be returned. This method must be authenticated; to return public photos for a user, use <a href="/services/api/flickr.people.getPublicPhotos.html">flickr.people.getPublicPhotos</a>.
Returns a list of photos containing a particular Flickr member.
Returns the list of public groups a user is a member of.
Get a list of public photos for the given user.
Returns information for the calling user related to photo uploads.
Add tags to a photo.
Add comment to a photo as the currently authenticated user.
Delete a comment as the currently authenticated user.
Edit the text of a comment as the currently authenticated user.
Returns the comments for a photo
Return the list of photos belonging to your contacts that have been commented on recently.
Delete a photo from flickr.
Correct the places hierarchy for all the photos for a user at a given latitude, longitude and accuracy.<br /><br />
Batch corrections are processed in a delayed queue so it may take a few minutes before the changes are reflected in a user’s photos.
Get the geo data (latitude and longitude and the accuracy level) for a photo.
Get permissions for who may view geo data for a photo.
Return a list of photos for a user at a specific latitude, longitude and accuracy
Removes the geo data associated with a photo.
Indicate the state of a photo’s geotagginess beyond latitude and longitude.<br /><br />
Note : photos passed to this method must already be geotagged (using the <q>flickr.photos.geo.setLocation</q> method).
Sets the geo data (latitude and longitude and, optionally, the accuracy level) for a photo.
Before users may assign location data to a photo they must define who, by default, may view that information. Users can edit this preference at <a href="http://www.flickr.com/account/geo/privacy/">http://www.flickr.com/account/geo/privacy/</a>. If a user has not set this preference, the API method will return an error.
Set the permission for who may view the geo data associated with a photo.
Returns all visible sets and pools the photo belongs to.
Fetch a list of recent photos from the calling users’ contacts.
Fetch a list of recent public photos from a users’ contacts.
Returns next and previous photos for a photo in a photostream.
Gets a list of photo counts for the given date ranges for the calling user.
Retrieves a list of EXIF/TIFF/GPS tags for a given photo. The calling user must have permission to view the photo.
Returns the list of people who have favorited a given photo.
Get information about a photo. The calling user must have permission to view the photo.
Returns a list of your photos that are not part of any sets.
Get permissions for a photo.
Returns a list of the latest public photos uploaded to flickr.
Returns the available sizes for a photo. The calling user must have permission to view the photo.
Returns a list of your photos with no tags.
Returns a list of your geo-tagged photos.
Returns a list of your photos which haven’t been geo-tagged.
Fetches a list of available photo licenses for Flickr.
Sets the license for a photo.
Add a note to a photo. Coordinates and sizes are in pixels, based on the 500px image size shown on individual photo pages.
Delete a note from a photo.
Edit a note on a photo. Coordinates and sizes are in pixels, based on the 500px image size shown on individual photo pages.
Add a person to a photo. Coordinates and sizes of boxes are optional; they are measured in pixels, based on the 500px image size shown on individual photo pages.
Remove a person from a photo.
Remove the bounding box from a person in a photo
Edit the bounding box of an existing person on a photo.
Get a list of people in a given photo.
<p>Return a list of your photos that have been recently created or which have been recently modified.</p>
<p>Recently modified may mean that the photo’s metadata (title, description, tags) may have been changed or a comment has been added (or just modified somehow :-)</p>
Remove a tag from a photo.
Return a list of photos matching some criteria. Only photos visible to the calling user will be returned. To return private or semi-private photos, the caller must be authenticated with ’read’ permissions, and have permission to view the photos. Unauthenticated calls will only return public photos.
Set the content type of a photo.
Set one or both of the dates for a photo.
Set the meta information for a photo.
Set permissions for a photo.
Set the safety level of a photo.
Set the tags for a photo.
Rotate a photo.
Checks the status of one or more asynchronous photo upload tickets.
Add a photo to the end of an existing photoset.
Add a comment to a photoset.
Delete a photoset comment as the currently authenticated user.
Edit the text of a comment as the currently authenticated user.
Returns the comments for a photoset.
Create a new photoset for the calling user.
Delete a photoset.
Modify the meta-data for a photoset.
Modify the photos in a photoset. Use this method to add, remove and re-order photos.
Returns next and previous photos for a photo in a set.
Gets information about a photoset.
Returns the photosets belonging to the specified user.
Get the list of photos in a set.
Set the order of photosets for the calling user.
Remove a photo from a photoset.
Return a list of place IDs for a query string.<br /><br />
The flickr.places.find method is <b>not</b> a geocoder. It will round <q>up</q> to the nearest place type to which place IDs apply. For example, if you pass it a street level address it will return the city that contains the address rather than the street, or building, itself.
Return a place ID for a latitude, longitude and accuracy triple.<br /><br />
The flickr.places.findByLatLon method is not meant to be a (reverse) geocoder in the traditional sense. It is designed to allow users to find photos for "places" and will round up to the nearest place type to which corresponding place IDs apply.<br /><br />
For example, if you pass it a street level coordinate it will return the city that contains the point rather than the street, or building, itself.<br /><br />
It will also truncate latitudes and longitudes to three decimal points.
Return a list of locations with public photos that are parented by a Where on Earth (WOE) or Places ID.
Get informations about a place.
Lookup information about a place, by its flickr.com/places URL.
Fetches a list of available place types for Flickr.
Return an historical list of all the shape data generated for a Places or Where on Earth (WOE) ID.
Return the top 100 most geotagged places for a day.
Return all the locations of a matching place type for a bounding box.<br /><br />
The maximum allowable size of a bounding box (the distance between the SW and NE corners) is governed by the place type you are requesting. Allowable sizes are as follows:
<ul>
<li><strong>neighbourhood</strong>: 3km (1.8mi)</li>
<li><strong>locality</strong>: 7km (4.3mi)</li>
<li><strong>county</strong>: 50km (31mi)</li>
<li><strong>region</strong>: 200km (124mi)</li>
<li><strong>country</strong>: 500km (310mi)</li>
<li><strong>continent</strong>: 1500km (932mi)</li>
</ul>
Return a list of the top 100 unique places clustered by a given placetype for a user’s contacts.
Return a list of the top 100 unique places clustered by a given placetype for set of tags or machine tags.
Return a list of the top 100 unique places clustered by a given placetype for a user.
Find Flickr Places information by Place ID.<br /><br />
This method has been deprecated. It won’t be removed but you should use <a href="/services/api/flickr.places.getInfo.html">flickr.places.getInfo</a> instead.
Find Flickr Places information by Place URL.<br /><br />
This method has been deprecated. It won’t be removed but you should use <a href="/services/api/flickr.places.getInfoByUrl.html">flickr.places.getInfoByUrl</a> instead.
Return a list of the top 100 unique tags for a Flickr Places or Where on Earth (WOE) ID
Returns the default content type preference for the user.
Returns the default privacy level for geographic information attached to the user’s photos and whether or not the user has chosen to use geo-related EXIF information to automatically geotag their photos.
Possible values, for viewing geotagged photos, are:
<ul>
<li>0 : <i>No default set</i></li>
<li>1 : Public</li>
<li>2 : Contacts only</li>
<li>3 : Friends and Family only</li>
<li>4 : Friends only</li>
<li>5 : Family only</li>
<li>6 : Private</li>
</ul>
Users can edit this preference at <a href="http://www.flickr.com/account/geo/privacy/">http://www.flickr.com/account/geo/privacy/</a>.
<br /><br />
Possible values for whether or not geo-related EXIF information will be used to geotag a photo are:
<ul>
<li>0: Geo-related EXIF information will be ignored</li>
<li>1: Geo-related EXIF information will be used to try and geotag photos on upload</li>
</ul>
Users can edit this preference at <a href="http://www.flickr.com/account/geo/exif/?from=privacy">http://www.flickr.com/account/geo/exif/?from=privacy</a>
Returns the default hidden preference for the user.
Returns the default privacy level preference for the user.
Possible values are:
<ul>
<li>1 : Public</li>
<li>2 : Friends only</li>
<li>3 : Family only</li>
<li>4 : Friends and Family</li>
<li>5 : Private</li>
</ul>
Returns the default safety level preference for the user.
Returns information for a given flickr API method.
Returns a list of available flickr API methods.
Get a list of referring domains for a collection
Get a list of referrers from a given domain to a collection
Get the number of views on a collection for a given date.
Returns a list of URLs for text files containing <i>all</i> your stats data (from November 26th 2007 onwards) for the currently auth’d user.
<b>Please note, these files will only be available until June 1, 2010 Noon PDT.</b>
For more information <a href="/help/stats/#1369409">please check out this FAQ</a>, or just <a href="/photos/me/stats/downloads/">go download your files</a>.
Get a list of referring domains for a photo
Get a list of referrers from a given domain to a photo
Get a list of referring domains for a photoset
Get a list of referrers from a given domain to a photoset
Get the number of views on a photoset for a given date.
Get the number of views, comments and favorites on a photo for a given date.
Get a list of referring domains for a photostream
Get a list of referrers from a given domain to a user’s photostream
Get the number of views on a user’s photostream for a given date.
List the photos with the most views, comments or favorites
Get the overall view counts for an account
Returns the first 24 photos for a given tag cluster
Gives you a list of tag clusters for the given tag.
Returns a list of hot tags for the given period.
Get the tag list for a given photo.
Get the tag list for a given user (or the currently logged in user).
Get the popular tags for a given user (or the currently logged in user).
Get the raw versions of a given tag (or all tags) for the currently logged-in user.
Returns a list of tags ’related’ to the given tag, based on clustered usage analysis.
A testing method which echo’s all parameters back in the response.
A testing method which checks if the caller is logged in then returns their username.
Null test
Returns the url to a group’s page.
Returns the url to a user’s photos.
Returns the url to a user’s profile.
Returns gallery info, by url.
Returns a group NSID, given the url to a group’s page or photo pool.
Returns a user NSID, given the url to a user’s photos or profile.