# Full-text search (default profile)

**Publié le** : 2026-05-08
**Catégorie** : Core CMS

## `GET /search`

**Full-text search (default profile)**

Search across published content titles, excerpts, and bodies with typo
tolerance, using the site's **default search profile**. Results are
ranked by relevance and include highlighted snippets of the matching
terms. Filter by locale, category slug, or tag slug to narrow the
scope further on top of the default profile filter.

Use `/search/{profileSlug}` to target a specific profile (for example
an "API docs" search or a "Marketing" search).

An empty or missing `q` is not an error: the endpoint returns
`{ data: [], meta: { total: 0, ... } }`. Useful when wiring a search
input that fires on every keystroke.

Required permissions: `search.view`, `contents.view`

### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Unauthorized — invalid or missing API token |
| `403` | Forbidden — insufficient permissions |


> **Notes:** - Results are not cached , each request hits the search index directly.
> 
> - The endpoint requires the search feature to be enabled for the site.
> When it is disabled, the response is `503 Service Unavailable` with
> `{ "errors": [{ "message": "Search is not available for this site" }] }`.
> - `limit` defaults to `20` and is capped at `100`. `page` is 1-based.
> - Prefer this V1 endpoint for server-side search; for browser-side
> instant-search with tenant tokens, fetch `/search/config` and talk
> to the search host directly from the client.

### Examples

```bash
# Simple query
curl "https://api.lynkow.com/v1/search?q=getting+started" \
  -H "Authorization: Bearer $API_TOKEN"

# Filtered + paginated
curl "https://api.lynkow.com/v1/search?q=cms&locale=en&category=tutorials&page=1&limit=10" \
  -H "Authorization: Bearer $API_TOKEN"
```

### Response Example

```json
{
  "data": [
    {
      "id": "42",
      "title": "Getting Started with Lynkow",
      "slug": "getting-started-with-lynkow",
      "path": "/blog/getting-started-with-lynkow",
      "excerpt": "Learn how to set up your first headless CMS with Lynkow.",
      "locale": "en",
      "categories": [
        {
          "slug": "tutorials",
          "name": "Tutorials"
        }
      ],
      "tags": [
        {
          "slug": "getting-started",
          "name": "Getting Started"
        }
      ],
      "_formatted": {
        "title": "<em>Getting Started</em> with Lynkow",
        "excerpt": "Learn how to set up your first headless CMS with Lynkow."
      }
    }
  ],
  "meta": {
    "total": 3,
    "page": 1,
    "totalPages": 1,
    "perPage": 10,
    "query": "getting started",
    "processingTimeMs": 4,
    "profile": "default"
  }
}
```

---