# List the deployment's workers, grouped by kind

> Reports deployment shape: for each worker kind (`browser`, `egress`, `extract`, `batch`, always in that order and always all four), how many workers are publishing, how many are ready, and each one's load.

Source: https://docs.spicrawl.com/api-reference/fleet/fleet-list-workers

## GET /v1/workers

Operation ID: `fleetListWorkers`. API key scope: `none`.

Reports deployment shape: for each worker kind (`browser`, `egress`, `extract`, `batch`, always in that
order and always all four), how many workers are publishing, how many are ready, and each one's load.
Contains no tenant data. Any valid key may call it.

Use it to explain queuing or `ERR::ENGINE::UNAVAILABLE`: a kind with `present: 0` or `ready: 0` cannot
take work. `last_seen_ms` is an age; a large value means the worker stopped publishing.

### Example

```bash
curl "https://api.spicrawl.com/v1/workers" \
  -H "Authorization: Bearer $SPICRAWL_API_KEY"
```

### Responses

#### 200

The fleet.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `kinds` | array of object (`FleetKind`) | yes | One entry per worker kind, in the fixed order browser, egress, extract, batch, including kinds with no workers. |

Example `fleet`

```json
{
  "kinds": [
    {
      "kind": "browser",
      "present": 1,
      "ready": 1,
      "workers": [
        {
          "worker_id": "browser-7f9c",
          "kind": "browser",
          "capacity": 4,
          "in_flight": 1,
          "free_slots": 3,
          "ready": true,
          "task_stream": "tasks:browser",
          "address": "192.0.2.21:50052",
          "last_seen_ms": 812
        }
      ]
    },
    {
      "kind": "egress",
      "present": 0,
      "ready": 0,
      "workers": []
    },
    {
      "kind": "extract",
      "present": 0,
      "ready": 0,
      "workers": []
    },
    {
      "kind": "batch",
      "present": 0,
      "ready": 0,
      "workers": []
    }
  ]
}
```

#### 401

Missing, invalid, revoked or expired key. Not retryable with the same key.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 403

The key lacks the scope this route requires (`ERR::AUTH::INSUFFICIENT_SCOPE`), or the action is not permitted.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 500

Internal error. Retryable when `retryable` is true.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 503

No proxy exit or engine capacity was available. Retryable after `Retry-After`; 0 credits.

Headers: `Retry-After`, `X-Request-Id`.

`application/problem+json` (`Problem` schema).

Full OpenAPI spec: https://docs.spicrawl.com/openapi.yaml
