Instead of querying your database, you can use an ID to retrieve individual objects.

::::accordion{title="Additional information"}
:::callout{intent="warning" title="Collection (class) Name in Object CRUD Operations"}
Collections act like namespaces, so two different collections could have duplicate IDs between them.

Prior to Weaviate `v1.14` you can manipulate objects without specifying the collection name. This method is deprecated. It will be removed in Weaviate `v2.0.0`.

Starting in `v1.20`, you can have [multi-tenant](../concepts/data.md#multi-tenancy) datasets. When `multi-tenancy` is enabled, the tenant name is required.

Always include the collection name, and, when enabled, the tenant name.
:::
::::

## Get an object by id

Use an ID to retrieve an object. If the id doesn't exist, Weaviate returns a 404 error.

:::code-group{sync="languages"}
```python title="Python" {3}
jeopardy = client.collections.use("JeopardyQuestion")

data_object = jeopardy.query.fetch_object_by_id("00ff6900-e64f-5d94-90db-c8cfa3fc851b")

print(data_object.properties)
```

```typescript title="JavaScript/TypeScript"
const jeopardy = client.collections.use('JeopardyQuestion')

const response = await jeopardy.query.fetchObjectById('ed89d9e7-4c9d-4a6a-8d20-095cb0026f54')

console.log(response?.properties)
```

```go title="Go"
objects, err := client.Data().ObjectsGetter().
  WithClassName("JeopardyQuestion").
  WithID("00ff6900-e64f-5d94-90db-c8cfa3fc851b").
  Do(ctx)
if err != nil {
  // handle error
  panic(err)
}

for i, obj := range objects {
  fmt.Printf("object[%v]: %+v\n", i, *obj)
}
```

```java title="Java" {3}
CollectionHandle<Map<String, Object>> jeopardy = client.collections.use("JeopardyQuestion");

var dataObjectOpt = jeopardy.query.fetchObjectById("00ff6900-e64f-5d94-90db-c8cfa3fc851b");

dataObjectOpt.ifPresent(dataObject -> System.out.println(dataObject.properties()));
```

```csharp title="C#" {3-5}
var jeopardy = client.Collections.Use("JeopardyQuestion");

var dataObject = await jeopardy.Query.FetchObjectByID(
    Guid.Parse("00ff6900-e64f-5d94-90db-c8cfa3fc851b")
);

if (dataObject != null)
{
    Console.WriteLine(JsonSerializer.Serialize(dataObject.Properties));
}
```
:::

:::callout{intent="info" title="Returned properties"}
By default, all properties and object UUIDs are returned. Blob and reference properties are excluded [unless specified otherwise](../how-to-query-search/basics.md#retrieve-object-properties). _This does not apply to the Go client library._
:::

## Retrieve the object's vector

Object vectors can be retrieved by specifying its return.

:::code-group{sync="languages"}
```python title="Python" {5}
jeopardy = client.collections.use("JeopardyQuestion")

data_object = jeopardy.query.fetch_object_by_id(
    "00ff6900-e64f-5d94-90db-c8cfa3fc851b",
    include_vector=True
)

print(data_object.vector["default"])
```

```typescript title="JavaScript/TypeScript" {4}
const jeopardy = client.collections.use('JeopardyQuestion')

const response = await jeopardy.query.fetchObjectById('ed89d9e7-4c9d-4a6a-8d20-095cb0026f54',{
  includeVector: true
})

console.log(response?.properties)
```

```go title="Go" {4}
objects, err := client.Data().ObjectsGetter().
  WithClassName("JeopardyQuestion").
  WithID("00ff6900-e64f-5d94-90db-c8cfa3fc851b").
  WithVector().
  Do(ctx)
if err != nil {
  // handle error
  panic(err)
}

for i, obj := range objects {
  fmt.Printf("object[%v]: %+v\n", i, *obj)
}
```

```java title="Java" {4}
CollectionHandle<Map<String, Object>> jeopardy = client.collections.use("JeopardyQuestion");

var dataObjectOpt = jeopardy.query.fetchObjectById("00ff6900-e64f-5d94-90db-c8cfa3fc851b",
    q -> q.includeVector()
);

dataObjectOpt.ifPresent(dataObject -> System.out
    .println(Arrays.toString(dataObject.vectors().getSingle("default"))));
```

```csharp title="C#" {5-6}
var jeopardy = client.Collections.Use("JeopardyQuestion");

var dataObject = await jeopardy.Query.FetchObjectByID(
    Guid.Parse("00ff6900-e64f-5d94-90db-c8cfa3fc851b"),
    includeVectors: true
);

if (dataObject?.Vectors.ContainsKey("default") ?? false)
{
    var vector = dataObject.Vectors["default"];
    Console.WriteLine(vector);
}
```
:::

## Retrieve named vectors

Where [named vectors](../reference-configuration/collections.md#multiple-vector-embeddings-named-vectors) are used, you can retrieve one or more of them by specifying their names.

:::code-group{sync="languages"}
```python title="Python"
reviews = client.collections.use("WineReviewNV")  # Collection with named vectors
```

```typescript title="JavaScript/TypeScript" {5}
const reviews = client.collections.use('WineReviewNV') // Collection with named vectors
const objectUuid = '' // Object UUID

const response = await reviews.query.fetchObjectById(objectUuid,{
  includeVector: ['title', 'review_body']
})

console.log(response?.vectors.title)       // print the title vector
console.log(response?.vectors.review_body) // print the review_body vector
```

```java title="Java"
CollectionHandle<Map<String, Object>> reviews = client.collections.use("WineReviewNV"); // Collection with named
```

```csharp title="C#"
var reviews = client.Collections.Use("WineReviewNV"); // Collection with named
```
:::

## Check object existence

To efficiently check if an object with a given [id](../apis/graphql-additional-properties.md#id) exists without retrieving it, make a `HEAD` request to the [`/v1/objects/` REST endpoint](/weaviate/api/rest#tag/objects/head/objects//), or use the following client code:

:::code-group{sync="languages"}
```python title="Python"
# generate uuid based on the key properties used during data insert
object_uuid = generate_uuid5({"name": "Author to fetch"})
```

```js title="JavaScript/TypeScript" {4-6,9}
import { generateUuid5 } from 'weaviate-client';

// generate uuid based on the key properties used during data insert
const object_uuid = generateUuid5(
  JSON.stringify({ name: "Author to fetch"})
)

const authors = await client.collections.use('Author')
const authorExists = await authors.data.exists(object_uuid)

console.log('Author exists: ' + authorExists)
```

```go title="Go"
package main

import (
  "context"
  "fmt"

  "github.com/weaviate/weaviate-go-client/v5/weaviate"
  "github.com/weaviate/weaviate-go-client/v5/weaviate/data/replication"  // for consistency levels
)

func main() {
  cfg := weaviate.Config{
    Host:   "localhost:8080",
    Scheme: "http",
  }
  client, err := weaviate.NewClient(cfg)
  if err != nil {
    panic(err)
  }

  exists, err := client.Data().Checker().
    WithClassName("MyClass").
    WithID("36ddd591-2dee-4e7e-a3cc-eb86d30a0923").
    WithConsistencyLevel(replication.ConsistencyLevel.ONE).  // default QUORUM
    Do(context.Background())

  if err != nil {
    panic(err)
  }
  fmt.Printf("%v", exists)
}

// The parameter passed to "WithConsistencyLevel" can be one of:
// * replication.ConsistencyLevel.ALL,
// * replication.ConsistencyLevel.QUORUM, or
// * replication.ConsistencyLevel.ONE.
//
// It determines how many replicas must acknowledge a request
// before it is considered successful.
```

```java title="Java"
CollectionHandle<Map<String, Object>> jeopardy = client.collections.use("JeopardyQuestion");
boolean exists = jeopardy.data.exists("00ff6900-e64f-5d94-90db-c8cfa3fc851b");
System.out.println(exists);
```

```csharp title="C#"
var jeopardy = client.Collections.Use("JeopardyQuestion");

// The C# client checks for existence by attempting to fetch an object and checking for null.
var dataObject = await jeopardy.Query.FetchObjectByID(
    Guid.Parse("00ff6900-e64f-5d94-90db-c8cfa3fc851b")
);
bool exists = dataObject != null;

Console.WriteLine(exists);
```
:::

## Related pages

- [Connect to Weaviate](../connect-to-weaviate/index.md)
- [How-to: Search](../how-to-query-search/index.md)
- [How-to: Read all objects](read-all-objects.md)
- [References: REST - /v1/objects](/weaviate/api/rest#tag/objects)

## Questions and feedback

Have a question or feedback? Here's how to reach us.

::::card-grid
:::card{title="Community Forum" href="https://forum.weaviate.io/c/support" icon="messages-square"}
Ask questions and connect with other developers on our **Community forum**.
:::

:::card{title="Support" href="/guides/support-overview" icon="life-buoy"}
Weaviate Cloud user or customer? Find the right channel on the **Support page**.
:::
::::

## Related pages

- [Agents](./agents-index.md)
- [AI-assisted Weaviate code generation](./ai-assisted-vibe-coding-index.md)
- [APIs](./apis-index.md)
- [Authorization and authentication](./authorization-and-authentication-index.md)
- [Benchmarks](./benchmarks-index.md)
- [Best practices](./best-practices-index.md)
- [Client libraries](./clients-index.md)
- [Client Libraries / SDKs](./client-libraries-index.md)
- [Cloud](./cloud-index.md)
- [Cloud account management](./cloud-account-management-index.md)

# Agent Instructions

This portal answers questions programmatically. To receive a synthesized,
source-cited answer instead of crawling page by page, append the `?ask=`
query parameter to any page URL on this site:

    /guides/quickstart?ask=how+do+I+authenticate

Optional parameters:

- `&goal=<what-you-are-trying-to-do>` steers the answer toward your
  objective (e.g. `&goal=write+a+python+client`).
- `&version=<label>` scopes the answer to a mounted version when the
  portal publishes more than one.

The response is `text/markdown`: the answer followed by a `# Sources` list
of the portal pages it was grounded in. Status codes are the contract:

- `200` — the answer; `402` — the portal owner’s plan or answer credits are
  exhausted (surface this to your operator; do NOT retry); `429` — you are
  rate-limited; back off for the `Retry-After` seconds; `503` — the answer
  lane is temporarily unavailable; fall back to crawling the `.md` pages.

For the full corpus map read `llms.txt` at the site root; for the tool
surface (search + page fetch as MCP tools) see `/mcp`.
