PhotoSearch returns no results (sometimes)

Topics: Developer Forum
Oct 1, 2012 at 4:36 PM

I really can't figure out what's happening here. The flickr call works fine, then it decides to not work any more. Here's my custom log, to give you an idea of what's happening...

 


 

[Oct 01, 11:21:16] STARTED processing photos uploaded after 9/16/2012 at 9:40:00 PM 

[Oct 01, 11:21:35] Querying page 1 of 5590.

 [Oct 01, 11:22:09] Querying page 2 of 5585. 

[Oct 01, 11:22:16] Flickr PhotoSearch returned no results (5580 pages). Continuing. 

[Oct 01, 11:22:16] Querying page 3 of 5580. 

[Oct 01, 11:22:36] Querying page 4 of 5580. 

[Oct 01, 11:22:54] Querying page 5 of 5575. 

[Oct 01, 11:23:25] Querying page 6 of 5565. 

[Oct 01, 11:23:43] Querying page 7 of 5557.

 [Oct 01, 11:23:53] Flickr PhotoSearch returned no results (0 pages). Stopping.

 


 

So after the first query, I get 250 results, with an indication that there are 5590 pages of results. Then I query for page 2 but it returns 0 results (still 5580 pages remaining though). Then I query for page 3, 4, 5, and 6 with no problem (250 results each time). Then when I query for page 7, it returns 0 results AND indicates that there are 0 pages of results.

When I query for a different upload date/time, I will get different results. Sometimes the first call fails, sometimes I get 20 pages of results before it fails--it's all over the map. Here's the query I'm using...


PhotoSearchOptions options = new PhotoSearchOptions();

options.Extras |= PhotoSearchExtras.Geo;

options.Extras |= PhotoSearchExtras.Tags;

options.Extras |= PhotoSearchExtras.DateTaken;

options.Extras |= PhotoSearchExtras.DateUploaded;

options.Extras |= PhotoSearchExtras.LargeUrl;

options.Extras |= PhotoSearchExtras.MediumUrl;

options.Extras |= PhotoSearchExtras.SmallUrl;

options.Extras |= PhotoSearchExtras.ThumbnailUrl;

options.Extras |= PhotoSearchExtras.Description;

options.ContentType = ContentTypeSearch.All;

options.SafeSearch = SafetyLevel.Safe;

options.Page = pageToQuery;

options.PerPage = 250;

options.MinUploadDate = fromDate.Value;

options.MaxUploadDate = new DateTime(2079, 01, 01);

options.SortOrder = PhotoSearchSortOrder.DatePostedAscending;

options.HasGeo = true;

photos = flickr.PhotosSearch(options);


Any ideas what's going on here? Exceptions are not thrown. I'm using the NuGet package v3.4.0. Thanks for any assistance you can offer.

Oct 1, 2012 at 4:49 PM

From my experience the photo search API (On Flickr) SUCKS!!! This is NOT a problem with FlickNet wrapper for .Net but with the Flickr API itself. I have validated after extensive testing that you CANNOT get consistent results from a simple Flickr Photo Search. What I have found that worked for me was a query of photo sets. But this is of limited use. Unfortunately I do not know how to get Flickr to fix their broken API call for PhotoSearch.

 

You can confirm your results by using the Flickr API Explorer http://www.flickr.com/services/api/explore/flickr.photos.search

 

Here was my thread with the same problem as you are having:

http://flickrnet.codeplex.com/discussions/395053

 

Good luck and please post back what you find out.

Coordinator
Oct 1, 2012 at 8:11 PM

Yeah, there is a lot of discussion on the mailing list and Flickr API mailing list about this at the moment - it particularly seems to be an issue with Geo searches.

Unfortunately Flickr will often return an empty result (rather than some error) when it encounters an issue (such as an internal timeout, or invalid content or whatever). We have no way of knowing what or if this issue is the cause however as we only ever see an empty response.

Sam

Oct 1, 2012 at 8:41 PM

Hey Sam, what mailing lists are you talking about? I would love to view those discussions.

Coordinator
Oct 1, 2012 at 9:12 PM

The mailing list is linked on the Flickr API home page: http://groups.yahoo.com/group/yws-flickr/

Oct 2, 2012 at 5:09 AM

Dear Sam,

I am using Flickrnet api, After user login successful the first time, flickr ask user authorize my app and the second time login Flickr also ask to authorize my app. So, could you show me how to remember the user has already authorized my app, so that after login Flickr will redirect to my callback url?

Thank you.

 

Oct 2, 2012 at 1:54 PM

Hi truongdc. I'm not sure why you're trying to hijack my discussion thread--please create your own discussion about your own problem. Thanks.

Oct 3, 2012 at 3:53 AM

Sory Gang.