Home of the FlickrNet API libary
C#
Switch branches/tags
Clone or download
Permalink
Failed to load latest commit information.
.nuget Mega refactor thanks to VS 2015 Jul 27, 2015
FlickrNet Update to various licenses mentioned in various files to ensure consi… Mar 12, 2018
FlickrNetTest Update to various licenses mentioned in various files to ensure consi… Mar 12, 2018
NuGet Update to NuSpec files for project and license urls. Feb 9, 2016
Sandcastle Update to various licenses mentioned in various files to ensure consi… Mar 12, 2018
Support Fix for issue #5 where russian tag test was failing. Jul 3, 2015
packages Converted from MSTest to NUnit. Sep 10, 2013
.gitignore Update gitignore file. Mar 9, 2018
FlickrNet.sln Added Flickr.GroupsLeave and Flickr.GroupsJoin methods as well as Gro… May 28, 2012
FlickrNet.vsmdi Update to the new staticflickr.com Image Url format. Nov 22, 2011
FlickrNetCF.sln Update for Compact Framework compatibility and XML Comments. Oct 12, 2009
FlickrNetCodeBetter.sln Converted from MSTest to NUnit. Sep 10, 2013
FlickrNetVS10.sln Update to nuspec files. Feb 1, 2016
FlickrNetVS10.vssscc Added Camera* methods. Aug 27, 2013
FlickrNetWP7.sln git-svn-id: https://flickrnet.svn.codeplex.com/svn@81710 81e6e737-5a2… Dec 9, 2010
LICENSE Create LICENSE Jan 29, 2016
README.md Update example in ReadMe Aug 27, 2016
deploy.proj Push new deploy build. Mar 11, 2018
help.proj Updated help build file to ensure debug build exists. Dec 14, 2010
localtestrun-codecoverage.testrunconfig Gradually improving code coverage. Mar 23, 2010
localtestrun.testrunconfig Gradually improving code coverage. Mar 23, 2010

README.md

Flickr-Net

The Flickr.Net API Library is a .Net Library for accessing the Flickr API. It is written entirely in C#.

The library provides a simple one-to-one mapping to the methods of the Flickr REST API, hopefully hiding all of the complexity of calling the API, especially when it comes to authentication. Check the Flickr API web site for the full list of commands, and then use the corresponding method in the Flickr library, e.g. to call flickr.photos.search use the Flickr.PhotosSearch method.

The library is not an attempt to provide an ORM layer over the Flickr API, e.g. if you retrieve a list of photosets for a user (i.e. by calling Flickr.PhotosetsGetList) there is no direct property on each photoset to get the photos for that set, you must go back to the Flickr object and call Flickr.PhotosetsGetPhotos passing in the photoset id.

Getting Started

The FlickrNet API library is available via NuGet.org. SImply run the following command:

Install-Package FlickrNet

Examples

You can create a new instance of the Flickr class, and set its properties, or you can use one of the parameterised constructors:

Flickr flickr = new Flickr();
flickr.ApiKey = myApiKey;

or

Flickr flickr = new Flickr(myApiKey);

The simplest method (although it has the most parameters) is probably the PhotosSearch method, which is best used by passing in a PhotoSearchOptions instance:

var options = new PhotoSearchOptions { Tags = "colorful", PerPage = 20, Page = 1 };
PhotoCollection photos = flickr.PhotosSearch(options);

foreach(Photo photo in photos) 
{
  Console.WriteLine("Photo {0} has title {1}", photo.PhotoId, photo.Title);
}

Photo Extras

One of the hardest things to understand initially is that not all properties are returned by Flickr, you have to explicity request them.
For example the following code would be used to return the Tags and the LargeUrl for a selection of photos:

var options = new PhotoSearchOptions { 
  Tags = "colorful", 
  PerPage = 20, 
  Page = 1, 
  Extras = PhotoSearchExtras.LargeUrl | PhotoSearchExtras.Tags 
};

PhotoCollection photos = flickr.PhotosSearch(options);
// Each photos Tags and LargeUrl properties should now be set, 
// assuming that the photo has any tags, and is large enough to have a LargeUrl image available.

Sample Applications

I've started a separate CodePlex project to host sample applications:

https://github.com/samjudson/flickrnet-samples

View the sample app live on the web here:

http://wackylabs.azurewebsites.net/

License

The project is licensed under both the LGPL 2.1 license, and the Apache 2.0 license. This gives you the flexibility to do pretty much anything you want with the code. Enjoy!

Contact

You can contact me at via the People tab or post a discussion here on codeplex if you require further help.

See my Flickr homepage at http://www.flickr.com/photos/samjudson