# Status

Which endpoints are on.

Says which endpoints are on and reports numbers measured over the last hour (`measured`): calls, the share that succeeded, and p50 and p95 times. The numbers are a report, not a promise. It works with or without a key; with a key the response adds `key`: the key's limits, its jobs in flight and `reach`.

`key.reach` is `full` or `reduced`. `reach_reduced` appears when the recent calls of an account needed more work than they were charged for, for example after many pages that could not be read. Such a call is answered as usual, but pages and searches that are hard to reach are not tried again. Full reach comes back as calls are charged and over time. `GET /v1/web/status` with your key shows the current state in `key.reach`.

### What is charged

Free. Without a key it is rate limited per IP address.

## Request

```
GET https://api.websearch.fast/v1/web/status
```

### Example request

curl:

```bash
curl https://api.websearch.fast/v1/web/status \
  -H "Authorization: Bearer $WEBSEARCH_API_KEY"
```

Python:

```python
import os
import httpx

response = httpx.get(
    "https://api.websearch.fast/v1/web/status",
    headers={"Authorization": f"Bearer {os.environ['WEBSEARCH_API_KEY']}"},
    timeout=60,
)
response.raise_for_status()
print(response.json())
```

TypeScript:

```typescript
const response = await fetch("https://api.websearch.fast/v1/web/status", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.WEBSEARCH_API_KEY}`,
  },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());
```

### Response fields

Status; with a key it adds the key's limits.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | Always `web.status`. |
| `request_id` | string | yes | Same as the X-Request-Id header. |
| `created` | integer | yes | Unix seconds (UTC). |
| `mode` | string | yes | The site's web API mode. While the API is open to administrators only, an administrator's key sees admins and every other caller sees off. One of `on`, `admins`, `off`. |
| `endpoints` | array of object | yes |  |
| `endpoints.endpoint` | string | yes |  |
| `endpoints.state` | string | yes | One of `available`, `degraded`, `unavailable`, `not_offered`. |
| `endpoints.stage` | string |  | One of `S2`, `S3`, `S4`. |
| `endpoints.measured` | object |  | Measured numbers; a report, not a promise. |
| `endpoints.measured.window` | string |  |  |
| `endpoints.measured.calls` | integer |  |  |
| `endpoints.measured.ok_share` | number |  |  |
| `endpoints.measured.p50_ms` | integer |  |  |
| `endpoints.measured.p95_ms` | integer |  |  |
| `key` | object |  |  |
| `key.rate_limit` | integer |  |  |
| `key.concurrency_limit` | integer |  |  |
| `key.async_jobs_running` | integer |  |  |
| `key.reach` | string |  | reduced while a one-page read of the account would not get full reach now: recent calls needed more work than they were charged for (warning reach_reduced). Full reach returns as calls are charged and over time. One of `full`, `reduced`. |
| `updated_at` | integer | yes |  |

### Errors

| Status | Codes |
| --- | --- |
| `400` | `invalid_request`, `invalid_url`, `invalid_schema` or `invalid_image`. Not charged. |
| `401` | `invalid_token`. Not charged. |
| `403` | `pre_consume_token_quota_failed` (the key's own spending limit), `access_denied`, `web_not_allowed` or `model_not_in_plan` (customer keys while plans cannot include the web tools). Not charged. |
| `404` | `not_found` or `invalid_endpoint`. Not charged. |
| `413` | `read_request_body_failed`: the request body is over the limit. Not charged. |
| `429` | `rate_limited`, `concurrency_limited`, `api_key_temporarily_frozen`, or the failure guard. Not charged. |
| `500` | `internal_error`. Not charged. |
| `501` | `api_not_implemented`: the endpoint, type or option has not shipped. Not charged. |
| `503` | `source_unavailable`, `web_api_disabled`, `token_cache_busy` or `billing_busy` (the charge could not be prepared in time; retry after Retry-After). Not charged. |
| `504` | timeout. Not charged. |
