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 entry has a real fixture in conformance/.

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.1

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.1
File Size Uploaded
rastrolog-0.1.1.tar.gz 132.4 kB Details

Built distribution (wheel)

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

Total release size: 158.5 kB

Release files / rastrolog-0.1.1.tar.gz

Download URL rastrolog-0.1.1.tar.gz
Size 132.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3636a3447c70daf7a90594d32bb4b703ecfaa267331ff5aaf4c01611f9a30ccf
BLAKE2b-256 checksum
How to use checksums
89efcb9a845eb61e69d5da6b43eba00ee6ea889aa12ac7e3112121ef1bae5b74
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.1-py3-none-any.whl

Download URL rastrolog-0.1.1-py3-none-any.whl
Size 26.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6258de3dc93a8e8cb17631a561ca648b6e96d5dee9e00a575d0e309936dcc6a2
BLAKE2b-256 checksum
How to use checksums
b212a2dd141ec1d2622e157115ad49305706c604fc848098108fd015ffd483c8
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

0.1.2

2 release files

This release

0.1.1 This release

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