Zum Inhalt springen

Getting started

Languages & currencies

https://searcio.com/api/v1

Die Dokumentation ist auf Englisch verfasst.

Auf dieser Seite

Two kinds of codes appear throughout the API: a language code on documents, filters and settings, and the shop's currency code. Both are international standards your platform already knows, so there is no list to fetch: send the code your platform uses, in the form described here.

Language codes

A language code is an ISO 639 language, two or three lowercase letters, optionally followed by a region or script of two to four letters, joined with - or _:

Code Language
de German
en English
pt-BR Portuguese (Brazil)
zh_Hant Chinese (Traditional)

The site's language list accepts codes that match ^[a-z]{2,3}([_-][A-Za-z]{2,4})?$. Search treats every language the same way (accents and case are ignored, typos forgiven), so any language works without configuration.

Where a language code is used

Place What it does
languages in the search configuration The languages the site indexes. Empty means any.
lang on a document The language the document is written in.
filter[lang] on search, suggestions, photo search, popular searches, similar products and the assistant Keeps results to the page's language. Documents without a lang still match.
lang on a quiz The language a quiz is offered in; null for every language.
lang on a merchandising rule The language a rule fires in; null for every language.

Use one code everywhere

The codes are compared exactly, so the same language must be written the same way in every place above. Many platforms work with locales such as de_DE; if the site's languages say de and your documents say de_DE, every document is refused:

json
{
  "message": "The language \"de_DE\" is not enabled for this site.",
  "errors": { "documents.0.lang": ["The language \"de_DE\" is not enabled for this site."] }
}

Pick one form, preferably the plain language (de) unless the shop really keeps regional variants apart (de-AT and de-CH), and map your platform's locales to it before sending anything.

A document without a lang is always accepted and matches every language filter. Leave lang out for content that is the same in every language, such as a product with no translatable text.

Plan limits

A plan may limit how many languages a site can index. Health reports the limit and the current languages as plan.languages.limit and plan.languages.allowed; a search configuration with more languages than the plan allows is refused with 422 on languages.

Currency codes

The shop's currency is an ISO 4217 code of three letters, such as EUR, CHF or USD. Send it as currency in the search configuration; it may be in any case and is stored in capitals, and null clears it.

Every current ISO 4217 currency is accepted, as are recently retired codes a shop may still be set to (such as HRK and BGN) and the few codes outside the standard that WooCommerce offers (BTC, IRT, GGP, IMP, JEP and PRB). Any other value is refused with 422 on currency.

What the currency is used for

  • The AI assistant writes every price in it. Without it, the model has to guess, and tends to guess dollars.
  • Result cards whose price is set to the shop's currency show its symbol (see Result cards). The symbol follows the currency the plugin last reported, without the card being published again.

Send the currency whenever the shop's settings are saved, and on a regular sync, so a change in the shop reaches Searcio.

Symbols

A result card shows these symbols; any other currency shows its code.

Symbol Currencies
€ EUR
$ USD, AUD, CAD, NZD, MXN, SGD, HKD
£ GBP
¥ JPY, CNY
CHF CHF
kr / kr. SEK, NOK / DKK, ISK
zł PLN
Kč CZK
Ft HUF
lei RON
лв. BGN
₺ TRY
₴ UAH
₽ RUB
₪ ILS
₹ INR
₩ KRW
฿ THB
R$ BRL
R ZAR