Expand description
Fast crawler/bot detection from User-Agent strings.
is_crawler returns true for crawlers/bots and false for human
browsers. With the database feature, crawler_info separately returns
matching Crawlerdex metadata.
§Example
use iscrawl::is_crawler;
assert!(is_crawler("Googlebot/2.1 (+http://www.google.com/bot.html)"));
assert!(!is_crawler(
"Mozilla/5.0 (X11; Linux x86_64; rv:115.0) Gecko/20100101 Firefox/115.0"
));§Heuristic
- Empty input: crawler.
- Input over 512 bytes:
false(oversized, not classified). - Crawler keyword present (
bot,crawl,spider,+http,@, …): crawler. - No
Mozilla//Opera/prefix and no browser engine token: crawler. Mozilla//Opera/prefix lacking engine and(compatible;: crawler.- Otherwise: browser.
Heuristic bool API plus optional database lookup.
Functions§
- is_
crawler - Returns
trueifuser_agentlooks like a crawler/bot,falseif it looks like a human browser.