Skip to main content

rastrolog

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

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

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.0
File Size Uploaded
rastrolog-0.1.0.tar.gz 131.3 kB Details

Built distribution (wheel)

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

Total release size: 156.9 kB

Release files / rastrolog-0.1.0.tar.gz

Download URL rastrolog-0.1.0.tar.gz
Size 131.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1aca047392cda467b48819eef16ee26da916b6108bfee0597da749aaac88baa7
BLAKE2b-256 checksum
How to use checksums
569f9cf166ab067c74c9f6b087473d11728548b5b7eeb0a632cd795453e8f48c
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 28, 2026.

Transparency log

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

Download URL rastrolog-0.1.0-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a555f9dfa92dcf10adecebe4379e1f40ad5591df8bf2b4935ca14eb353eff72
BLAKE2b-256 checksum
How to use checksums
bc081a124573d00f5a54492783f1b52f96524ffb3f0ed97473d49dcacd817b60
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 28, 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

0.1.1

2 release files

This release

0.1.0 This release

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