Search code examples
imageflickr

flickr api: how to get relevant image results?


I am getting some irrelevant and low (subjective) image quality from the flickr api. I notice that sites such as haiku deck use flickr api and they get relevant results

desired flickr search result

I am using the flickrnet api. Below is the code I am using, along with the results when query = 'cow'

  Flickr flickr = new Flickr(flickrKey, flickrSecret);

            PhotoSearchOptions options = new PhotoSearchOptions();

            options.SafeSearch = SafetyLevel.Safe;
            options.Licenses.Add(LicenseType.AttributionCC);
            options.MediaType = MediaType.Photos;

            options.Text = query; 

            options.Extras = PhotoSearchExtras.AllUrls;

            PhotoCollection photos = flickr.PhotosSearch(options);

actual results


Solution

  • the solution is to set sort by relevance. default is by date

      options.SortOrder = PhotoSearchSortOrder.Relevance;