# Search and feeds as public read endpoints

URL: https://kywi-docs-production.up.railway.app/integrating/search-and-feeds-as-public-read-endpoints
Type: docPage

Anonymous search is published-only and offset-addressed; a feed’s `/rss` and `/items` force published-plus-site onto whatever query the feed stores.

Two families of read endpoint answer without credentials, and both of them are narrower than they look: search is public only while you ask for published rows, and of a feed's three read routes only two are safe to expose.

## Search

Public with `status=published`. Omit `status`, or name any other one, and the request needs a bearer token *and* access to the site — an omitted filter could return drafts, so it is treated as a request for them rather than as a convenience.

## 200 OK

## A result carries no path

Those seven keys are the whole result. `slug` is unique only among a page's siblings, so it is not a URL and cannot be turned into one without a second lookup — resolve the path yourself (the nav tree, or `GET /content/:type/:id`) before you render a link. An authenticated search widens in a second way as well: it returns rows an editor marked *exclude from search & AX*, on the reasoning that an admin looking for something to edit needs to find it.

## Search parameters

The `limit` clamp is load-bearing, not tidiness: each matching row is read with its body and layout so an empty summary can fall back to the page's real copy, so an uncapped `?limit=` would turn one anonymous request into an arbitrarily large read. Paging is by `offset`, and `meta.hasMore` is computed from the offset you actually sent rather than from page arithmetic — a non-aligned offset would otherwise be reported as having more rows left than it does.

The query text goes to Postgres through `websearch_to_tsquery`, which takes arbitrary input by contract: a colon, an ampersand, a stray bracket or an unpaired quote are tokens, not syntax errors. Multiple words are ANDed, a quoted phrase matches adjacency, `or` becomes alternation and a leading `-` negates; input that reduces to nothing matches nothing. Matching runs over the title, body and summary *and* the page's layout copy, so a page composed entirely of modules is findable on its own words, and results come back ranked by relevance with no secondary ordering.

## GET /api/v1/search?siteId=default (no q)

## Feeds

A saved feed is a stored query. Three routes read one, and they differ in whether they trust what was stored.

Runs the feed's query with `status: 'published'` and the resolved site forced over whatever the feed itself was configured with, then answers in the standard `{ data, meta }` list envelope. Page-addressed.

The same forced query, rendered as RSS 2.0 with an `application/rss+xml` content type.

## GET /feeds/:slug runs the stored query unfiltered

`GET /api/v1/feeds/:slug` and `POST /api/v1/feeds/query` both answer without credentials and execute the query exactly as it stands — a feed saved with `status: 'draft'`, or with no status at all, returns unpublished rows to anyone who asks. Point an integration at `/items` or `/rss`, which cannot do that whatever the feed contains, and keep the other two on the server side of your own stack. `GET /api/v1/feeds`, the list of saved feeds and their queries, is likewise unauthenticated.
