crawlerdetect
CrawlerDetect is a Python library designed to identify bots, crawlers, and spiders by analyzing their user agents.
What it is and what it does
CrawlerDetect is a Python wrapper around a web crawler detection library that identifies bots, crawlers, and spiders by matching user agents and HTTP headers against a curated pattern database. It exposes two main methods: `isCrawler()` to check if a given user agent is a known crawler, and `getMatches()` to retrieve the name of any detected crawler. The library can accept a user agent string directly, initialize with a pre-set user agent, or analyze HTTP headers passed as a dictionary.
The package maintains zero runtime dependencies and is kept in sync with upstream crawler patterns. It's useful for web applications that need to distinguish legitimate traffic from automated crawlers—for analytics filtering, rate limiting, or access control. The detection is pattern-based rather than behavioral, so it relies on the completeness and currency of its signature database.
Use it for:
- Filter crawler traffic from web analytics to isolate genuine user sessions.
- Implement rate limiting or access restrictions for detected bots in web applications.
- Identify and block malicious or unwanted crawlers at the request handler level.
- Log and monitor which crawlers are accessing your site and how frequently.
- Serve different content or responses to crawlers versus human visitors.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Identifies bots, crawlers, and spiders by analyzing user agents and HTTP headers against a pattern database of 1462 crawler signatures.
Yes. The package is actively maintained, has no dependencies, carries a permissive MIT license, and solves a common web application need with a straightforward API. The 1462 crawler patterns provide broad coverage. Install if you need reliable bot detection; the low friction and clean maintenance history make it a safe choice.
Install
crawlerdetect on PyPI
pip
pip install crawlerdetectuv
uv add crawlerdetectpoetry
poetry add crawlerdetectInstalling crawlerdetect
Before you install
Low friction: zero runtime dependencies, pure Python wheel. Active maintenance with a release 15 days ago and last commit on 2026-07-30.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal restrictions.
Quickstart
from crawlerdetect import CrawlerDetect
crawler_detect = CrawlerDetect()
result = crawler_detect.isCrawler('Mozilla/5.0 (compatible; Sosospider/2.0; +http://help.soso.com/webspider.htm)')
matches = crawler_detect.getMatches()
Requires Python 3.10 or later (supports current versions only).
Verify before relying
- How frequently the 1462 crawler patterns are updated relative to new bot releases.
- Performance characteristics when checking high-volume user agent strings.
- Whether header-based detection (Variant 3) improves accuracy over user-agent-only checks.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 15 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 136,867/month — #11,384 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: crawlerdetect-0.4.2-py3-none-any.whl
Keywords: crawler, crawler detect, crawler detector, crawlerdetect, python crawler detect
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
device-detectorParses user agent strings and client hints to…
unclear · top 15,000 on PyPI
httpagentparserParses HTTP User-Agent strings to extract and…
unclear · top 15,000 on PyPI
ua-parserParses user-agent strings to extract browser,…
permissive · top 1,000 on PyPI
wootheeWoothee parses user-agent strings to identify…
permissive · top 15,000 on PyPI
user-agentsParses browser user agent strings to identify…
permissive · top 5,000 on PyPI
icrawlericrawler is a lightweight, modular web crawler…
permissive · top 15,000 on PyPI
crawleeCrawlee is a web scraping and browser…
permissive · top 5,000 on PyPI
user-agentGenerates random, valid web user agent strings…
permissive · top 15,000 on PyPI
pymobiledetectDetects mobile phones and tablets from HTTP…
agpl · top 15,000 on PyPI
django-robotsA Django application that manages robots.txt…
permissive · top 15,000 on PyPI