Search code examples
filterflickrprofanity

Is it possible to filter flickr API calls for safe pictures?


I'm working on a app that collects random pictures from flickr to use as placeholder images. I just had an incident with a client where one of the placeholders images was too explicit and now I think it is better to filter the results. I know flickr does have a safety level on the images.

As far as I got the safety level is set per user. Is it possible to set it during an API call?

This is the call I'm using:

flickr.interestingness.getList

Solution

  • There is a 'safe search' argument you can pass in when setting your search parameters.

    Safe search setting:

    1. for safe
    2. for moderate
    3. for restricted

    Your code should look like this:

    NSMutableDictionary *params = [NSMutableDictionary new];
    [params setObject:@(1) forKey:@"content_type"];
    

    safe_search (Optional) Safe search setting: 1 for safe. 2 for moderate. 3 for restricted.

    Click here for more details from the flickr api website