---
title: "Search entity names in a collection's knowledge graph."
method: GET
path: "/graph/{collection_id}/labels"
tags: ["GraphRAG"]
---

# Search entity names in a collection's knowledge graph.

`GET /graph/{collection_id}/labels`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/graph/{collection_id}/labels`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/graph/:collection_id/labels/get.ts> (a function with typed inputs; its response is checked against the schema)

Fuzzy-searches entity names (node labels) for the graph viewer's
entity search. Without a query, returns the most-connected entities.

## Path parameters

- `collection_id` string, uuid, required

## Query parameters

- `q` string
- `limit` integer

## Response `200`

Successful operation

- object
  - `labels` string[], required: Matching entity names.

## Other responses

- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden
- `404`: No knowledge graph exists for this collection.
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
