https://github.com/stephenafamo/isbot
Detect bots/crawlers/spiders using the user agent string.
https://github.com/stephenafamo/isbot
bot-detection bot-detector crawler-detection golang oktoberfest user-agent
Last synced: 10 months ago
JSON representation
Detect bots/crawlers/spiders using the user agent string.
- Host: GitHub
- URL: https://github.com/stephenafamo/isbot
- Owner: stephenafamo
- License: mit
- Created: 2022-10-01T10:47:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-16T14:54:31.000Z (over 2 years ago)
- Last Synced: 2025-04-04T14:21:40.711Z (about 1 year ago)
- Topics: bot-detection, bot-detector, crawler-detection, golang, oktoberfest, user-agent
- Language: Go
- Homepage:
- Size: 435 KB
- Stars: 18
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# IsBot
Detect bots/crawlers/spiders using the user agent string.
Using a list downloaded from , the regexes in this package hit a 90% detection rate.
If nothing matches, it also checks if the user agent is present in the list.
## Usage
```go
import "github.com/stephenafamo/isbot"
func main() {
userAgent := "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.0.0 Safari/537.36 Chrome-Lighthouse"
isBot := isbot.Check(userAgent)
if isBot {
// do something
}
}
```
## Sources
The sources for detection are:
*
*
* A manual list
## Contributing
Run `go generate` to refresh the lists from the sources.
If something is misisng, send in a pull request.