Skip to main content

rastrolog

See which AI crawlers read your site and which AI chat products send you visitors.

rastrolog parse and rastrolog check in a terminal

rastrolog reads your access logs and prints two tables:

  1. AI crawlers by user agent (GPTBot, ClaudeBot, PerplexityBot, …): what they fetched, and whether each one is there to train, to fetch a page for a user, or to build a search index.
  2. AI referrals: people who clicked a link inside ChatGPT, Claude, Perplexity, Gemini or Copilot, and the pages they landed on.

It classifies where a visit came from, never who the visitor is. There is no hosting, no storage and no telemetry.

Install

pip install rastrolog        # or: uv tool install rastrolog

Use

rastrolog parse access.log                     # nginx, Apache combined, CloudFront, ALB; .gz is fine
rastrolog parse access.log.gz --since 7d --json
rastrolog parse access.log --by page --top 20  # which pages AI tools touch
rastrolog check "https://chatgpt.com/"         # classify one referrer or user agent

--json writes the same report as JSON on stdout, for piping into anything else.

In your app

FastAPI / Starlette:

from rastrolog.middleware.asgi import AITrafficMiddleware

app.add_middleware(
    AITrafficMiddleware, on_match=lambda match, scope: counter.labels(match.id).inc()
)
# in a handler: request.state.ai_traffic -> rastrolog.Match | None

Django:

MIDDLEWARE = [..., "rastrolog.middleware.django.AITrafficMiddleware"]
RASTROLOG = {"on_match": "myproject.metrics.count_ai_traffic", "log": True}
# in a view: request.ai_traffic -> rastrolog.Match | None

Library:

from rastrolog import classify_user_agent, classify_referrer

classify_user_agent("Mozilla/5.0 ... GPTBot/1.3 ...")
# Match(kind='crawler', id='openai-gptbot', vendor='openai', token='GPTBot', purpose='training', ...)
classify_referrer("https://www.google.com/")  # None

What it detects

The lists live in signals.json. Crawler tokens cite the vendor's own documentation, except Bytespider (ByteDance publishes none, so that entry is flagged vendor_documented: false and sourced from a reputable third party instead). Referrer hosts cite either vendor docs or a published AI-source list from an analytics vendor (Matomo, Plausible). robots.txt-only tokens (Google-Extended, Applebot-Extended) never appear in a user agent string; they're read by the robots.txt checker, not by log classification. Every user-agent crawler and every referrer has a fixture in conformance/; robots.txt-only tokens are exercised by the robots.txt checker instead.

Known gaps, stated plainly:

  • Google AI Overviews and AI Mode send visitors with a plain google.com referrer, which can't be told apart from ordinary search. rastrolog doesn't guess.
  • AWS ALB logs have no Referer field, so ALB logs show crawlers only.
  • Some AI apps strip the referrer entirely. Those visits look like direct traffic.

Get notified when the list changes

New AI crawlers appear every few months, and your robots.txt goes out of date the day they do. Until the email signup page launches, watch this repo's releases (Watch → Custom → Releases). Every release that changes signals.json says what was added.

Metadata

Release files for rastrolog 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rastrolog 0.1.2
File Size Uploaded
rastrolog-0.1.2.tar.gz 133.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rastrolog 0.1.2
File Interpreter ABI Platform
rastrolog-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 159.7 kB

Release files / rastrolog-0.1.2.tar.gz

Download URL rastrolog-0.1.2.tar.gz
Size 133.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fcff5d6e17ea572e8ec2bfea7527aee623627eca3e01972526d122b0f6eb2256
BLAKE2b-256 checksum
How to use checksums
a9a123a7ecdbbb2edc7a74642db742e039a434c3d85c73ab13800acd1f7e73c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / rastrolog-0.1.2-py3-none-any.whl

Download URL rastrolog-0.1.2-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
574b4dacd12cdf9e3356493670518ef8518343ca8ca1133ba7b210f1862036e5
BLAKE2b-256 checksum
How to use checksums
6f47d8822f00e2e132f9cc005bf892a10650c3943ff4fb0d0ebc124ddfbd44cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page