> ## 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 Encrypted Items

If you have added items to the index with the `item` field, you can retrieve them via `get_item()`:

<CodeGroup>
  ```python Python theme={null}
  # IDs of items to retrieve
  id = 1

  # Retrieve items from the encrypted index
  item = index.get_item(id)

  print(item)
  # Example item
  # b'Hello!'
  ```

  ```cpp C++ theme={null}
  // IDs of items to retrieve
  uint64_t id = 1;

  // Retrieve items from the encrypted index
  std::vector<uint8_t> item = index.GetItem(id);

  // Print the item
  std::cout << "ID: " << id << ", Contents: " << item << std::endl;
  ```
</CodeGroup>

## Batched Retrieval

You can also retrieve multiple items at once by passing a list of IDs to `get_items()`:

<CodeGroup>
  ```python Python theme={null}
  # IDs of items to retrieve
  ids = [1, 2, 3]

  # Retrieve items from the encrypted index
  items = index.get_items(ids)

  print(items)
  # Example items
  # [b'Hello!', b'World!', b'Cyborg!']
  ```

  ```cpp C++ theme={null}
  // IDs of items to retrieve
  std::vector<uint64_t> ids = {1, 2, 3};

  // Retrieve items from the encrypted index
  cyborg::Array2D<uint8_t> items = index.GetItems(ids);

  // Print the items
  for (size_t i = 0; i < ids.size(); i++) {
      std::cout << "ID: " << ids[i] << ", Contents: " << items[i] << std::endl;
  }
  ```
</CodeGroup>

## API Reference

For more information on getting items from an encrypted index, refer to the API reference:

<CardGroup cols={2}>
  <Card title="Python API Reference" href="../../api-reference/python/encrypted-index/get" icon="python">
    API reference for `get_items()` in Python
  </Card>

  <Card title="C++ API Reference" href="../../api-reference/cpp/encrypted-index/get" icon="brackets-curly">
    API reference for `GetItems()` in C++
  </Card>
</CardGroup>
