Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flickr api: how to get relevant image results?

Tags:

image

flickr

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

like image 302
CodeToad Avatar asked May 05 '16 08:05

CodeToad


1 Answers

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

  options.SortOrder = PhotoSearchSortOrder.Relevance;
like image 193
CodeToad Avatar answered Oct 25 '22 10:10

CodeToad