Skip to main content
GET
/
v1
/
prompts
Search Prompts
curl --request GET \
  --url https://api.example.com/v1/prompts
{
  "items": [
    {
      "items[].id": "<string>",
      "items[].name": "<string>",
      "items[].description": "<string>",
      "items[].owner_id": "<string>",
      "items[].created_at": "<string>",
      "items[].owner_username": "<string>",
      "items[].tags": [
        "<string>"
      ]
    }
  ],
  "query": "<string>",
  "limit": 123,
  "offset": 123
}
Search for prompts using a query string with optional pagination.

Request

Query Parameters

q
string
required
The search query string. This parameter is required.
limit
integer
default:"20"
Maximum number of results to return. Must be greater than 0. Defaults to 20.
offset
integer
default:"0"
Number of results to skip for pagination. Must be greater than or equal to 0. Defaults to 0.

Response

items
array
Array of prompt objects matching the search query.
items[].id
string
The unique identifier (UUID) for the prompt.
items[].name
string
The name of the prompt.
items[].description
string
The description of the prompt.
items[].owner_id
string
The UUID of the user who owns the prompt.
items[].created_at
string
ISO 8601 timestamp of when the prompt was created.
items[].owner_username
string
The username of the prompt owner.
items[].tags
string[]
Array of tags associated with the prompt.
query
string
The search query that was executed (echoed back).
limit
integer
The limit that was applied to the search results.
offset
integer
The offset that was applied to the search results.

Examples

curl "https://api.prompts.dev/v1/prompts?q=code+review&limit=10&offset=0"

Response Example

200 OK
{
  "items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "code-review-assistant",
      "description": "An AI assistant that helps review code for best practices",
      "owner_id": "123e4567-e89b-12d3-a456-426614174000",
      "owner_username": "alice",
      "created_at": "2026-03-10T14:30:00Z",
      "tags": ["development", "code-review", "automation"]
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "name": "pr-review-bot",
      "description": "Automated pull request reviewer",
      "owner_id": "223e4567-e89b-12d3-a456-426614174001",
      "owner_username": "bob",
      "created_at": "2026-03-09T10:15:00Z",
      "tags": ["automation", "code-review", "github"]
    }
  ],
  "query": "code review",
  "limit": 10,
  "offset": 0
}
To implement pagination, increment the offset parameter by the limit value for each subsequent request. For example: first request uses offset=0, second request uses offset=10, third uses offset=20, etc.

Error Responses

400 Bad Request - Missing Query
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "validation failed",
    "fields": {
      "q": "query is required"
    }
  }
}
500 Internal Server Error
{
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "search failed"
  }
}

Implementation Reference

This endpoint is implemented in the Search handler at internal/prompts/handler.go:90.

Build docs developers (and LLMs) love