NSFW Recognition API

Check images and PDFs for sexual (NSFW) content in one API call and get NSFW and SFW scores back as JSON. $3 per 1,000 images, pay as you go, $5 free to start.

 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.

Example of a picture with NSFW (Not Safe For Work) content Example of a picture with SFW (Safe For Work) content Example of a picture with SFW (Safe For Work) content
Example of a picture with NSFW (Not Safe For Work) content
Example of a picture with SFW (Safe For Work) content
Example of a picture with SFW (Safe For Work) content

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.

Copy and paste this code snippet into your command line terminal to try the API on your computer
$
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"
Or try a web sample right in the JSFiddle code playground
Explore more code examples for various programming languages:

 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.

Icon for API benefit item

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.

Print and photo services
Check customer uploads and PDF print orders page by page, and hold explicit ones before they reach the press.
Image hosting and marketplaces
Keep explicit pictures out of public galleries, listings and profile photos, or route them to a separate area if your site allows them.
Social apps and communities
Screen images posted in chats, comments and threads, so moderators only review the ones the API flags.

FAQ

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.

 Get started

Discover more APIs from api4ai