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

# classify

> Classify a single request.

```ts theme={null}
classify(request: RequestInput, options?: ClassifyOptions): Classification
```

## Request

**userAgent** `string`

The user agent. Read from `headers` when omitted.

**headers** `Headers | Record\<string, string | string[]\>`

Request headers, in any casing.

**ip** `string | null`

The real client IP. Ports and IPv4-mapped IPv6 addresses are handled. Anything that isn't a single valid address skips verification.

## Options

**ipRanges** `IpRanges`

The result of [`loadIpRanges()`](https://agent-traffic.mintlify.site/reference/load-ip-ranges). Turns on IP verification and impersonator detection.

**headersComplete** `boolean` (default: false)

Set when browser headers reach you untouched over HTTPS. Turns on the `sec-fetch-*`, `sec-ch-ua` and `Accept-Language` checks.

**maxRangeAgeDays** `number` (default: 180)

An operator's range file older than this can still verify a request, but never flags one as an impersonator.

**now** `Date`

Overrides the current time, for tests.

## Returns

**category** `'agent' | 'ai-crawler' | 'crawler' | 'bot' | 'human' | 'unknown'` *required*

See [Categories](https://agent-traffic.mintlify.site/concepts/categories.md).

**kind** `string`

Detail within the category, such as `coding`, `training` or `http-client`.

**id** `string`

The matched dataset entry, such as `claude-code` or `gptbot`.

**name** `string`

The product's display name.

**operator** `string`

The company that runs it.

**version** `string`

The product version, when the user agent carries one.

**verified** `boolean | null` *required*

`true` when the IP is in the operator's published ranges, `false` when it provably isn't who it claims to be, and `null` when it wasn't checked or can't be.

**confidence** `'high' | 'medium' | 'low'` *required*

See [Confidence](https://agent-traffic.mintlify.site/concepts/confidence.md).

**reasons** `string[]` *required*

Plain-English explanations of how the request was classified.

## Example

```js theme={null}
classify({ userAgent: 'Claude-User (claude-code/2.1.308; +https://support.anthropic.com/)' })
```

```json theme={null}
{
  "category": "agent",
  "kind": "coding",
  "id": "claude-code",
  "name": "Claude Code",
  "operator": "Anthropic",
  "version": "2.1.308",
  "verified": null,
  "confidence": "medium",
  "reasons": [
    "user agent matches Claude Code",
    "Claude Code runs on the user's machine, so IP verification does not apply"
  ]
}
```


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