API ReferenceView as MarkdownOpenAPI

Search

View as Markdown

The site's search: the smart search index built from its content with embeddings, and the AI answer from it.

Endpoints that need a token: the site owner creates it in their admin (Developers > API reference). AI assistants: how to ask the user for one.

5 endpoints.

Create a smart search

Meaning-based search over the site's content, for the search component.

Public

Public - no token needed.

Parameters
kindsstring

The smart search's kinds.

qstring

The words to search for.

pricestring

The smart search's price.

datesstring

The smart search's dates.

collectionsstring

The smart search's collections.

itemsstring

The smart search's items.

sortstring

The order of the results.

skipstring

How many results to skip - for paging.

limitstring

How many results to return.

Status codes

200 500

POST/smart-search
curl -X POST 'http://watch-collection.max-media.io/smart-search?ionic=true' \
  -H 'Content-Type: application/json' \
  -d '{ "kinds": "...", "q": "...", "price": "...", "dates": "...", "collections": "..." }'

Create a smart search

An overview answer to the visitor's question, written only from the site's content the search finds.

Public

Public - no token needed.

Parameters
qstring

The words to search for.

kindsstring

The smart search's kinds.

pricestring

The smart search's price.

datesstring

The smart search's dates.

collectionsstring

The smart search's collections.

itemsstring

The smart search's items.

Status codes

200 429 500

POST/smart-search/answer
curl -X POST 'http://watch-collection.max-media.io/smart-search/answer?ionic=true' \
  -H 'Content-Type: application/json' \
  -d '{ "q": "...", "kinds": "...", "price": "...", "dates": "...", "collections": "..." }'

List all smart searches

The site's searchable items, for the editor's "only these items" picker.

Admin token

Needs a site admin token.

Query parameters
kindsstring

Only smart searches with this kinds.

qstring

The words to search for.

Status codes

200 401 500

GET/smart-search/items
curl -X GET 'http://watch-collection.max-media.io/smart-search/items?ionic=true&kinds=...&q=...' \
  -H 'Authorization: Bearer <TOKEN>'

Create a smart search

Fills the site's locales with the search component's words in the site's language - the editor calls it when the component is added.

Admin token

Needs a site admin token.

Status codes

200 401 500

POST/smart-search/locales
curl -X POST 'http://watch-collection.max-media.io/smart-search/locales?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Reindex the smart search

Teach the search: index the site's content now (the editor's button).

Admin token

Needs a site admin token.

Parameters
rebuildstring

The smart search's rebuild.

Status codes

200 401 500

POST/smart-search/reindex
curl -X POST 'http://watch-collection.max-media.io/smart-search/reindex?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "rebuild": "..." }'
↑↓ Navigate↵ GoEsc Close