> For a complete page index of the Captain API documentation, fetch https://docs.captain.dev/llms.txt?excludeSpec=true

# Get Index

GET https://acme.captain.dev/v1/indexes/{index}

Get an index's status, how many records it holds, and whether changes are still being applied.

Reference: https://docs.captain.dev/reference/product-search/indexes/get-index

## Authentication

- `Authorization` header (bearer token, required) — A write key, issued by Captain. Server side only. Sent as Authorization: Bearer \<key>.

## Request

### Path parameters

- `index` (string, required) — index name

## Response

### 200

index

- `name` (string, optional) — the index name
- `id_field` (string, optional) — Create Index only: the field that holds each record's id
- `status` (enum, optional) — empty: no records yet. pending: changes were accepted and are being applied. building: Captain is refreshing suggestions and spelling in the background, and search serves as usual. ready: every change is applied.
  - Allowed values: `empty`, `pending`, `building`, `ready`
- `record_count` (integer, optional) — Records the index holds, built or not.
- `staged_records` (integer, optional) — the same value as record_count, under its older name
- `staged_documents` (integer, optional) — the same value as record_count, under its older name
- `pending_changes` (boolean, optional) — True while accepted changes are still being applied.
- `staged_changes_since_build` (boolean, optional) — the same value as pending_changes, under its older name
- `object_search` (boolean, optional) — true for an index with typed fields: every index Create Index makes, and an Algolia import sent with object_search true. Settings apply to these
- `build_id` (string, optional, nullable) — the build search serves; null before the first one
- `last_job` (string, optional, nullable) — the id of the index's latest job, for Get Job
- `last_build_at` (integer, optional, nullable) — unix seconds the serving build finished; null when nothing is served, or for a build whose finish time was not recorded
- `created_at` (integer, optional) — unix seconds
- `serving` (IndexServing, optional, nullable) — The build search is serving, and how many records it holds.

## Types

### IndexServing

The build search is serving, and how many records it holds.

- `build` (string, optional, nullable)
- `records` (integer, optional)
- `documents` (integer, optional) — the same value as records, under its older name

## Examples

**Response**

```json
{
  "name": "products",
  "status": "ready",
  "record_count": 12840,
  "staged_records": 12840,
  "staged_documents": 12840,
  "pending_changes": false,
  "staged_changes_since_build": false,
  "object_search": true,
  "build_id": "b20260928211503",
  "last_job": "job_20260928211502_4f9c1a",
  "last_build_at": 1759094251,
  "created_at": 1759093140,
  "serving": {
    "build": "b20260928211503",
    "records": 12840,
    "documents": 12840
  }
}
```

**SDK Code**

```python Python REST
import json
import requests

BASE_URL = "https://acme.captain.dev"
API_KEY = "your_write_key"
INDEX = "products"

headers = {
    "Authorization": f"Bearer {API_KEY}",
}

response = requests.get(
    f"{BASE_URL}/v1/indexes/{INDEX}",
    headers=headers,
    timeout=30.0,
)

print(json.dumps(response.json(), indent=2))
```

```typescript TypeScript REST
const BASE_URL = "https://acme.captain.dev";
const API_KEY = "your_write_key";
const index = "products";

const response = await fetch(`${BASE_URL}/v1/indexes/${index}`, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${API_KEY}`,
  },
});

const result = await response.json();
console.log(JSON.stringify(result, null, 2));
```