---
title: Search Docs
protocol: rest
method: GET
endpoint: /v1/projects/{projectId}/search
description: "Search documentation content"
---

# Search Docs

Full-text search across all documentation pages in a project.

<Endpoint method="GET" path="/v1/projects/{projectId}/search" />

## Path Parameters

<ParamField path="projectId" type="string" required>
  The project ID (e.g., `prj_abc123`).
</ParamField>

## Query Parameters

<ParamField query="q" type="string" required>
  Search query string.
</ParamField>

<ParamField query="limit" type="integer" default="10">
  Maximum number of results. Max: `50`.
</ParamField>

<ParamField query="offset" type="integer" default="0">
  Number of results to skip for pagination.
</ParamField>

<ParamField query="filter" type="string">
  Filter by page path prefix (e.g., `api-reference/`).
</ParamField>

## Response

<ResponseField name="data" type="object">
  Search results.

  <Expandable title="properties">
    <ResponseField name="hits" type="array">
      Array of matching results.

      <Expandable title="Hit object">
        <ResponseField name="id" type="string">
          Page identifier.
        </ResponseField>

        <ResponseField name="title" type="string">
          Page title.
        </ResponseField>

        <ResponseField name="path" type="string">
          Page URL path.
        </ResponseField>

        <ResponseField name="snippet" type="string">
          Text snippet with highlighted matches.
        </ResponseField>

        <ResponseField name="section" type="string">
          Section heading where match was found.
        </ResponseField>

        <ResponseField name="score" type="number">
          Relevance score.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="total" type="integer">
      Total number of matching results.
    </ResponseField>

    <ResponseField name="processingTimeMs" type="integer">
      Search processing time in milliseconds.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
```bash cURL
curl "https://api.syntext.dev/v1/projects/prj_abc123/search?q=authentication&limit=5" \
  -H "Authorization: Bearer stx_abc12345_..."
```

```typescript SDK
import { Syntext } from '@syntext/sdk'

const client = new Syntext('stx_abc12345_...')

const results = await client.search('prj_abc123', {
  query: 'authentication',
  limit: 5,
})
```

```python Python
from syntext import Syntext

client = Syntext("stx_abc12345_...")

results = client.search(
    "prj_abc123",
    query="authentication",
    limit=5,
)
```
</CodeGroup>

### Response

```json
{
  "data": {
    "hits": [
      {
        "id": "pg_auth001",
        "title": "Authentication",
        "path": "/api-reference/authentication",
        "snippet": "All API requests require <mark>authentication</mark> via API key...",
        "section": "Bearer Token",
        "score": 0.95
      },
      {
        "id": "pg_guide002",
        "title": "Getting Started",
        "path": "/guides/quickstart",
        "snippet": "Configure <mark>authentication</mark> in your SDK client...",
        "section": "Setup",
        "score": 0.72
      }
    ],
    "total": 12,
    "processingTimeMs": 8
  }
}
```

## Search Syntax

The search query supports:

- **Exact phrases**: `"api key"` — matches exact phrase
- **Required terms**: `+authentication` — term must appear
- **Excluded terms**: `-deprecated` — exclude results with this term
- **Wildcards**: `auth*` — matches auth, authentication, authorize, etc.

<Note>
Search is powered by Meilisearch and returns results in under 50ms for most queries.
</Note>
