This project has moved and is read-only. For the latest updates, please go here.

Why are no photos returned after PhotoSearch call

Topics: User Forum
Dec 31, 2008 at 11:45 AM
I'm using your excellent FlickrNet library and trying the ExampleForm code. I have authenticated the application and have successfully uploaded a photo using the application. But when I call PhotoSearch with my usedId Photos.TotalPhotos is always 0.
I can view the photos by calling the PhotosGetInfo with the photoID. I have set both photos in my account to be viewable by everyone.

Any ideas as to why this is happening to me?
Jan 25, 2009 at 8:07 PM
It could be a couple of things - firstly, has your account been marked as 'safe' - check the web page to see if it has.

Secondly have you marked your account as being viewable to the API - I don't know if this will make any difference, but it might.

If you let me know what your username is that might help as I can test it for myself.

Sep 23, 2010 at 5:49 AM

Hi guys,

I know this thread is a bit old, but since it describes the exact same problem that I'm having, I thought I'd add to this post. I have recently downloaded the latest version available of the library and I have put together a quick console app just to be able to test its basic features, such as Authorization, Uploading and Searching. 

I registered this app with Flickr and the consumerKey and consumerSecret the were provided are both being cached inside the application (they are being stored as keys in the app's Settings page). For the authorizationToken, as soon as I get one back from flickr, that too is being stored as a key in the app's Setttings page. But unlike the two previous keys, which both are defined with "Application" scope, the Token was defined with a "User" scope instead.

Anyways... everything seems to be working fine, except for the Search method. I appears to work Ok, but if I upload a new picture to the authorized user's account, this new addition is not reflected on subsequent calls to the Search method. I have noticed however that if I (re)authorize the application, then and only then the recently added picture is accounted for. I implemented a quick "deauthorization" method where basically I clear out the "token" value from the application's cache. If I do this and then authorize the application again, then the newly added picture gets to be accounted for trhough the search method.

Here's a snippet of code for one of my search methods and for my upload method. They're all very simple and short (no error handling, etc) put together just to quickly test the features. Hope someone can make something out of this. 

        private static string _ConsumerKey = Properties.Settings.Default.ConsumerKey;
        private static string _ConsumerSecret = Properties.Settings.Default.ConsumerSecret;
        private static string _FlickrToken = Properties.Settings.Default.FlickrToken;

        private static void GetPhotoCount()
            var flickr = new Flickr(_ConsumerKey, _ConsumerSecret, _FlickrToken);

            Auth auth = flickr.AuthCheckToken(_FlickrToken);

            PhotoSearchOptions options = new PhotoSearchOptions(auth.User.UserId);

            options.SortOrder = PhotoSearchSortOrder.DatePostedDescending;
            options.PerPage = 100;

            PhotoCollection photos = flickr.PhotosSearch(options);
            Console.WriteLine("Total de fotos: {0}", photos.Total);


        private static void UploadPicture()
            bool isPublic = false;
            bool isFamily = false;
            bool isFriend = false;

            string file = "file...";
            string title = "title...";
            string description = "description...";
            string tags = "tag1, tag2, tag3...";

            string filePath = Path.Combine(Directory.GetCurrentDirectory(), file);

            var flickr = new Flickr(_ConsumerKey, _ConsumerSecret, _FlickrToken);
            string photoId = flickr.UploadPicture(filePath, title, description, tags, isPublic, isFamily, isFriend);

            Console.WriteLine("Upload successfully realized!");
            Console.WriteLine("Photo ID: {0}", photoId);

Oct 2, 2010 at 5:29 PM

If you are searching, then uploading, then searching again you are probably returning the cached results from the first search - hence the new image is not being returned.

Either turn off caching CacheDisabled = true or Flush the cache for the search Flickr.FlushCache(flickr.LastRequest)


Oct 3, 2010 at 9:37 PM

Thank you, Sam. Actually, not too long after having submitted this post I ended up finding out that it had indeed something to do with the cache. I'll try both methods again, for I could only get it to work properly by disabling the cache altogether (CacheDisabled = true). I believe I did try the other option (flushing the last request) but it didn't work as expected. 


Oct 18, 2010 at 10:35 PM


Just wondering if you managed to solve this Marcos? I've been using the flickrnet for the past 2 years and in the last few days the search has stopped working for new photos. Pictures added about 4 days worked ok and all older photos can still be searched but any new photos to flickr aren't being returned. The privacy settings on the photos are correct, I've CacheDisabled = true and tried the FlushCache method but no joy. Today I updated to the latest flickrnet dll to see if that would fix it but there was no change. Any suggestions would be much appreciated.



Oct 19, 2010 at 9:01 AM

I'm hearing the same thing on the Flickr API mailing list and the API group from a number of users, so I think perhaps this might be a Flickr issue.


Oct 19, 2010 at 7:07 PM

I haven't tested this again. At the time of my last post, I was indeed able to get it working by disabling the cache, but according to yours and Sam's recent posts, something else must be going on now. I'll give it try again later and let you guys know what I come up with.