---
title: "Get Snippets"
method: GET
path: "/public/snippets"
tags: ["PUBLIC_SNIPPETS"]
---

# Get Snippets

`GET /public/snippets`

List all code snippets with pagination and filtering.

This endpoint is for service users (PUBLIC_TENANT) to retrieve
code snippets stored in Weaviate.

## Query parameters

- `page` integer — Page number (1-indexed)
- `page_size` integer — Items per page
- `database_type` string, nullable — Filter by database type (e.g., clickhouse, postgres)
- `tags` string[], nullable — Filter by tags (multiple allowed)
- `snippet_type` string, nullable — Filter by type (data_definition or sql_example)

## Response `200`

Successful Response

- SnippetsListResponse — Paginated list of snippets
  - `snippets` SnippetItem[], required — List of snippets
    - `id` string, required — Unique identifier for the snippet
    - `title` string, required — Title or name of the snippet
    - `description` string, required — Description of what the snippet does
    - `database_type` string, required — Database type (e.g., clickhouse, postgres)
    - `tags` string[] — Capability tags
    - `type` string, required — Snippet type: data_definition or sql_example
    - `full_content` object — Full snippet content
  - `page` integer, required — Current page number
  - `page_size` integer, required — Number of items per page
  - `has_more` boolean, required — Whether there are more pages
  - `total` integer, required — Total number of snippets matching filters

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/myaltimate/apis/fastapi.md) · [All operations](https://skmtc.net/myaltimate/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myaltimate/fastapi/versions/aab3fe5c9f05/schema)
