Skip to content

API overview

Metty exposes two public APIs. Each runs on its own hostname and uses its own type of key:

APIhostnamepurposeauthentication
Search APIhttps://search.api.metty.eusearch and autocomplete for your own UIpk_ in the key query parameter
Catalog APIhttps://catalog.api.metty.eucatalog synchronisation without a feedsk_ in the Authorization header

If you use the widget, you call neither — the widget handles the communication itself.

Keys

keyformatendpointstransport
publicpk_ + 32 hexadecimal charactersSearch APIkey query parameter
secretsk_ + 64 hexadecimal charactersCatalog APIAuthorization: Bearer <SECRET_API_KEY> header

The public key is meant for reading and may be part of the page source. The secret key allows writing to the catalog and therefore does not belong in a frontend — its place is server configuration, ideally an environment variable.

The Authorization header is never logged. A request over plain HTTP is rejected rather than redirected, because by then the key has already travelled over the network.

Catalog mode

An e-shop is always in one of two modes: feed (we import the catalog from XML) or content_api (you send the catalog through the API). The modes are not combined — an older feed snapshot would overwrite newer changes sent through the API.

Writing to an e-shop in feed mode returns 409 catalog_mode_conflict; switching modes is done by Metty. Reads are not affected by this safeguard: both the catalog export and the Search API work in either mode.

Endpoints

operationendpoint
searchGET /search
autocompleteGET /suggest
catalog writesPUT / PATCH / DELETE /catalog/products
safe full snapshotPOST /catalog/syncs
catalog exportGET /catalog/products

What the API deliberately does not do

Campaigns and result pinning, analytics, personalisation, geographic ranking, nested objects, and objects of type category, brand or article.

If you send a parameter that would affect the result and we cannot handle it, we return an error naming it. A filter that silently fails to apply is a worse outcome than an explicit error.

Metty documentation