How to Filter NSFW/Nude Images Using Twitter Api

media
oauth

#1

Hi ,
I display tweets in a site for specific hashtags or search terms using twitter api url .
Here is the url :
https://api.twitter.com/1.1/search/tweets.json?result_type=recent&count=30&q=$query
I parse the code and display images and tweets data , but on some hashtags people post adult images which are not even related to the tags .
Is there any filter available to filter out such tweets containing such images and show only clean images t my site users ?
Any help would be appreicable , I am in trouble regarding nude content displaying on my site …


#2

If a Tweet contains an image or Video, it usually contains the possibly_sensitive boolean, which is set to true if the user indicated that the image contains content for mature audience only.
I am not ware of a search flag for that, but you could filter it manually after getting the results from the search API this way.


#3

Use the filter:safe operator to remove Tweets marked as possibly sensitive from returned results.

More information on search operators:
https://dev.twitter.com/rest/public/search