google/robotstxt

The repository contains Google's robots.txt parser and matcher as a C++ library (compliant to C++11).

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 58 minutes ago
Added to GitGenius on September 20th, 2026
Created on June 11th, 2019
Open Issues & Pull Requests: 13 (+0)
GitHub issues: Enabled
Number of forks: 255
Total Stargazers: 3,471 (+0)
Total Subscribers: 92 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 6
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,152 days
Stale 30+ days: 5
Stale 90+ days: 5

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

robotstxt is a C++ library that parses and matches robots.txt files according to the Robots Exclusion Protocol standard.

The library addresses the problem that different implementations of the robots.txt standard have historically parsed and matched rules inconsistently, creating confusion for developers building crawlers and tools. It solves this by exposing Google's production robots.txt parser, the same code used by Googlebot, as an open-source library. The parser handles the full syntax of robots.txt files including percent-encoded characters and unicode patterns. The library requires that URIs passed to its matching functions already conform to RFC3986 format, as it performs only pattern matching rather than full URI normalization.

Developers should choose this library when building tools that need to respect robots.txt rules in the same way Google's crawler does, ensuring compatibility with how webmasters expect their directives to be interpreted. It suits any project that crawls the web or needs to validate robots.txt compliance. The library includes a command-line binary for testing individual URLs and user-agents against a robots.txt file, which is useful for webmasters and developers validating their configurations. The project supports multiple build systems, with Bazel as the official build system and CMake as a community-supported alternative, and runs on major platforms including Linux, Windows, and macOS with any C++14-compatible compiler.

The project maintains a focused scope on parsing and matching logic without attempting to handle URI normalization, placing responsibility on callers to provide properly formatted input. Development activity shows consistent attention to the core parsing specification with careful documentation of edge cases and expected behavior.