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

# Get Items

## Get Item

Retrieves, decrypts and returns an item from its item ID. If an item does not exist at that ID, it will return an empty `bytes` object.

```python theme={null}
def get_item(self, id: int)
```

### Parameters

| Parameter | Type  | Description                   |
| --------- | ----- | ----------------------------- |
| `id`      | `int` | Item ID to retrieve & decrypt |

### Returns

`bytes`: Decrypted item bytes, or empty bytes object if no item was found at the ID provided.

### Exceptions

<AccordionGroup>
  <Accordion title="ValueError">
    * Throws if the item could not be retrieved or decrypted.
  </Accordion>
</AccordionGroup>

### Example Usage

```python theme={null}
# Load index
index = client.load_index(index_name=index_name, index_key=index_key)

# Retrieve the item at ID '0'
item = index.get_item(0)

print(item)
# Example output:
# b'item contents here...'
```

## Get Items

Retrieves, decrypts and returns a list of items from their IDs. If an item does not exist at that ID, it will return an empty `bytes` object.

```python theme={null}
def get_items(self, ids: List[int])
```

### Parameters

| Parameter | Type        | Description                    |
| --------- | ----------- | ------------------------------ |
| `ids`     | `List[int]` | Item IDs to retrieve & decrypt |

### Returns

`List[bytes]`: List of decrypted item bytes, or empty bytes object if no item was found at the ID provided.

### Exceptions

<AccordionGroup>
  <Accordion title="ValueError">
    * Throws if the item could not be retrieved or decrypted.
  </Accordion>
</AccordionGroup>

### Example Usage

```python theme={null}
# Load index
index = client.load_index(index_name=index_name, index_key=index_key)

# Perform query
query_vector = [0.1, 0.2, 0.3]
results = index.query(query_vector=query_vector, top_k=10)

# Extract the item IDs from the query
result_ids = [res["id"] for res in results]

# Retrieve the items from the query results
items = index.get_items(result_ids)

print(items)
# Example output:
# [b'item #1 contents...', b'item #2 contents...', ...]
```
