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

# Get Records

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

Get up to 100 records by id. Repeat `ids` once per record. Ids that do not exist, or that the key may not see, come back under `missing`.

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

## Authentication

- `Authorization` header (bearer token, required) — A search key, issued by Captain. Sent as Authorization: Bearer \<key>.
- `Authorization` header (bearer token, required) — A scoped key for one end user, minted from an issuer key that Captain issues. Sent as Authorization: Bearer \<key>.

## Request

### Path parameters

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

### Query parameters

- `ids` (list of string, required) — record ids, 1 to 100: repeat the parameter for each id (?ids=a&ids=b)

## Response

### 200

records

- `records` (list of Record, optional)
- `missing` (list of string, optional) — ids not returned: missing, or hidden from this key (the two are not told apart)

## Types

### Record

a served record: the record as it was sent (every field, url and text included), and fields (the typed values; dates as ISO 8601). Access lists are never returned. An index last built by an older engine answers with its product fields until its next build

- `id` (string, optional)
- `title` (string, optional)
- `description` (string, optional)
- `brand` (string, optional)
- `category` (string, optional)
- `price` (double, optional)
- `rating` (double, optional)
- `image_url` (string, optional)
- `attributes` (RecordAttributes, optional)
- `identifiers` (list of string, optional)
- `fields` (RecordFields, optional)

### RecordAttributes

### RecordFields

## Examples

**Response**

```json
{
  "records": [
    {
      "id": "sku-10482",
      "title": "Moab 3 Mid Waterproof Hiking Boot",
      "description": "Waterproof leather and mesh mid boot with a Vibram TC5+ outsole and a breathable membrane.",
      "brand": "Merrell",
      "category": "Hiking Boots",
      "price": 139,
      "rating": 4.6,
      "image_url": "https://cdn.acme.example/img/sku-10482.jpg"
    },
    {
      "id": "sku-10517",
      "title": "X Ultra 4 Mid GTX Hiking Boot",
      "description": "GORE-TEX mid boot with a Contagrip outsole, built for rocky trails.",
      "brand": "Salomon",
      "category": "Hiking Boots",
      "price": 165,
      "rating": 4.5,
      "image_url": "https://cdn.acme.example/img/sku-10517.jpg"
    }
  ],
  "missing": [
    "sku-99999"
  ]
}
```

**SDK Code**

```python Python REST
import json
import requests

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

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

response = requests.get(
    f"{BASE_URL}/v1/indexes/{INDEX}/records",
    headers=headers,
    params={"ids": ["sku-10482", "sku-10517", "sku-99999"]},
    timeout=30.0,
)

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

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

const params = new URLSearchParams([["ids", "sku-10482"], ["ids", "sku-10517"], ["ids", "sku-99999"]]);

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

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