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

You can retrieve specific items from the index by their IDs using the `get()` method:

<CodeGroup>
  ```python Python SDK icon="python" theme={null}
  # IDs of items to retrieve
  ids = ["item_20", "item_11"]
  include = ["contents", "metadata"]

  # Retrieve items from the encrypted index
  items = index.get(ids, include)

  print(items)
  # Example items (contents returned in their original format - string or bytes)
  # [{"id": "item_20", "contents": "Hello, World!", "metadata": {"type": "txt"}},
  #  {"id": "item_11", "contents": "Hello, Cyborg!", "metadata": {"type": "md"}}]
  ```

  ```javascript JavaScript SDK icon="js" theme={null}
  // IDs of items to retrieve
  const ids = ["item_20", "item_11"];
  const include = ["contents", "metadata"];

  // Retrieve items from the encrypted index
  const items = await index.get({ ids, include });

  console.log(items);
  // Example items (contents returned as decoded UTF-8 strings)
  // [{id: "item_20", contents: "Hello, World!", metadata: {type: "txt"}},
  //  {id: "item_11", contents: "Hello, Cyborg!", metadata: {type: "md"}}]
  ```

  ```typescript TypeScript SDK icon="code" theme={null}
  import { GetRequest, GetResultItem } from 'cyborgdb';

  // IDs of items to retrieve
  const ids: string[] = ["item_20", "item_11"];
  const include: string[] = ["contents", "metadata"];

  // Retrieve items from the encrypted index
  const params: GetRequest = { ids, include };
  const items: GetResultItem[] = await index.get(params);

  console.log(items);
  // Example items (contents returned as decoded UTF-8 strings)
  // [{id: "item_20", contents: "Hello, World!", metadata: {type: "txt"}},
  //  {id: "item_11", contents: "Hello, Cyborg!", metadata: {type: "md"}}]
  ```

  ```go Go SDK icon="golang" theme={null}
  // IDs of items to retrieve
  ids := []string{"item_20", "item_11"}
  include := []string{"contents", "metadata"}

  // Retrieve items from the encrypted index
  items, err := index.Get(context.Background(), ids, include)
  if err != nil {
      log.Fatal(err)
  }

  fmt.Println(items)
  // Example items (contents returned as string)
  // [{"id": "item_20", "contents": "Hello, World!", "metadata": {"type": "txt"}},
  //  {"id": "item_11", "contents": "Hello, Cyborg!", "metadata": {"type": "md"}}]
  ```

  ```bash cURL icon="rectangle-terminal" theme={null}
  curl -X POST "http://localhost:8000/v1/vectors/get" \
       -H "X-API-Key: your-api-key" \
       -H "Content-Type: application/json" \
       -d '{
         "index_name": "my_index",
         "index_key": "your_64_character_hex_key_here",
         "ids": ["item_20", "item_11"],
         "include": ["contents", "metadata"]
       }'
  ```
</CodeGroup>

## Include Fields

You can specify which fields to include in the response:

* **`vector`**: The vector data itself
* **`contents`**: Content associated with the vector (returned in original format)
* **`metadata`**: Structured metadata object

<Tip>In Python, the `contents` field is returned in its original format (string or bytes) as it was stored. String contents remain strings, and bytes contents remain bytes after decryption. In JavaScript/TypeScript, contents are returned as decoded UTF-8 strings. In Go, contents are returned as string.</Tip>

If you don't specify `include`, the default is `["vector", "contents", "metadata"]`. Note: `id` is always included in results.

## API Reference

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

<CardGroup cols={2}>
  <Card title="REST API Reference" href="../../rest-api/encrypted-index/get" icon="rectangle-terminal">
    REST API reference for `/v1/vectors/get`
  </Card>

  <Card title="Python SDK Reference" href="../../python-sdk/encrypted-index/get" icon="python">
    API reference for `get()` in Python
  </Card>

  <Card title="JS/TS SDK Reference" href="../../js-ts-sdk/encrypted-index/get" icon="js">
    API reference for `get()` in JavaScript/TypeScript
  </Card>

  <Card title="Go SDK Reference" href="../../go-sdk/encrypted-index/get" icon="golang">
    API reference for `Get()` in Go
  </Card>
</CardGroup>
