We offer a very simple to use API that allows you to scan any site at any time and get a result similar to what is provided on our internal malware scanners and SiteCheck.
Our Scanning API is a paid plan for access to the API please contact email@example.com.
You can find this feature in your dashboard under “API” at the very bottom of the screen.
Once there, click on “Scanning API”.
You can then click on the box next to “Enable Scanning API” in order to turn the feature on or off.
The API is very simple. Every request needs to be made to this URL:
https://[monitor domain]/scan-api.php?k=[your key]
Where [monitor domain] and [your key] can be found in your dashboard by clicking API at the bottom of your monitor dashboard:
Note that the k (key) variable is your unique key and need to be treated and secured like a password. Anyone with access to your key, will have full access to the API. In addition to the key variable, the API also requires an action that is specified by the “a” variable. For the scanning API. the action is always “scan”.
Scanning a site
To request a real time scan of a site, use the "scan" action in the API url followed by the “host” variable to specify the domain or URL to be scanned. Note that this request can take a little while to complete (up to a few minutes).
- host (GET or POST): The site name to be scanned.
- format (GET or POST): How you expect the results (not required - default to simple (greppable text))
Our scans can have four result categories: Warning, Error, Info and Notice.
Return codes: In case of an error, the only return will be "ERROR:" followed by the error message. In case of success, the scan dump will be displayed.
- MALWARE:WARN -Malware detected
- BLACKLIST:WARN -Blacklisting detected
- WEBAPP:WARN -Outdatedsoftwaredetected
- SYSTEM:ERROR - Scanning or server errors.
- WEBAPP:INFO - Informational messages about the web application running.
- BLACKLIST:INFO - Informational message about a blacklist check (not blacklisted)
- SYSTEM:INFO - Informational messages about the server.
- SYSTEM:NOTICE - Notice messages about the server.
- WEBAPP:NOTICE - Notice messages about the web app.
If you are still not sure what do, please feel free to open a support ticket with the Sucuri team.