Express

See which AI agents crawl your Express app

One line in your app. Unlike a frontend framework's middleware, this one sees the response — so you also find out what agents asked for and didn't get.

Why you can't see them today

If you serve an API or a server-rendered app from Express, your analytics is whatever runs in the browser — and for a lot of Express services there's no browser at all. Agent requests land in your access log and nowhere else. You already have the data; nothing is reading it for agents.

The reason there's no script tag to paste. AI agents don't execute JavaScript. Every analytics tool you already run is a browser tag, so it never fires for an agent — which is why your dashboards show none of this traffic. The only way to see it is server-side, at the edge, or in your logs.

See yours before you install anything

Paste a chunk of your access log and we'll pull out the AI agents that crawled you, what they read, and the files they asked for and couldn't find. No account, nothing stored.

Check my log free →

Install: Middleware

One line of code. Captures response status, so you also see the pages agents asked for and didn't get.

  1. Install the collector. Dependency-free and MIT licensed.
    npm i @pickrate/collector
  2. Add the middleware. As early as you can, before your routes — anything registered before it won't be seen.
    import express from "express";
    import { middleware } from "@pickrate/collector/node";
    
    const app = express();
    app.use(middleware);
  3. Set your key. Add PICKRATE_KEY to your environment with a secret (sk_) key from Pickrate Settings. With no key set the middleware is a no-op, so you can deploy it before configuring anything.

Gotchas worth knowing first

Register it before your routes

Connect-style middleware only sees what's registered after it. Put it at the top of the chain, above your routers and above anything that terminates a request early.

It must be a secret key, not a publishable one

Agent detection is server-side, so the ingest rejects publishable (pk_) keys for it. A pk_ key in PICKRATE_KEY is the most common cause of an install that looks fine and records nothing — the collector logs a warning to your server console when this happens.

Mounted routers are handled, but know why it matters

Express rewrites req.url to be relative to the mount point, so a router mounted at /docs turns a request for /docs/llms.txt into /llms.txt. The adapter reads req.originalUrl first, so paths report as the agent actually requested them. If you roll your own instrumentation, this is the bug you'll ship.

Registering it twice double-counts — so it doesn't

Easy to do with nested routers. The adapter marks each response the first time it hooks it, so a second registration is a no-op rather than two reports for one request.

Questions

Does this slow down my app?

No. Human requests classify to null with no network call at all, so they cost a string comparison. Agent requests are reported after the response has already been flushed, on the response's finish event — nothing is ever waiting on Pickrate.

Why does this see 404s when the Next.js middleware doesn't?

Because it runs in a different place. Next middleware executes before the response is generated, so there's no status code to read yet. Express middleware can attach to the response's finish event and read the final status. That's what powers the view showing agents asking for pages they didn't get.

Does it work with Fastify, Koa, or Hono?

Not this adapter — they use different middleware shapes. The core is exported though, so you can call createCollector().report({ method, path, userAgent, status }) from whatever hook your framework gives you. For Hono, the Cloudflare Worker adapter is usually a closer fit since Hono speaks Web-standard Request and Response.

What about a plain node:http server with no framework?

Same import. It's Connect-style, so call it as (req, res, next) inside your request handler, or with no next at all — it works either way.

Other setups

Agent-readable version: https://pickrate.io/install/express.md