AntiSpam
Explanation
Everything the AntiSpam Tools application exposes to a script goes through one Component, the $services.antispam Script Service documented in AntiSpam Scripting API: the screens the extension ships are themselves wiki pages calling it, so a script of your own can search, check and clean exactly as they do.
Three Component roles are extension points rather than script entry points. A SpamChecker decides whether a piece of content is spam, and the extension registers one under the simple hint; registering another under your own hint makes it selectable wherever a checker hint is passed. A SpamCleaner performs the searching and the deletion the application home page drives. A SpamCheckerProtectionManager answers whether an account must never be disabled, deleted or cleaned, and every part of the extension asks it before acting — see Protected Users.
Detection itself is not something a script triggers. It is an Event Listener on DocumentCreatingEvent and DocumentUpdatingEvent that cancels the save when the document matches, which is described from the administrator's side in Spam Detection When Saving a Page.
FAQ
Which Maven artifacts do I depend on?
org.xwiki.contrib:application-antispam-api for the roles and the Script Service, and application-antispam-simple for the shipped implementation.
Is there a REST API?
No. The Script Service is the only programmatic entry point the extension offers.
Does a script need programming rights?
Most methods do. Which ones is listed in AntiSpam Scripting API.
More
To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.