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

Retrieves vectors from the encrypted index by their IDs, with options to specify which fields to include in the results.

```python theme={null}
index.get(ids, include=["vector", "contents", "metadata"])
```

### Parameters

| Parameter | Type        | Default                              | Description                       |
| --------- | ----------- | ------------------------------------ | --------------------------------- |
| `ids`     | `List[str]` | -                                    | List of vector IDs to retrieve    |
| `include` | `List[str]` | `["vector", "contents", "metadata"]` | Fields to include in the response |

<Note>`include` defaults differ between endpoints: `get` returns `["vector", "contents", "metadata"]` by default, while [`query`](./query) returns `[]` (only `id`).</Note>

### Returns

`List[Dict]` - List of dictionaries containing the requested vector data.

```python theme={null}
[
  {
    "id": str, # Vector identifier (always included)
    "vector": List[float], # Vector data (if included)
    "contents": str | bytes, # Vector contents (if included, returned as string or bytes depending on how it was stored)
    "metadata": Dict # Vector metadata (if included)
  },
  ...
]
```

<Tip>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.</Tip>

### Exceptions

<AccordionGroup>
  <Accordion title="Error">
    * Throws if the API request fails due to network connectivity issues.
    * Throws if authentication fails (invalid API key).
    * Throws if the encryption key is invalid for the specified index.
    * Throws if there are internal server errors preventing the retrieval.
  </Accordion>

  <Accordion title="Validation Errors">
    * Throws if the `ids` parameter is null, undefined, or empty.
    * Throws if the `include` parameter contains invalid field names.
  </Accordion>
</AccordionGroup>

### Example Usage

```python theme={null}
# Get vectors with all data
vector_ids = ['doc1', 'doc2', 'doc3']
results = index.get(vector_ids)

for item in results:
    print(f"ID: {item['id']}")
    print(f"Vector: {item['vector'][:5]}...")  # Show first 5 dimensions
    print(f"Content: {item.get('contents', 'N/A')}")
    print("---")
```
