NSFW Recognition API
About
Send an image or a PDF, as a file or a link, and get two scores from 0 to 1: how likely it is NSFW (Not Safe For Work) and how likely it is safe. Your code decides what to block, blur or send to a moderator.
Not Safe For Work
The NSFW score shows how likely the image contains sexual content that shouldn't appear in public places or at work. Pick the score above which your app blocks an image or holds it for review.
Safe For Work
The SFW score shows how likely the image is safe to publish. Images with a high SFW score can go live without a moderator looking at them first.
Demo
Try the NSFW API without signing up: pick a sample picture or upload your own image and see its NSFW and SFW scores.



Ready to try the API?
First, register on the API4AI portal and get your API key: no credit card, and $5 of free credit to start.
$
curl -X "POST" \ "https://api4ai.cloud/nsfw/v1/results" \ -H "X-API-KEY: $YOUR_API_KEY" \ -F "url=https://static.api4.ai/samples/nsfw-1.jpg"
Benefits
A production API for image moderation: one HTTPS call in, the scores back as JSON, and commercial use of the results included (Terms of Use).
Off-the-shelf
solution
Nothing to train or host: get a key on the portal and check your first image with the curl line above.
REST
API
Works from any language that can send an HTTP request, with code examples on GitLab.
Pay as
you go
No subscription: pay only for the images you check, and your balance never expires.
Adjustable
strictness
Set how strict the check is, from 1.0 (strictest: even swimwear counts as NSFW) down to 0.0, to match your own rules.
Use cases
Who uses it: any app or site where users upload pictures that others will see. Check each upload before it goes live, and send only the doubtful ones to a person.
FAQ
-
Pay as you go: $3 per 1,000 images ($0.003 an image), with no subscription, and your balance never expires. New accounts get $5 free, enough for 1,666 images. Volume prices from about 20,000 images a month: contact us.
-
No. The NSFW API checks images: it tells you how likely a picture is NSFW or safe, so you can block, blur or review it before it goes live.
-
By default it is as strict as possible (strictness=1.0): even a swimwear photo counts as NSFW. Lower the strictness parameter, down to 0.0, to fit your own rules.
-
JSON with two scores from 0 to 1 for each image: nsfw and sfw. You choose the score at which your app blocks an image or holds it for review.
-
Yes. Each page of a PDF is checked as its own image and billed as one request. Files up to 16 MB.
-
JPG, PNG and PDF, up to 16 MB and 4096×4096 pixels. Send the file itself or a link to a public file.
-
Yes. The results are yours to use in your own products, ads and listings (Terms of Use).
Customization
If our standard NSFW API doesn't precisely align with your requirements, api4ai offers customized solutions.
We commence by comprehending your specific needs during an initial consultation and then develop a tailored proposal.
Our pricing is transparent and equitable, typically consisting of a one-time setup fee based on the complexity of your custom requirements, and a personalized subscription cost for your content moderation API.