> ## Documentation Index
> Fetch the complete documentation index at: https://agent-traffic.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# patterns and userAgents

> The dataset's user agent patterns, grouped by category.

For a quick check without the full classifier, each category is available as a single case-insensitive regular expression:

```js theme={null}
import { patterns } from '@mintlify/agent-traffic'

patterns.agent.test(userAgent)
patterns['ai-crawler'].test(userAgent)
patterns.crawler.test(userAgent)
patterns.bot.test(userAgent)
```

`userAgents` holds the same patterns as arrays of strings, for building your own matchers:

```js theme={null}
import { userAgents } from '@mintlify/agent-traffic'

userAgents.agent
// ['^Claude-User \\(claude-code/(?<version>[\\d.]+)', '\\bGitHubCopilot[\\w-]*', ...]
```

> [!NOTE]
>
> These match user agents only. Use [`classify`](https://agent-traffic.mintlify.site/reference/classify) for verification, `Accept` fingerprints and browser header checks.

## prefersMarkdown

```ts theme={null}
prefersMarkdown(accept: string): boolean
```

Returns `true` when an `Accept` header ranks `text/markdown` or `text/x-markdown` above `text/html`, taking `q` values into account.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.