> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veilroute.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate a web sensor

> POST /api/v1/sensor on web.veilroute.dev

```http theme={null}
POST https://web.veilroute.dev/api/v1/sensor
```

Generates `sensor_data` for the Akamai browser challenge (the `_abck` cookie), computed by the
real per-site Akamai script inside an isolated runtime.

## Request

### Headers

**X-Api-Key** `string` *required*

Your Akamai Web API key.

**Content-Type** `string` *required*

Must be `application/json`.

### Body

**url** `string`

The target page URL. VeilRoute runs the matching Akamai runtime for it. A target that isn't
available yet returns `422` — ask on [Discord](https://discord.gg/YrZAcNWtE) to add one.

**site** `string`

Optional explicit target key, instead of passing `url`.

**cookies** `string`

The Akamai cookies you already hold for the target site, as a single `Cookie`-header string
(for example `_abck=...; bm_sz=...`). Omit on the very first call if you have none yet.

**index** `number`

Step index (`0`, `1`, `2`) for sites that expect a staged sequence of sensors on the same page.
Omit for a single-shot sensor.

**session\_id** `string`

Opaque id to pin follow-up calls to the same warm runtime. Optional.

## Response

**sensor\_data** `string`

The sensor value. Post it to the target site's Akamai endpoint as `sensor_data`.

**sensor** `string`

Alias of `sensor_data` (same value), for clients that expect a `sensor` field.

**site** `string`

The site the sensor was generated for.

**length** `number`

Length of `sensor_data`, for convenience.

**latency\_ms** `number`

How long the sensor took to compute, in milliseconds.

```bash curl theme={null}
curl -X POST https://web.veilroute.dev/api/v1/sensor \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $VEILROUTE_KEY" \
  -d '{"site":"smiles","cookies":"_abck=...; bm_sz=..."}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://web.veilroute.dev/api/v1/sensor",
    headers={"X-Api-Key": os.environ["VEILROUTE_KEY"]},
    json={"site": "smiles", "cookies": "_abck=...; bm_sz=..."},
    timeout=30,
)
sensor = r.json()["sensor_data"]
```

```javascript Node theme={null}
const res = await fetch("https://web.veilroute.dev/api/v1/sensor", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Api-Key": process.env.VEILROUTE_KEY,
  },
  body: JSON.stringify({ site: "smiles", cookies: "_abck=...; bm_sz=..." }),
});
const { sensor_data } = await res.json();
```

```json 200 OK theme={null}
{
  "sensor_data": "7a74G7m23Vrp0o5c9...",
  "sensor": "7a74G7m23Vrp0o5c9...",
  "site": "smiles",
  "length": 2456,
  "latency_ms": 18
}
```

> [!NOTE]
>
> The web sensor is session- and cookie-bound. Send your follow-up request from the **same clean
> session and egress IP** you used to collect the cookies — see
> [Akamai Web — overview](https://docs.veilroute.dev/akamai-web/overview.md).

See [Errors](https://docs.veilroute.dev/errors.md) for non-`200` responses.


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